https://github.com/rubenwardy/rubix_kernel
A simple kernel for ARMv7
https://github.com/rubenwardy/rubix_kernel
filesystem kernel posix
Last synced: 2 months ago
JSON representation
A simple kernel for ARMv7
- Host: GitHub
- URL: https://github.com/rubenwardy/rubix_kernel
- Owner: rubenwardy
- Created: 2017-03-13T16:22:10.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-06T22:37:25.000Z (almost 7 years ago)
- Last Synced: 2025-02-28T10:09:18.505Z (3 months ago)
- Topics: filesystem, kernel, posix
- Language: C
- Homepage: https://blog.rubenwardy.com/2018/04/05/simple-kernel-in-c/
- Size: 285 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Rubix OS
## Features
* SYS Calls
* `yield` - ends the current time slice.
* `write` - writes to an open file descriptor.
* `read` - reads from an file descriptor. Returns length of read, 0 on EOF.
May blocking - see `set_nonblocking`.
* `close` - closes a file descriptor.
* `dup2` - duplicates fd from `old` to `new`. `new` is closed if it already exists.
* `pipe` - creates a pipe. fd[0] is read, fd[1] is write.
* `fopen` - open file. Not quite POSIX, as it's non-blocking
* `fork` - clones process.
Return value is 0 if child, PID of child if parent, -1 if error.
* `exec` - replaces the process with another program. PID is kept.
Stack and FDs (except in/out/err) are destroyed.
* `exit` - exits with exit code.
* `wait` - waits for a child program to exit, and gives exit code.
* `kill` - sends a kill signal to a process. Killed processes will not return an exit code.
`signal` is not yet implemented.
* `setpriority` - set priority of child process.
* `set_nonblocking` - is not POSIX, unfortunately. Set pipe non-blocking.
* LibC help functions
* `popen` - opens a process and returns a FD. Uses `fork`, `pipe`, `exec`, and `dup2`.
* `wait`/`waitpid` - both use the `wait` syscall.
* Processe
* **time slicing** - timer based timer slices.
* **priority-based** - priority(P) = priority_base(P) + slices_since_last_ran(P)
* **blocked queue** - for processes waiting for a process or file resource.
* **process ownership** - processes have a parent, which can kill/wait them.
* **process groups** - a limited type of process group, where all processes
that share a parent and the parent itself are in a group.
* Files
* `FiDes` - File descriptor. Interacted with using function pointers. Can be blocking or not.
* `pipe` - Pointed to by a FD.
* `in/out/err` - these are "files" too!
* `filesystem` - Files are limited to 256 bytes, maximum of 10 files.## References
All references access March 2017.
### Online
* [Linux Man-pages](http://man7.org/linux/man-pages/). Various. man7.org
* [Wait sys call](http://pubs.opengroup.org/onlinepubs/000095399/functions/waitpid.html). The Open Group. pubs.opengroup.org
* [Exit sys call](http://pubs.opengroup.org/onlinepubs/000095399/functions/exit.html). The Open Group. pubs.opengroup.org
* [POSIX IPC](https://docs.oracle.com/cd/E19455-01/806-4750/6jdqdfltf/index.html). Oracle. docs.oracle.com
* [Linux Interprocess Communications](http://tldp.org/LDP/lpg/node7.html). Goldt. S, Van der Meer. S, Welsh. M. tldp.org
* [Interprocess Communication (IPC), Pipes](https://users.cs.cf.ac.uk/Dave.Marshall/C/node23.html). Marshall, D. Users.cs.cf.ac.uk
* [General overview of the Linux file system](http://www.tldp.org/LDP/intro-linux/html/sect_03_01.html). Machtelt. G. tldp.org* Cormen. T, Leiserson. C, Rivest. R, Stein. C. *Introduction to Algorithms 3rd Edition*, (Massachusetts Institute of Technology, 2009) Heapsort and Priority Queues. pp151-166