Commit graph

303 commits

Author SHA1 Message Date
Jonas 'Sortie' Termansen
9f35df813e Implemented errno(3), added support in both kernel and utils. 2011-11-22 17:26:47 +01:00
Jonas 'Sortie' Termansen
e8fb8d885b execve(2) can now load programs from the filesystem.
Previously it was restricted to only the ramdisk.
2011-11-22 14:02:33 +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
8b2b52b9f6 Added unlink(2) and rm(1). 2011-11-21 19:01:56 +01:00
Jonas 'Sortie' Termansen
211af74690 Fixed bug where SortedList::Search did not sort the list if needed. 2011-11-21 14:56:09 +01:00
Jonas 'Sortie' Termansen
d4590cefa1 Added chdir(2), getcwd(2), which mxsh and ls now uses. 2011-11-21 12:19:57 +01:00
Jonas 'Sortie' Termansen
313079483a Missing files from the previous two commits. Ooops! 2011-11-21 00:19:55 +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
728bde3bee Added strncmp(3). 2011-11-20 17:07:01 +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
3d7e565d23 strcat(3) now nul-terminates strings properly. 2011-11-19 10:32:08 +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
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
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
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
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
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
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
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
a087f4b91c Added a sortedlist template class to libmaxsi/sortedlist.h. 2011-10-25 18:21:06 +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
ab2b14fc16 Moved start.s into the subdirs for x86 and x64. 2011-09-15 22:39:19 +02:00
Jonas 'Sortie' Termansen
739b296a95 libmaxsi now has a function called upon process creation. 2011-09-14 18:11:52 +02:00
Jonas 'Sortie' Termansen
d3a7b18f69 libc now has exit() and abort() functions. 2011-09-13 16:49:08 +02:00
Jonas 'Sortie' Termansen
c157e65352 Removed lots of deprecated suff! 2011-09-06 19:51:47 +02:00
Jonas 'Sortie' Termansen
d494dc2d53 Made an integer-to-string API for user-space to use. 2011-09-06 16:16:25 +02:00
Jonas 'Sortie' Termansen
2c18d43359 Added the programs ls and help. 2011-08-28 12:38:01 +02:00
Jonas 'Sortie' Termansen
34e9ca277d Added a shell, a few programs, and added support for SIGINT. 2011-08-28 12:38:01 +02:00
Jonas 'Sortie' Termansen
2f9d08a800 Added a process execute API. 2011-08-28 12:38:01 +02:00
Jonas 'Sortie' Termansen
7510708ea1 Gave user-space access to VGA color constants. 2011-08-23 21:02:15 +02:00
Jonas 'Sortie' Termansen
ea396ddd69 Libmaxsi now offers printf to user-space programs. 2011-08-23 01:32:49 +02:00
Jonas 'Sortie' Termansen
4c1cb806ba Added a sound api. 2011-08-22 00:25:28 +02:00
Jonas 'Sortie' Termansen
9ee93082c5 Hello is now a hello world sample ANSI text editor. 2011-08-21 12:52:56 +02:00
Jonas 'Sortie' Termansen
4db550c13b Added libmaxsi keyboard API, allowing user-space to use the keyboard. 2011-08-21 12:52:56 +02:00
Jonas 'Sortie' Termansen
fe65e12992 Removed unnededed TLB flush from libmaxsi heap code. 2011-08-12 00:55:48 +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
206a7993f3 Such that the sortix subdir is git'd too. 2011-08-07 01:38:51 +02:00
Jonas 'Sortie' Termansen
acd2ae58c6 And the c/h/sys dir too.. 2011-08-07 01:37:43 +02:00
Jonas 'Sortie' Termansen
a4c2afedb7 libmaxsi now creates the c/h dir if missing. 2011-08-07 01:36:27 +02:00
Jonas 'Sortie' Termansen
794630a802 Adding proper .gitignore files. 2011-08-07 01:22:36 +02:00
Jonas 'Sortie' Termansen
66c058fba1 Refactored virtual memory management, making it less buggy.
uintptr_t is now replaced with addr_t when referring to physical memory
addresses in Sortix. Many bugs in the previous memory management code have been
fixed. The new interface is less flexible - but should prove more solid as the
nasty internals have been hidden away. The current interface design should also
make the code more 64-bit ready/friendly. And so on.
2011-08-07 00:18:41 +02:00
Jonas 'Sortie' Termansen
9b79673dcb Initial version of Sortix. 2011-08-05 14:25:00 +02:00