summaryrefslogtreecommitdiff
path: root/LibC/unistd.h
AgeCommit message (Collapse)Author
2019-02-26Compat work towards making bash-5.0 build with less patches.Andreas Kling
Hacked implementations of sigsetjmp() and siglongjmp(). I didn't know about these APIs until just now, but I hope I got them right.
2019-02-26More compat work.Andreas Kling
Move syscall to int 0x82 since using int 0x80 was kinda prone to fork bombs when building things on Linux. :^)
2019-02-23LibC: Enough compat work to make binutils-2.32 build and run.Andreas Kling
2019-02-21Kernel+Userland: Implement setuid() and setgid() and add /bin/suAndreas Kling
Also show setuid and setgid bits in "ls -l" output. :^)
2019-02-16Kernel: Add a simple shared memory API for two processes only.Andreas Kling
And use this to implement shared bitmaps between WindowServer and clients.
2019-02-08LibC: Implement enough missing stuff to get bash-5.0 running. :^)Andreas Kling
2019-02-03Get nyancat nyanning in Serenity.Andreas Kling
I found a cute program that renders an animated nyancat in the terminal. This patch adds enough hackery to get it working correctly. :^)
2019-02-03LibC: Implement various things to get GNU bc building and running.Andreas Kling
Looks like that's all we needed, and bc now runs. :^)
2019-01-28Add support for removing directories.Andreas Kling
It's really only supported in Ext2FS since SynthFS doesn't really want you mucking around with its files. This is pretty neat though :^) I ran into some trouble with HashMap while working on this but opted to work around it and leave that for a separate investigation.
2019-01-25Terminal: Redraw entire line if any of its characters are dirty.Andreas Kling
This means we only have to do one fill_rect() per line and the whole process ends up being ~10% faster than before. Also added a read_tsc() syscall to give userspace access to the TSC.
2019-01-23LibC: Tweak execvp() and execve() prototypes.Andreas Kling
2019-01-23LibC: Add vsnprintf(), snprintf(), execvp() and abs().Andreas Kling
2018-12-20Add sync() syscall and a /bin/sync.Andreas Kling
It walks all the live Inode objects and flushes pending metadata changes wherever needed. This could be optimized by keeping a separate list of dirty Inodes, but let's not get ahead of ourselves.
2018-11-17Various stubs while trying to get an old coreutils to build.Andreas Kling
2018-11-17Make bash-2.05b build with minimal changes.Andreas Kling
This is really neat. :^)
2018-11-13Add close-on-exec flag for file descriptors.Andreas Kling
I was surprised to find that dup()'ed fds don't share the close-on-exec flag. That means it has to be stored separately from the FileDescriptor object.
2018-11-11Add setvbuf(), setlinebuf(), setbuf().Andreas Kling
2018-11-11A bunch of compat work (mostly stubs but some real implementations, too.)Andreas Kling
Another pass at getting bash-1.14.7 to build. Not that many symbols remain.
2018-11-07Add some basic setgroups(), getgroups() and initgroups().Andreas Kling
Also teach /bin/id to print the user's supplemental groups.
2018-11-06Add getwd().Andreas Kling
2018-11-06Add strsignal() and improve sharing signal numbers between LibC and kernel.Andreas Kling
2018-11-05More work towards getting bash to build.Andreas Kling
Implemented some syscalls: dup(), dup2(), getdtablesize(). FileHandle is now a retainable, since that's needed for dup()'ed fd's. I didn't really test any of this beyond a basic smoke check.
2018-11-05Lots of minor compat stuff while seeing if bash would build.Andreas Kling
We're quite far from bash building, but we'll get there eventually!
2018-11-05Add geteuid() and getegid().Andreas Kling
There's no support for set-uid or set-gid executables yet so these don't actually do anything. It's just nice to get the boilerplate stuff in.
2018-11-05Tiny LibC things.Andreas Kling
2018-11-03Implemented sys$execve().Andreas Kling
It's really crufty, but it basically works!
2018-11-02Implement fork()!Andreas Kling
This is quite cool! The syscall entry point plumbs the register dump down to sys$fork(), which uses it to set up the child process's TSS in order to resume execution right after the int 0x80 fork() call. :^) This works pretty well, although there is some problem with the kernel alias mappings used to clone the parent process's regions. If I disable the MM::release_page_directory() code, there's no problem. Probably there's a premature freeing of a physical page somehow.
2018-11-02Basic ^C interrupt implementation.Andreas Kling
For testing, I made cat put itself into a new process group. This should eventually be done by sh between fork() and exec().
2018-11-02Add tcsetpgrp()+tcgetpgrp().Andreas Kling
One more step on the path to being able to ^C a runaway process. :^)
2018-11-02Start working on sessions and process groups.Andreas Kling
2018-11-01Waiters should be notified when a waitee is killed.Andreas Kling
Ran into a horrendous bug where VirtualConsole would overrun its buffer and scribble right into some other object if we were interrupted while processing a character. Slapped an InterruptDisabler onto onChar for now. This provokes an interesting question though.. if a process is killed while its in kernel space, how the heck do we release any locks it held? I'm sure there are many different solutions to this problem, but I'll have to think about it.
2018-10-31Add getpwent() family of functions to LibC.Andreas Kling
Also add a little /etc/passwd database. There's just me in there.
2018-10-31Enough compatibility work to make figlet build and run!Andreas Kling
I ran out of steam writing library routines and imported two BSD-licensed libc routines: sscanf() and getopt(). I will most likely rewrite them sooner or later. For now I just wanted to see figlet running.
2018-10-31More LibC portability work while trying to get figlet building.Andreas Kling
2018-10-31A bunch of LibC boilerplate stuff added while trying to get figlet to build.Andreas Kling
2018-10-30Add sys$ttyname_r and ttyname_r() + ttyname().Andreas Kling
And print a greeting when sh starts up so we know which TTY we're on.
2018-10-30Virtual consoles kinda work!Andreas Kling
We now make three VirtualConsoles at boot: tty0, tty1, and tty2. We launch an instance of /bin/sh in each one. You switch between them with Alt+1/2/3 How very very cool :^)
2018-10-28Add basic symlink support.Andreas Kling
- sys$readlink + readlink() - Add a /proc/PID/exe symlink to the process's executable. - Print symlink contents in ls output. - Some work on plumbing options into VFS::open().
2018-10-27Implement waitpid() support for getting the waitee's exit code.Andreas Kling
2018-10-26Implement sys$chdir() and teach sh+ls to cd around and browse different dirs.Andreas Kling
2018-10-26Add sys$gethostname and /bin/hostnameAndreas Kling
2018-10-25Add a "sleep" syscall that sleeps for N seconds.Andreas Kling
2018-10-24Add a "pwd" utility to userland.Andreas Kling
It's implemented as a separate process. How cute is that. Tasks now have a current working directory. Spawned tasks inherit their parent task's working directory. Currently everyone just uses "/" as there's no way to chdir().
2018-10-24Add an lstat() syscall and use it to make "ls" nicer.Andreas Kling
2018-10-24Add a simplified waitpid() so that sh can wait on spawned commands.Andreas Kling
2018-10-23Lots of hacking:Andreas Kling
- Turn Keyboard into a CharacterDevice (85,1) at /dev/keyboard. - Implement MM::unmapRegionsForTask() and MM::unmapRegion() - Save SS correctly on interrupt. - Add a simple Spawn syscall for launching another process. - Move a bunch of IO syscall debug output behind DEBUG_IO. - Have ASSERT do a "cli" immediately when failing. This makes the output look proper every time. - Implement a bunch of syscalls in LibC. - Add a simple shell ("sh"). All it can do now is read a line of text from /dev/keyboard and then try launching the specified executable by calling spawn(). There are definitely bugs in here, but we're moving on forward.
2018-10-22Start work on a standard C library. I'm calling it... LibC.Andreas Kling