Commit Graph

78 Commits

Author SHA1 Message Date
Jonas 'Sortie' Termansen a3a2226bb5 Implemented a simple ATA PIO Mode driver that can read and write.
Read operations are enabled by default, but you must set DISKWRITE=1 in
makeflags before write operations are permitted. This protects against
accidentally corrupting the existing filesystems on the system.
2012-01-08 14:20:39 +01:00
Jonas 'Sortie' Termansen ba9b715c59 Added a global variable at the end of the kernel to detect its size.
This lets the kernel use any memory not directly used by it or the
init ramdisk. Although, now we test whether the kernel fits into
the identitymapped area. It can't really grow down there, unless it
wants to collide with user-space. Instead, modules and the like
(when they are invented), should be put in the upper memory. Or in
their own user-space process, yay, microkernel!
2011-12-23 13:09:09 +01:00
Jonas 'Sortie' Termansen f8129a17b2 Changed the build system for 64-bit quite a bit.
The kernel is now compiled 100% as 64-bit code and converted to ELF32.
2011-12-01 23:06:34 +01:00
Jonas 'Sortie' Termansen 0b1c2a77c9 x64 now compiles again and runs on real hardware.
A nasty bug was fixed that caused triple faults on systems with > 1 GiB RAM.
2011-11-29 01:31:54 +01:00
Jonas 'Sortie' Termansen f232a054d3 Added O=-ON and PANIC_SHORT=1 variables to the makefile. 2011-11-28 15:25:00 +01:00
Jonas 'Sortie' Termansen 2b032b0414 Initial signal support. Please squash improvements into this commit. 2011-11-23 00:19:09 +01:00
Jonas 'Sortie' Termansen 55240fb3f5 Added devfs, with files /tty and /null and mounted it at /dev. 2011-11-21 21:49:13 +01:00
Jonas 'Sortie' Termansen 23fde42249 Added readdirents(2), which ls(1) now uses, and added dir devices.
The initfs and ramfs are now able to list their contents.
2011-11-21 00:02:53 +01:00
Jonas 'Sortie' Termansen 190989646b Added an filesystem able to browse the initrd. 2011-11-20 16:25:32 +01:00
Jonas 'Sortie' Termansen a0eebc01db Added sortix/fs to the sortix/Makefile DIRS variable. 2011-11-19 01:08:51 +01:00
Jonas 'Sortie' Termansen 013e11ca5e Added a RAM filesystem. 2011-11-19 00:57:17 +01:00
Jonas 'Sortie' Termansen ae423eaeef Added open(2).
Please note that mount points and file systems do not exist yet.
2011-11-19 00:57:17 +01:00
Jonas 'Sortie' Termansen a7de7b4905 Added pipe(2), write(2), and read(2). 2011-11-16 21:21:38 +01:00
Jonas 'Sortie' Termansen 9ba01ad3b2 Oh my god, did I include thread.cpp into kernel.cpp!? 2011-11-07 14:36:35 +01:00
Jonas 'Sortie' Termansen 2afe9d1fd6 Implemented the fork() system call and what it needed to work properly.
This commit got completely out of control.

Added the fork(), getpid(), getppid(), sleep(), usleep() system calls, and
aliases in the Maxsi:: namespace.

Fixed a bug where zero-byte allocation would fail.

Worked on the DescriptorTable class which now works and can fork.

Got rid of some massive print-registers statements and replaced them with
the portable InterruptRegisters::LogRegisters() function.

Removed the SysExecuteOld function and replaced it with Process::Execute().

Rewrote the boot sequence in kernel.cpp such that it now loads the system
idle process 'idle' as PID 0, and the initization process 'init' as PID 1.

Rewrote the SIGINT hack.

Processes now maintain a family-tree structure and keep track of their
threads. PIDs are now allocated using a simple hack. Virtual memory
per-process can now be allocated using a simple hack. Processes can now be
forked. Fixed the Process::Execute function such that it now resets the
stack pointer to where the stack actually is - not just a magic value.
Removed the old and ugly Process::_endcodesection hack.

Rewrote the scheduler into a much cleaner and faster version. Debug code is
now moved to designated functions. The noop kernel-thread has been replaced
by a simple user-space infinite-loop program 'idle'.

The Thread class has been seperated from the Scheduler except in Scheduler-
related code. Thread::{Save,Load}Registers has been improved and has been
moved to $(CPU)/thread.cpp. Threads can now be forked. A new CreateThread
function creates threads properly and portably.

Added a MicrosecondsSinceBoot() function.

Fixed a crucial bug in MemoryManagement::Fork().

Added an 'idle' user-space program that is a noop infinite loop, which is
used by the scheduler when there is nothing to do.

Rewrote the 'init' program such that it now forks off a shell, instead of
becoming the shell.

Added the $$ (current PID) and $PPID (parent PPID) variables to the shell.
2011-11-01 01:00:20 +01:00
Jonas 'Sortie' Termansen c705bf39ff Ported kernel to new syscall API and started cleaning up the old one. 2011-10-27 00:20:28 +02:00
Jonas 'Sortie' Termansen 66192d1e86 Rewrote memory management again and added support for x64 and forking. 2011-10-10 01:02:57 +02:00
Jonas 'Sortie' Termansen cc61176e5b Restored support for JSSortix using very ugly hacks. :( 2011-09-08 11:10:41 +02:00
Jonas 'Sortie' Termansen 3859e1f566 Refactored interrupt system and got rid of old not-mine code. 2011-09-07 18:45:07 +02:00
Jonas 'Sortie' Termansen c157e65352 Removed lots of deprecated suff! 2011-09-06 19:51:47 +02:00
Jonas 'Sortie' Termansen d9c0c8d0cd Added a driver to parse the Sortix init ramdisk. 2011-08-27 20:08:33 +02:00
Jonas 'Sortie' Termansen 5c86cb4abd Processes now remember the memory segments it has loaded. 2011-08-27 16:46:00 +02:00
Jonas 'Sortie' Termansen 9db2c88aca Sortix can now load ELF executables into addresses spaces. 2011-08-23 00:42:56 +02:00
Jonas 'Sortie' Termansen 9995354f95 Moved CPU code shared by x86 and x64 into x86-family. 2011-08-12 17:33:18 +02:00
Jonas 'Sortie' Termansen 15ce53919c Added VGA API allowing userspace to easily access 0xB8000. 2011-08-11 22:03:13 +02:00
Jonas 'Sortie' Termansen 1026354e98 Sortix now uses the Device class.
This class is very WIP and is just experimental.
2011-08-08 15:20:08 +02:00
Jonas 'Sortie' Termansen 07b409c1a0 Added a wrapper class for handling file descriptors. 2011-08-07 19:47:43 +02:00
Jonas 'Sortie' Termansen 9b79673dcb Initial version of Sortix. 2011-08-05 14:25:00 +02:00