Commit Graph

316 Commits

Author SHA1 Message Date
Jonas 'Sortie' Termansen bd8967069e Replace libmaxsi headers with libc headers. 2012-12-14 14:13:35 +01:00
Jonas 'Sortie' Termansen c0fabc2e8d Move remainder of Maxsi::String into kernel tree. 2012-12-14 14:13:35 +01:00
Jonas 'Sortie' Termansen f3988b92f3 Made ReadParamString not depend on Maxsi::String::Substring. 2012-12-14 14:13:35 +01:00
Jonas 'Sortie' Termansen b732c46bf5 Remove unused declarations from <libmaxsi/string.h>. 2012-12-14 14:13:35 +01:00
Jonas 'Sortie' Termansen 1b26d1bacf Make sprintf family freestanding.
And use them in the kernel.
2012-12-14 14:13:35 +01:00
Jonas 'Sortie' Termansen 6ce762aac4 Replace Maxsi::String::Seek with strchr. 2012-12-14 14:13:35 +01:00
Jonas 'Sortie' Termansen 2206412e14 Replace Maxsi::String::Reject with strcspn. 2012-12-14 14:13:35 +01:00
Jonas 'Sortie' Termansen 02a711befb Replace Maxsi::String::Accept with strspn. 2012-12-14 14:13:35 +01:00
Jonas 'Sortie' Termansen e5cf6c18f7 Replace Maxsi::String::Compare with strcmp. 2012-12-14 14:13:35 +01:00
Jonas 'Sortie' Termansen 5e4dadbba0 Replace Maxsi::String::Length with strlen. 2012-12-14 14:13:34 +01:00
Jonas 'Sortie' Termansen 5e7bf8527c Move <libmaxsi/sortedlist.h> into kernel tree. 2012-12-14 14:13:34 +01:00
Jonas 'Sortie' Termansen df7d8ca335 Move crc32 checksum code into kernel. 2012-12-14 14:13:34 +01:00
Jonas 'Sortie' Termansen fd03635d4f Remove <libmaxsi/integer.h>. 2012-12-14 14:13:34 +01:00
Jonas 'Sortie' Termansen 1435937dd4 Remove <libmaxsi/sortix-sound.h>. 2012-12-14 14:13:34 +01:00
Jonas 'Sortie' Termansen 6529af1f57 Remove <libmaxsi/sortix-vga.h>. 2012-12-14 14:13:34 +01:00
Jonas 'Sortie' Termansen 2c286d6830 Replace <libmaxsi/format.h> with <stdio.h>. 2012-12-14 14:13:34 +01:00
Jonas 'Sortie' Termansen e9c8b0b669 Replace <libmaxsi/process.h> with <unistd.h>. 2012-12-14 14:13:34 +01:00
Jonas 'Sortie' Termansen b4374f66b7 Replace <libmaxsi/memory.h> with <string.h>. 2012-12-14 14:13:34 +01:00
Jonas 'Sortie' Termansen 5d082b3bbb Replace Maxsi::Error:: with <errno.h>. 2012-12-14 14:13:34 +01:00
Jonas 'Sortie' Termansen 42754f1728 Replace ASSERT with assert of <assert.h>. 2012-12-14 14:13:34 +01:00
Jonas 'Sortie' Termansen b685b7a9eb Don't include Maxsi:: API in kernel.cpp.
Since kernel.cpp is intended to be an example of the current best coding
practices within the Sortix kernel, and the Maxsi:: API is deprecated and
is being removed, it should rather use the nice C standard library.
2012-12-14 14:13:34 +01:00
Jonas 'Sortie' Termansen 0437d75147 Remove libmaxsi stddef.h and stdarg.h.
These are provided by the cross compiler.
2012-12-14 14:13:34 +01:00
Jonas 'Sortie' Termansen 8b7eef9fe4 Removed <libmaxsi/thread.h> header. 2012-12-14 14:13:34 +01:00
Jonas 'Sortie' Termansen 1f1bdc8c22 Remove unused <libmaxsi/io.h> header. 2012-12-14 14:13:33 +01:00
Jonas 'Sortie' Termansen 86107a467c Use <sys/syscall.h> instead of <libmaxsi/syscall.h>. 2012-12-14 14:13:33 +01:00
Jonas 'Sortie' Termansen a1ed9144bc Sort libmaxsi objects into freestanding and hosted. 2012-12-14 14:13:33 +01:00
Jonas 'Sortie' Termansen afafea577a Remove conditional libc macros in libmaxsi. 2012-12-14 14:13:33 +01:00
Jonas 'Sortie' Termansen b293fb3171 Remove kernel platform.h dependency on libmaxsi platform.h.
This reduces the dependence on libmaxsi with the aim that the Maxsi:: api
can be removed and replaced with the standard C library.
2012-12-14 14:13:33 +01:00
Jonas 'Sortie' Termansen 9cf092d32e Use cross compiler in build system. 2012-12-14 14:13:33 +01:00
Jonas 'Sortie' Termansen 82035e87da Add makefile targets for installing sysroot base headers. 2012-09-10 21:45:38 +02:00
Jonas 'Sortie' Termansen a1c106ce1c Early prototype of an asteroids game.
asteroids(1) now uses chvideomode(1) if no driver is active.

Made the asteroids game object oriented.

Added asteroids to ateroids(1).

uptime(2) in asteroids.
2012-09-09 13:34:48 +02:00
Jonas 'Sortie' Termansen 07b3cc8e06 Implement WNOHANG in waitpid(2). 2012-09-08 19:19:31 +02:00
Jonas 'Sortie' Termansen bde41a37ec Implement crt1.o, crti.o, and crtn.o.
This helps running cross compiled programs as well as compiling programs
under Sortix with gcc. There is also support for global constructors.

Currently, cross-compiled executables uses these startup files. The current
build system continues to use start.o, which does not offer global
constructors and other useful features.

Note that these using the crtX.o files requires the crtbegin.o and crtend.o
files that ship with the cross compiler, but that should be no problem.
2012-09-08 18:45:53 +02:00
Jonas 'Sortie' Termansen 2135a2d432 Improve assertions in malloc.
This also uses the user-space available <assert.h> header.
2012-09-08 18:45:53 +02:00
Jonas 'Sortie' Termansen 2158a16904 Add setlocale(3) and localeconv(3).
Ok, these are kinda hacky but they do implement a skeleton that a real
implementation can be based upon.
2012-09-08 18:45:53 +02:00
Jonas 'Sortie' Termansen 3fd270f7a2 Remove trailing whitespace. 2012-09-08 18:45:53 +02:00
Jonas 'Sortie' Termansen bb3e590915 Add proper implementation of scanf family.
There are still a few non-standard quirks and things that needs to be
properly implemented but that shouldn't be too hard and the most important
features are now implemented.
2012-09-08 18:45:53 +02:00
Jonas 'Sortie' Termansen cd728c9af9 Add fabs{,f,l}(3). 2012-09-08 18:45:53 +02:00
Jonas 'Sortie' Termansen 01ea5419cc Add E2BIG. 2012-09-08 18:45:53 +02:00
Jonas 'Sortie' Termansen 9aba01cc82 Make libmaxsi/c++.cpp symbols weak.
This prepares for Sortix using libgcc.a, since it would otherwise collide
with libmaxsi/c++.o.
2012-09-08 18:45:53 +02:00
Jonas 'Sortie' Termansen 6755318919 Add bsearch(3).
This is a rather stupid implementation as it does the search in linear
time. More importantly, it is correct and helps porting gcc. Besides, it
can easily be fixed in due time.
2012-09-08 18:45:53 +02:00
Jonas 'Sortie' Termansen 90a4009c53 Make putenv(3) copy the input string.
This violates POSIX but POSIX is stupid in this respect. Of course, this
will ever so subtly break some applications. Not sure how this stupid design
can be fixed without breaking backwards compatibility. Perhaps remove the
putenv(3) function and replace it with a better replacement? (Or perhaps you
should just use setenv(3) anyways..)
2012-09-08 18:45:53 +02:00
Jonas 'Sortie' Termansen 550f9db140 Make string.h include strings.h.
This helps gcc build since it assumes that string.h provides various
functions that POSIX mandates is in strings.h. This is OK with me since that
strings.h is a nasty hack anyways. Also, glibc does this.
2012-09-08 18:45:52 +02:00
Jonas 'Sortie' Termansen 720b02b0fc Declare size_t and off_t before FILE in wchar.h. 2012-09-08 18:45:52 +02:00
Jonas 'Sortie' Termansen a478dda4d9 fflush(3) on fseeko(3).
This caused a corruption of the resulting file if the program fwrite some
data that is buffered, then fseeks, and then fflushes. The fwrite will then
happen at the wrong memory location. Flushing in fseeko(3) fixes the problem
but it may cause violate some standard or just be inefficient.
2012-09-08 18:45:52 +02:00
Jonas 'Sortie' Termansen 910197ffa7 Fix wrong return value of fdio_seek. 2012-09-08 18:45:52 +02:00
Jonas 'Sortie' Termansen 29f5cd2335 Fix return value of fdio fread(3) and fwrite(3).
Previously fread and fwrite for file descriptors would return the number of
bytes read/written rather than the number of elements read/written. This
breaks the C standard and broke various third party programs such as
readelf from binutils.
2012-09-08 18:45:52 +02:00
Jonas 'Sortie' Termansen b4192c10e9 Refactor libc process exit and abortion.
Removed Maxsi::Process:: functions as they suck and are barely used. Gave
the functions standard names and put them in their own source files.

The declarations now have nice noreturn attributes attached.
2012-09-08 18:45:52 +02:00
Jonas 'Sortie' Termansen 34970e63f3 Implement assert(3) properly. 2012-09-08 18:45:52 +02:00
Jonas 'Sortie' Termansen 13c0ab638a Sort the output of ls(1). 2012-09-08 18:45:52 +02:00