Commit Graph

2586 Commits

Author SHA1 Message Date
Jonas 'Sortie' Termansen 313079483a Missing files from the previous two commits. Ooops! 2011-11-21 00:19:55 +01:00
Jonas 'Sortie' Termansen 0b90ab534f ramfs now supports O_TRUNC. 2011-11-21 00:12:20 +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 e3bb0dfc9d Fixed bug in previous commit. Ooops. 2011-11-20 22:48:22 +01:00
Jonas 'Sortie' Termansen c1849ed7d8 / is no longer a valid filename in ramfs. 2011-11-20 22:47:39 +01:00
Jonas 'Sortie' Termansen 06c0777193 Improvements to sortix/mount.cpp 2011-11-20 17:07:34 +01:00
Jonas 'Sortie' Termansen 728bde3bee Added strncmp(3). 2011-11-20 17:07:01 +01:00
Jonas 'Sortie' Termansen a6a2c400bf Hard-code-mounted the initd at /bin. 2011-11-20 16:25:55 +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 446616b3aa Improved JSVM compabillity. 2011-11-20 15:58:42 +01:00
Jonas 'Sortie' Termansen 002a1f9ea6 Hardcoded the PWD as '/'. 2011-11-19 10:32:29 +01:00
Jonas 'Sortie' Termansen 3d7e565d23 strcat(3) now nul-terminates strings properly. 2011-11-19 10:32:08 +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 5714eaa882 Added a simple text editor that can save/load files. 2011-11-19 00:57:17 +01:00
Jonas 'Sortie' Termansen 96d94d9597 cat(1) can now cat files. 2011-11-19 00:57:17 +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 6447783c12 strcpy(3) now nul-terminates dest. 2011-11-19 00:52:42 +01:00
Jonas 'Sortie' Termansen 15329187b9 Unrefing a device that has never been ref'd will also destroy it. 2011-11-17 23:14:45 +01:00
Jonas 'Sortie' Termansen 708643d0f2 Fixed bug in dup(2). 2011-11-17 23:03:14 +01:00
Jonas 'Sortie' Termansen fccad5e31c Don't leave old binaries around in the initrd. 2011-11-17 22:33:17 +01:00
Jonas 'Sortie' Termansen dd349a150a Merge branch 'master' of gitorious.org:sortix/sortix
Conflicts:
	libmaxsi/c/hsrc/unistd.h
	libmaxsi/io.cpp
	sortix/io.cpp
	sortix/syscallnum.h
2011-11-17 22:28:20 +01:00
Jonas 'Sortie' Termansen 05196f49b2 Added dup(2). 2011-11-17 20:34:04 +01:00
Jonas 'Sortie' Termansen 5bde040295 Fixed randomness-related crash in snake. 2011-11-17 13:11:09 +01:00
Jonas 'Sortie' Termansen e8cd27c353 Added close(2) and fixed bugs in pipe(2) and others. 2011-11-17 10:22:43 +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 c5605b6693 Pong and snake now use rand(3). 2011-11-10 12:28:35 +01:00
Jonas 'Sortie' Termansen 8b7188e6a4 Added the $? command to the shell. 2011-11-10 00:03:53 +01:00
Jonas 'Sortie' Termansen 29a1b68933 Added --speed <ms>, --help, and --usage to conway. 2011-11-09 23:54:35 +01:00
Jonas 'Sortie' Termansen 33c0a9586e Added atoi(3). 2011-11-09 23:48:26 +01:00
Jonas 'Sortie' Termansen ae599b6d67 Argv now works in main. 2011-11-09 23:18:26 +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 b27fa68c81 The shell now forks, uses exit, and wait. 2011-11-07 01:00:18 +01:00
Jonas 'Sortie' Termansen 024f1581ea Added the wait() and waitpid() system call. 2011-11-07 00:59:48 +01:00
Jonas 'Sortie' Termansen 851ee78903 Added some support for blocking system calls in the kernel. 2011-11-07 00:48:20 +01:00
Jonas 'Sortie' Termansen cfd7648ca9 Added the _exit() system call.
exit() will not call _exit() yet, we need support for wait() in the shell.
2011-11-05 20:19:36 +01:00
Jonas 'Sortie' Termansen 09b1252821 Added an AsIs() function to the Syscall namespace. 2011-11-05 20:03:17 +01:00
Jonas 'Sortie' Termansen 196e958336 Added a CPU::ShutDown() function. 2011-11-05 19:13:16 +01:00
Jonas 'Sortie' Termansen 884ce30c07 The scheduler now keeps track of the initial process. 2011-11-05 18:49:30 +01:00
Jonas 'Sortie' Termansen f9e10ab265 Added an API for user-space to list the initrd, and 'ls' does so now. 2011-11-03 18:26:43 +01:00
Jonas 'Sortie' Termansen 329c8cc468 Merge gitorious.org:sortix/sortix 2011-11-02 20:37:04 +01:00
Jonas 'Sortie' Termansen 0fdfa570cc Removed obsolete IKeystrokable. 2011-11-02 19:43:48 +01:00
Jonas 'Sortie' Termansen 52a228861e cr2 isn't pushed by pushal. 2011-11-02 19:27:46 +01:00
Jonas 'Sortie' Termansen b742eafd7c Removed the unused Maxsi::StdOut namespace. 2011-11-02 19:17:17 +01:00
Jonas 'Sortie' Termansen cb92f073d9 Fixed incorrect header in libmaxsi/syscall.h. 2011-11-02 19:14:23 +01:00
Jonas 'Sortie' Termansen d76757b21b Don't add unrelated stuff to the src tarball. 2011-11-02 19:14:01 +01:00
Jonas 'Sortie' Termansen e110594ab2 Processes are listed in a global array sorted after pid. 2011-11-02 17:51:01 +01:00
Jonas 'Sortie' Termansen 2db3c902fb Fixed missing breaks in switch in vgaterminal.cpp. 2011-11-02 11:39:02 +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