summaryrefslogtreecommitdiff
path: root/Userland
AgeCommit message (Collapse)Author
2018-12-21Yet another pass of style fixes.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-12-19Implement utime() along with a naive /bin/touch.Andreas Kling
This synchronous approach to inodes is silly, obviously. I need to rework it so that the in-memory CoreInode object is the canonical inode, and then we just need a sync() that flushes pending changes to disk.
2018-12-07sh: Restore termios after a child process exits.Andreas Kling
This avoids the annoying situation that occurs when a spawned process messes with the termios and then doesn't exit cleanly.
2018-12-07Fix /bin/ls usage string.Andreas Kling
2018-12-04Import a simple text editor I started working on.Andreas Kling
2018-12-03Yet more coding style fixes.Andreas Kling
2018-11-29Add TIOCGWINSZ ioctl so userland can determine terminal geometry.Andreas Kling
(Don't) use this to implement short-form output in ls. I'm too tired to make a nice column formatting algorithm. I just wanted something concise when I type "ls".
2018-11-18Finally hook up the mkdir code to a syscall.Andreas Kling
Added a /bin/mkdir that makes directories. How very neat :^) There are various limitations because of missing functionality.
2018-11-17Various stubs while trying to get an old coreutils to build.Andreas Kling
2018-11-17Support "ls <path>" rather than just "ls" :^)Andreas Kling
2018-11-13Reduce kmalloc() traffic in directory iteration.Andreas Kling
Pass the file name in a stack-allocated buffer instead of using an AK::String when iterating directories. This dramatically reduces the amount of cycles spent traversing the filesystem.
2018-11-12Add primitive FIFO and hook it up to sys$pipe().Andreas Kling
It's now possible to do this in bash: cat kernel.map | fgrep List This is very cool! :^)
2018-11-11Add a naive /bin/fgrep for testing pipes.Andreas Kling
2018-11-11Rage hacking to get bash to run. It finally runs. So cool! :^)Andreas Kling
2018-11-10Add /proc/PID/cwd, a symlink to the process's current directory.Andreas Kling
2018-11-10Make /bin/clear work again.Andreas Kling
After I made stdio buffered, we were dropping anything unflushed on exit. Since /bin/clear just prints out some escape sequences without a newline, the entire buffer was being discarded. Also add VirtualConsole::clear() that handles clearing of background VC's.
2018-11-09Build LibC and Userland with clang as well.Andreas Kling
2018-11-09Move <utsname.h> to <sys/utsname.h> for correctness.Andreas Kling
2018-11-09Get rid of redundant sys$spawn now that we have fork+exec.Andreas Kling
2018-11-09Fix all current build warnings in the userland.Andreas Kling
2018-11-08Add a VMO pointer to VNode.Andreas Kling
This way, if anyone tries to map an already mapped file, we share the VMO.
2018-11-08Support basic mmap'ing of a file!Andreas Kling
All right, we can now mmap() a file and it gets magically paged in from fs in response to an NP page fault. This is really cool :^) I need to refactor this to support sharing of read-only file-backed pages, but it's cool to just have something working.
2018-11-08Minor tweak to /bin/kill.Andreas Kling
2018-11-08Add some simple write buffering to LibC's stdio.Andreas Kling
Plumb it all the way to the VirtualConsole. Also fix /bin/cat to write() the whole chunks we get from read() directly to stdout.
2018-11-07Get rid of the undertaker and have waitpid() be the reaper.Andreas Kling
For dead orphans, the scheduler calls reap().
2018-11-07Implement sending signals to blocked-in-kernel processes.Andreas Kling
This is dirty but pretty cool! If we have a pending, unmasked signal for a process that's blocked inside the kernel, we set up alternate stacks for that process and unblock it to execute the signal handler. A slightly different return trampoline is used here: since we need to get back into the kernel, a dedicated syscall is used (sys$sigreturn.) This restores the TSS contents of the process to the state it was in while we were originally blocking in the kernel. NOTE: There's currently only one "kernel resume TSS" so signal nesting definitely won't work.
2018-11-07Signals to processes in userspace now work again.Andreas Kling
Ugh, how am I going to dispatch signals to processes in the kernel?
2018-11-07Rework process states to make a bit more sense.Andreas Kling
Processes are either alive (with many substates), dead or forgiven. A dead process is forgiven when the parent waitpid()s on it. Dead orphans are also forgiven. There's a lot of work to be done around this.
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 getgrent() family of functions.Andreas Kling
2018-11-06Add strsignal() and improve sharing signal numbers between LibC and kernel.Andreas Kling
2018-11-06Add some basic signal support.Andreas Kling
It only works for sending a signal to a process that's in userspace code. We implement reception by synthesizing a PUSHA+PUSHF in the receiving process (operating on values in the TSS.) The TSS CS:EIP is then rerouted to the signal handler and a tiny return trampoline is constructed in a dedicated region in the receiving process. Also hacked up /bin/kill to be able to send arbitrary signals (kill -N PID)
2018-11-05Replace zones with individually tracked physical pages.Andreas Kling
It's just a simple struct { ref_count, paddr }. This will allow me to implement lazy zeroing and COW pages.
2018-11-03Map pages in read-only ELF sections as non-writable.Andreas Kling
This is so cool! :^) Now you'll crash if you try to write into your .text or .rodata segments.
2018-11-03Fix some bugs in execve() and make sh use it for process launching.Andreas Kling
Interrupting children of sh now always works with ^C :^)
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-01Free physical pages allocated for a process's page directory on exit.Andreas Kling
Also use a ProcessPagingScope instead of region aliasing to implement create-process ELF loading.
2018-11-01Have sh print out which signal terminated a child process.Andreas Kling
2018-10-31Add a /bin/tty command that prints the current tty.Andreas Kling
Also fix ttyname() syscall to include "/dev/" in the name.
2018-10-31Add SpinLock to IDE disk access.Andreas Kling
This forces serialization of accesses. This driver needs to be redesigned.
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-31Fix ls build.Andreas Kling
2018-10-31A bunch of LibC boilerplate stuff added while trying to get figlet to build.Andreas Kling
2018-10-31Snazz up the sh prompt a bit. Add the current tty to it.Andreas Kling
2018-10-31Implement basic sys$kill() and add a /bin/killAndreas Kling
All it can do right now is send SIGKILL which just murders the target task.