{"id":19324751,"url":"https://github.com/knightos/kernel","last_synced_at":"2025-04-06T07:13:04.803Z","repository":{"id":148796460,"uuid":"9781640","full_name":"KnightOS/kernel","owner":"KnightOS","description":"Kernel for z80 calculators","archived":false,"fork":false,"pushed_at":"2023-06-07T19:49:24.000Z","size":8108,"stargazers_count":290,"open_issues_count":3,"forks_count":33,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-03-30T06:05:12.067Z","etag":null,"topics":["assembly","calculator","kernel","knightos","z80"],"latest_commit_sha":null,"homepage":"","language":"Assembly","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KnightOS.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-04-30T22:41:36.000Z","updated_at":"2025-02-16T16:44:06.000Z","dependencies_parsed_at":"2025-01-03T05:13:59.854Z","dependency_job_id":"ed9190f8-1de7-4f1f-b15f-b4f3ba8593a3","html_url":"https://github.com/KnightOS/kernel","commit_stats":{"total_commits":930,"total_committers":29,"mean_commits":32.06896551724138,"dds":"0.38064516129032255","last_synced_commit":"3f71d3b334d65819407c3550fa7ce60f814ba6b8"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KnightOS%2Fkernel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KnightOS%2Fkernel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KnightOS%2Fkernel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KnightOS%2Fkernel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KnightOS","download_url":"https://codeload.github.com/KnightOS/kernel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247445671,"owners_count":20939958,"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":["assembly","calculator","kernel","knightos","z80"],"created_at":"2024-11-10T02:06:40.131Z","updated_at":"2025-04-06T07:13:04.746Z","avatar_url":"https://github.com/KnightOS.png","language":"Assembly","readme":"# KnightOS Kernel\n\nThe KnightOS kernel is a kernel for Texas Instruments calculators. It offers many unix-like features for\nz80 systems, including:\n\n* A tree-based filesystem\n* Multitasking (up to 32 concurrent processes)\n* Dynamic memory management\n\nThis kernel is the basis of [KnightOS](https://github.com/KnightOS/KnightOS), which is a good resource\nfor others hoping to implement a userspace.\n\nThis project is only useful to systems programmers. Please look into KnightOS instead if you are not a\nsystems programmer.\n\n## Compiling\n\nIf you have a pre-compiled kernel image, skip this section.\n\nThe toolchain for the kernel was built mostly from scratch, since old z80 tools are, well, old. The new\ntoolchain supports a lot of the kernel's needs on newer platforms, and works well on Linux, Mac, and\nWindows. You'll need to install:\n\n* Mono (or Microsoft.NET on Windows)\n* GNU Make\n* [sass](https://github.com/KnightOS/sass) (aur/sass)\n* [mktiupgrade](https://github.com/KnightOS/mktiupgrade) (aur/mktiupgrade)\n* [genkfs](https://github.com/KnightOS/genkfs) (aur/genkfs)\n* [mkrom](https://github.com/KnightOS/mkrom) (aur/mkrom)\n* [patchrom](https://github.com/KnightOS/patchrom) (aur/patchrom)\n\ngenkfs is only strictly neccessary if you hope to build a userspace on top of the kernel. On Windows,\ninstall Cygwin and perform the build from there. Windows users should install sass into their %PATH%.\n\nThe kernel needs to be rebuilt for any system you'd like to target (different calculator models). For each\nsupported calculator model, use the given make target:\n\n| Model                | `make` Target |\n| -------------------- | ------------- |\n| TI-73                | TI73          |\n| TI-73 Explorer       | TI73          |\n| TI-83+               | TI83p         |\n| TI-83+ SE            | TI83pSE       |\n| TI-84+               | TI84p         |\n| TI-84+ SE            | TI84pSE       |\n| TI-84+ CSE           | TI84pCSE      |\n| TI-84 Pocket.fr      | TI84p         |\n| TI-84 Plus Pocket SE | TI84pSE       |\n\nSimply run `make [target]` to build the kernel. The default target, when omitted, is `TI84pSE`. This will\nproduce a kernel image in the `bin/` directory. This will also generate a `kernel.inc` file, which you\ncan use to link your userspace with the kernel. Run `make clean` before trying to switch platforms.\n\n## Usage\n\nThe kernel does not do anything on its own. Instead, it forms the basis for more complex systems. Upon\nbooting, the kernel loads up the filesystem and runs `/bin/init`. You need to provide this init program\nyourself. Here is a simple example init program, which can be assembled with the assembler of your choice:\n\n    #include \"kernel.inc\"\n        ; Program header\n        .db \"KEXC\"\n        .db KEXC_STACK_SIZE\n        .dw 20\n        .db KEXC_ENTRY_POINT\n        .dw start\n        .db KEXC_HEADER_END\n    start:\n        pcall(getLcdLock)\n        pcall(allocScreenBuffer)\n        kld(hl, message)\n        ld de, 0\n        pcall(drawStr)\n        pcall(fastCopy)\n        jr $\n    message:\n        .db \"Hello, userspace!\", 0\n\nWhen you compile the kernel, you'll get a ROM file with an empty filesystem. To build the filesystem, you\nwill need to make an example on your own system to build it from. Then, you can use\n[genkfs](https://github.com/KnightOS/genkfs) to generate and write a filesystem to the ROM. If you wish\nto build an OS upgrade that you can send to your calculator, use\n[mktiupgrade](https://github.com/KnightOS/mktiupgrade).\n\nWhen you build the kernel, in addition to the ROM file, you will receive a kernel upgrade file (this will\nbe the .73u, .8xu, or .8cu file in the output directory). This can be used on any KnightOS system to\nupgrade the kernel without touching the userspace filesystem.\n\n## Kernel API\n\nThe kernel offers an API to userspace to interact with things like threads, memory, hardware, the\nfilesystem, and more. The API is documented through special comments in the source code, which are\nextracted to generate the [online API reference](http://www.knightos.org/documentation/reference/).\n\n## Versioning\n\nThe kernel uses semantic versioning. Version numbers are indicated by the latest git tag, and\ntake the form of `major.minor.patch`. \"Patch\" is updated when bugs are fixed and for very\nminor changes. \"Minor\" is updated for new features and major non-breaking changes. \"Major\" is\nupdated with breaking changes. When you compile your kernel, the kernel version (as an ASCII\nstring) will be written to address 0x64 on page 0x00.\n\nIf you are working with a kernel that is not built from a major release, you will have a\nsligthly different kernel version. Appended to the version will be \"-nn-hhhhhhhh\". \"nn\" is the\nnumber of commits that have been made since your kernel release. \"hhhhhhhh\" is the git shorthash\nof the commit you're currently on. A \"+\" will be appended to this if your working directory is\ndirty.\n\n## Getting Help\n\nYou're free to ask questions about the kernel (or the userspace) in\n[#knightos](http://webchat.freenode.net/?channels=knightos\u0026uio=d4) on irc.freenode.net. We're\nnot always listening, so stick around - it may be a while before your question is answered.\n\n## Help, Bugs, Feedback\n\nIf you need help with KnightOS, want to keep up with progress, chat with\ndevelopers, or ask any other questions about KnightOS, you can hang out in the\nIRC channel: [#knightos on irc.freenode.net](http://webchat.freenode.net/?channels=knightos).\n\nTo report bugs, please create [a GitHub issue](https://github.com/KnightOS/KnightOS/issues/new) or contact us on IRC.\n\nIf you'd like to contribute to the project, please see the [contribution guidelines](http://www.knightos.org/contributing).\n\n## Licensing\n\nThe kernel uses the permissive\n[MIT license](https://github.com/KnightOS/kernel/blob/master/LICENSE). It permits use and\nmodification in most scenarios, including commercial.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknightos%2Fkernel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknightos%2Fkernel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknightos%2Fkernel/lists"}