Commit Graph

109 Commits

Author SHA1 Message Date
Jonas 'Sortie' Termansen d3c16470e3 .so's are no longer installed into sysroot as there are no kernel support. 2012-01-08 15:39:40 +01:00
Jonas 'Sortie' Termansen 954fd11703 Added isalnum(3), isalpha(3), isblank(3), iscntrl(3), isdigit(3),
isgraph(3), islower(3), isprint(3), ispunct(3), isspace(3), isupper(3),
isxdigit(3), tolower(3), and toupper(3).
2012-01-08 15:35:35 +01:00
Jonas 'Sortie' Termansen ad200ffa91 Added getpagesize(2) with the new return type size_t.
This function is non-standard  and size_t is better than int here.
2012-01-08 14:58:57 +01:00
Jonas 'Sortie' Termansen 809bedd32b Just ignore the restrict keyword fully. 2012-01-08 14:30:50 +01:00
Jonas 'Sortie' Termansen 8eebe18922 Added an implementation of puts(3) because gcc needs it.
I still didn't add it to stdio.h since it's still stupid.
2012-01-08 14:30:50 +01:00
Jonas 'Sortie' Termansen 25d8551b26 Moved _start into crtbegin.o as that's where the cross compiler wants it. 2012-01-08 14:30:50 +01:00
Jonas 'Sortie' Termansen 9a77901883 Added missing prototypes to stdio.h. 2011-12-30 01:23:00 +01:00
Jonas 'Sortie' Termansen 73a7e8f53d Forgot to actually add remove(3) in the previous commit. 2011-12-30 01:13:41 +01:00
Jonas 'Sortie' Termansen deee5e4335 Added a partial implementation of remove(3), since rmdir(2) is missing. 2011-12-30 01:11:33 +01:00
Jonas 'Sortie' Termansen 5d16b5c61e Added getchar(3) and putchar(3). 2011-12-30 01:06:27 +01:00
Jonas 'Sortie' Termansen 66999ff94a Added putc(3) and getc(3). 2011-12-30 01:03:24 +01:00
Jonas 'Sortie' Termansen d39d4222b5 Added fputc(3) and fgetc(3). 2011-12-30 00:55:59 +01:00
Jonas 'Sortie' Termansen 76800553da Clarified comment about typedef struct _FILE FILE. 2011-12-30 00:42:36 +01:00
Jonas 'Sortie' Termansen 064b69d2b6 Added fseeko(3) and ftello(3). 2011-12-30 00:36:39 +01:00
Jonas 'Sortie' Termansen 912b2f78f0 Implemented the fdio backend of fseek(3) and ftell(3). 2011-12-26 23:15:52 +01:00
Jonas 'Sortie' Termansen 648b324385 Added lseek(2). 2011-12-26 23:12:12 +01:00
Jonas 'Sortie' Termansen 2b3b4ed62a error(3) and perror(3) now writes to stderr. 2011-12-24 04:39:16 +01:00
Jonas 'Sortie' Termansen fdbd4ca90d Implemented large parts of the stdio(3), including fprintf.
Made FILE an interface to various backends. This allows application writers
to override the standard FILE API functions with their own backends. This
is highly unportable - it'd be nice if a real standard existed for this.
glibc already does something like this internally, but AFAIK you can't hook
into it.

Added fdopen(3), fopen(3), fregister(3), funregister(3), fread(3),
fwrite(3), fseek(3), clearerr(3), ferror(3), feof(3), rewind(3), ftell(3),
fflush(3), fclose(3), fileno(3), fnewline(3), fcloseall(3), memset(3),
stdio(3), vfprintf(3), fprintf(3), and vprintf(3).

Added a file-descriptor backend to the FILE API.

fd's {0, 1, 2} are now initialized as stdin, stdout, and stderr when the
standard library initializes.

fcloseall(3) is now called on exit(3).

decl/intn_t_.h now @include(size_t.h) instead of declaring it itself.

Added <stdint.h>.

The following programs now flush stdout: cat(1), clear(1), editor(1),
init(1), mxsh(1).

printf(3) is now hooked up against vprintf(3), while Maxsi::PrintF
remains using the system call, for now.
2011-12-24 04:28:34 +01:00
Jonas 'Sortie' Termansen 4841d83ff8 Added calloc(3). 2011-12-24 04:05:38 +01:00
Jonas 'Sortie' Termansen 0515111314 The initial ramdisk is now mapped onto a special location.
This fixes issues where it did not fit into the first few MiB,
or that GRUB loaded it someplace weird.

The kernel heap is now also protected against growing into the
ramdisk and the kernel stack.
2011-12-22 14:13:18 +01:00
Jonas 'Sortie' Termansen 203f2a2bb1 Better default octal detection in strtol(3). 2011-12-16 22:24:29 +01:00
Jonas 'Sortie' Termansen 73bcafc004 strtol(3) now returns 0 if the string was + or -. 2011-12-16 21:44:32 +01:00
Jonas 'Sortie' Termansen f1a49dbad3 Hex numbers now work properly in strtol(3). 2011-12-16 21:15:26 +01:00
Jonas 'Sortie' Termansen da2bfac34f Fixed bug in strtol*. 2011-12-16 18:28:22 +01:00
Jonas 'Sortie' Termansen bf6a4c1861 Added strto{u,}{l,}l(3). 2011-12-16 16:49:27 +01:00
Jonas 'Sortie' Termansen acf1eebc98 Added user-space memory allocation. 2011-12-16 13:24:49 +01:00
Jonas 'Sortie' Termansen fecaf6b43f System calls in libmaxsi now use the constants from syscallnum.h. 2011-12-09 12:41:06 +01:00
Jonas 'Sortie' Termansen 0bb91ee161 printf(3) now supports signed integers and ptrdiff_t. 2011-12-05 13:59:26 +01:00
Jonas 'Sortie' Termansen 854d9b171a uptime(2) now reports usecs instead of msecs. 2011-12-04 21:27:21 +01:00
Jonas 'Sortie' Termansen 597e700618 Removed outdated comment about sleep(2) and signals. 2011-12-04 21:08:26 +01:00
Jonas 'Sortie' Termansen 5bc05c4e0e Moved around comments in heap.cpp. 2011-12-04 20:59:42 +01:00
Jonas 'Sortie' Termansen fcc6147c5c Prevent the kernel from calling system calls. 2011-12-04 20:56:29 +01:00
Jonas 'Sortie' Termansen 60d23eac19 printf now understands %l and %j. 2011-12-04 20:53:43 +01:00
Jonas 'Sortie' Termansen de70b1804d Rewrote the x86 64-bit division stubs, which now actually work. 2011-12-04 19:02:35 +01:00
Jonas 'Sortie' Termansen a2dd8be7aa Fixed using wrong system call in libmaxsi/x64/signal.s 2011-12-04 18:24:06 +01:00
Jonas 'Sortie' Termansen 61f02431ee Removed ConvertUInt{8,16} - ConvertUInt32 handles their input instead. 2011-12-04 15:49:29 +01:00
Jonas 'Sortie' Termansen 3b8bf9419d Removed obsolete functions to read from the initrd.
Use the initrd filesystem instead.
2011-12-04 15:38:02 +01:00
Jonas 'Sortie' Termansen 635a49644a Made usleep(2) a sortix extension. 2011-12-04 15:24:55 +01:00
Jonas 'Sortie' Termansen 7623ff8092 unistd.h now uses the __useconds_t from sortix/bits.h. 2011-12-04 15:11:39 +01:00
Jonas 'Sortie' Termansen b0859c6d92 usleep'ing for 0 usecs simply causes a context-switch. 2011-12-02 22:37:17 +01:00
Jonas 'Sortie' Termansen ae1c157445 Temporary hack to make x64 system calls use the right registers. 2011-12-01 14:54:47 +01:00
Jonas 'Sortie' Termansen 6562da4092 waitpid(2) now returns ECHILD on error. 2011-12-01 14:54:19 +01:00
Jonas 'Sortie' Termansen c0c20860ed Lots of improvements to 64-bit Sortix.
Fixed 64-bit-ness bug in BSR() and BSF().
Added 64-bit system call stubs in libmaxsi.
Added a Elf64 program loader.
Fixed uninitialized memory bug in the scheduler.
x64/boot.s now takes care of user-space memory permissions.
Fixed bug in x64/syscall.s

That's right. The system now boots in 64-bit mode.

It is horribly unstable, though.
2011-12-01 10:45:44 +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 8c146f14c0 Added uptime(1). 2011-11-28 16:29:53 +01:00
Jonas 'Sortie' Termansen 6781308360 Rewrote the memory allocation functions.
free(3) can now unify unused neighbor blocks, reducing mem usage.
2011-11-27 22:53:05 +01:00
Jonas 'Sortie' Termansen 4f3a7230b0 Destroying the addressspace after exit prevents leak of at least 16 KiB. 2011-11-27 12:02:34 +01:00
Jonas 'Sortie' Termansen bd1b1fe3bc Added isatty(2), which is used by editor. 2011-11-26 21:00:40 +01:00
Jonas 'Sortie' Termansen 9152443816 Added memstat, a program for displaying memory usage. 2011-11-26 20:14:57 +01:00
Jonas 'Sortie' Termansen d4231b2027 Added program_invocation_name(3), error(3), and perror(3) and used them. 2011-11-26 11:00:45 +01:00