{"id":15723798,"url":"https://github.com/silverrainz/os67","last_synced_at":"2025-04-04T13:09:52.983Z","repository":{"id":21791062,"uuid":"25113543","full_name":"SilverRainZ/OS67","owner":"SilverRainZ","description":"An unix-like toy kernel","archived":false,"fork":false,"pushed_at":"2021-06-14T12:35:04.000Z","size":405,"stargazers_count":731,"open_issues_count":12,"forks_count":122,"subscribers_count":32,"default_branch":"master","last_synced_at":"2025-03-28T12:05:54.794Z","etag":null,"topics":["c","kernel","os","osdev","toy-kernel","xv6"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SilverRainZ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-12T08:25:09.000Z","updated_at":"2025-03-17T16:25:21.000Z","dependencies_parsed_at":"2022-07-13T02:20:27.596Z","dependency_job_id":null,"html_url":"https://github.com/SilverRainZ/OS67","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SilverRainZ%2FOS67","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SilverRainZ%2FOS67/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SilverRainZ%2FOS67/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SilverRainZ%2FOS67/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SilverRainZ","download_url":"https://codeload.github.com/SilverRainZ/OS67/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247182335,"owners_count":20897379,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","kernel","os","osdev","toy-kernel","xv6"],"created_at":"2024-10-03T22:13:23.541Z","updated_at":"2025-04-04T13:09:52.967Z","avatar_url":"https://github.com/SilverRainZ.png","language":"C","readme":"OS67\n===============================\nOS67 is a unix-like toy kernel, which comes with some user routines. (x86 based)\n\n![OS67](scrshot.png)\n\n\n### Build requirements\n\nPlatform: Linux\n\n* gnu make\n* nasm\n* gcc\n* binutils(ld, objcopy)\n* mkfs\n* bochs 2.6.7+\n\n### How to compile\n\n```shell\ngit clone https://github.com/SilverRainZ/OS67.git\ncd OS67\nmake init   # only for first time\nmake fs     # build root file system and user routines, root privilege required\nmake        # build kernel\nmake run    # run with bochs\n```\n\n### Syscalls list\n\n```c\nint _fork();\nint _exit();\nint _wait();\nint _pipe(int *fd);\nint _read(int fd, char *addr, uint32_t n);\nint _kill(int pid);\nint _exec(char *path, char **argv);\nint _fstat(int fd, struct stat *stat);\nint _chdir(char *path);\nint _dup(int fd);\nint _getpid();\nint _sleep(uint32_t sec);\nint _uptime();\nint _open(char *path, uint32_t mode);\nint _write(int fd, char *addr, uint32_t n);\nint _mknod(char *path, uint32_t di);\nint _unlink(char *path);\nint _link(char *old, char *new);\nint _mkdir(char *path);\nint _close(int fd);\n```\n\n### User routines list\n\n* sh: a simple shell, support IO redirect and pipe\n* ls: list files\n* cat: read from stdin and send it to stdout\n* mkdir: make directory\n* rm: remove file\n* ...\n\n#### Write youself a user routine\n\n* add a new file in `usr/`: `touch usr/newroutine.c`\n* add a new value to `UPROGS` variable in `Makefile` as follow:\n\n```patch\n- UPROGS =  bin/cinit bin/sh bin/cat bin/ls bin/mkdir bin/rm\n+ UPROGS =  bin/cinit bin/sh bin/cat bin/ls bin/mkdir bin/rm bin/newroutine\n```\n\n* in newroutine.c you can use these header files:\n    * usys.h: system call interfaces\n    * uio.h: basic input output functions\n    * string.h: basic string operate functions\n* `make fs \u0026\u0026 make run` then you can run your user routine\n\n\n### Bug report\n\nSee [Issues · SilverRainZ/OS67](https://github.com/SilverRainZ/OS67/issues)\n\nPlease paste the kernel logs in the issue.\n\nUncomment macro `__LOG_ON` as follow to enable logging of specific file:\n\n```patch\n- // #define __LOG_ON 1\n+ #define __LOG_ON 1\n```\n\n### License\n\n[GNU General Public License Version 3](https://github.com/SilverRainZ/OS67/blob/master/LICENSE)\n\n### References\n\n* [MIT 6.828 xv6](http://pdos.csail.mit.edu/6.828/2011/xv6.html)\n* [xv6 中文文档](https://github.com/ranxian/xv6-chinese)\n* [Bran's Kernel Developments Toturial](http://www.osdever.net/bkerndev/Docs/gettingstarted.htm)\n* [Bran's Kernel Developments Toturial - 译言网](http://article.yeeyan.org/view/197439/161890)\n* [wiki.osdev.org](http://wiki.osdev.org/Main_Page)\n* [hurlex-doc](https://github.com/hurley25/hurlex-doc)\n* [fleurix](https://github.com/Fleurer/fleurix)\n* [Minix File System - Dr.John C.S.Lui](https://koala.cs.pub.ro/redmine/attachments/download/105/minix.pdf)\n* [《Linux 内核完全注释》](http://book.douban.com/subject/1231236/)\n* [《30天自制操作系统》](http://book.douban.com/subject/11530329/)\n* [《Orange's 一个操作系统的实现》](http://book.douban.com/subject/3735649/)\n\n### Thanks to\n\n* [fleuria](http://fleurer-lee.com/)\n* [郭家华](http://www.zhihu.com/people/guo-jiahua)\n* [farseerfc](https://farseerfc.me/)\n* [fixme](https://fbq.github.io/)\n* nami\n\n### Just for fun.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilverrainz%2Fos67","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsilverrainz%2Fos67","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilverrainz%2Fos67/lists"}