{"id":20835616,"url":"https://github.com/johnandersen777/embeddedos","last_synced_at":"2025-03-12T09:15:01.357Z","repository":{"id":82523060,"uuid":"80265438","full_name":"johnandersen777/embeddedos","owner":"johnandersen777","description":"A operating system targeted at embedded devices","archived":false,"fork":false,"pushed_at":"2017-02-11T21:30:26.000Z","size":30,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-15T08:36:21.189Z","etag":null,"topics":["arm","kernel","microprocessor","operating-system"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johnandersen777.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":"2017-01-28T04:04:33.000Z","updated_at":"2018-05-21T02:58:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"69952819-1c36-4af7-9771-2cb0b68de3ec","html_url":"https://github.com/johnandersen777/embeddedos","commit_stats":null,"previous_names":["johnandersen777/embeddedos"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnandersen777%2Fembeddedos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnandersen777%2Fembeddedos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnandersen777%2Fembeddedos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnandersen777%2Fembeddedos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johnandersen777","download_url":"https://codeload.github.com/johnandersen777/embeddedos/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243188241,"owners_count":20250457,"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":["arm","kernel","microprocessor","operating-system"],"created_at":"2024-11-18T00:26:20.590Z","updated_at":"2025-03-12T09:15:01.326Z","avatar_url":"https://github.com/johnandersen777.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Embedded OS [![Build Status](https://travis-ci.org/pdxjohnny/embeddedos.svg?branch=master)](https://travis-ci.org/pdxjohnny/embeddedos)\n\nThis is an OS with a user mode and kernel mode which strives to use syscalls to\ndo work with memory mapped devices and keep most of the non hardware oriented\ntasks in user mode.\n\n## Architecture Overview\n\nDirectory structure\n\n```\nembeddedos\n│\n├── arch\n│   └── arm\n│       ├── cortex_a8\n│       │   └── realview_pb_a8\n│       │       └── linker.ld\n│       ├── kstack.S\n│       └── syscall.S\n├── Dockerfile\n├── include\n│   ├── arm\n│   │   └── cortex_a8\n│   │       └── realview_pb_a8.h\n│   ├── processor.h\n│   └── README.md\n├── kernel\n│   └── arm\n│       └── entry.S\n├── LICENSE\n├── Makefile\n├── README.md\n└── user\n    └── arm\n        └── entry.S\n```\n\n### arch/\n\nProcessor and architecture specific code should go in arch. These are things\nlike how you interact with a UART on a specific processor. Things which require\nyou to look at the processors data sheet should most likely go here.\n\n### include/\n\nInclude should have a file for each microprocessor defining essentially what\nyou see in the processors data sheet. These files should be named after their\nmicroprocessors and contain the information which would be found in those\nprocessors data sheets, such as memory locations and constants that get written\nto them.\n\n### kernel/\n\nThe kernel should be written in an architecture and microprocessor independent\nfashion. It contains scheduling, memory management and other universally\napplicable code.\n\n### user/\n\nAfter initialization the kernel changes to user mode and executes the code at\n`user_main`, which is responsible for setting up the user mode stack.\n`user_main` should then jump to some architecture independent code which makes\nuse of the kernel though system calls to do work on devices.\n\n## Dependencies\n\nThe first step is to install the necessary packages. These are the\narm-none-eabi tool chain and qemu with arm support.\n\n#### Arch Linux\n\n```\nsudo pacman -S arm-none-eabi-gcc arm-none-eabi-binutils arm-none-eabi-gdb \\\n  arm-none-eabi-newlib qemu qemu-arch-extra\n```\n\n#### Ubuntu\n\n```\nsudo apt -y install \\\n    make \\\n    gcc-arm-none-eabi \\\n    binutils-arm-none-eabi \\\n    gdb-arm-none-eabi \\\n    libstdc++-arm-none-eabi-newlib \\\n    libnewlib-arm-none-eabi \\\n    qemu-system-arm\n```\n\n## GDB\n\nIn `.gdbinit` we have placed commands which gdb will run on startup. But to\nmake this work the `.gdbinit` file in our home directory needs to say its ok\nfor gdb to load this `.gdbinit` file. To do that we just add the directory to\nthe auto-load safe-path.\n\n```\necho \"set auto-load safe-path $PWD\" \u003e\u003e ~/.gdbinit\n```\n\n## Building\n\nThe Makefile should have plenty of comments to help you understand what is\nbeing done in it. It takes all the `.s` assembly files in the current directory\nand compiles them into object files. Then it runs the linker to create the ELF\nbinary. All of this is done with arm-none-eabi-gcc rather than your regular\ngcc for host programs.\n\n```\nmake\n```\n\nWill rebuild all the modified `.s` files into their object file forms and\nrelink to the binary. Run `make clean all` if you are having really weird\nerrors. That usually fixes things.\n\n## Running\n\nTo run you can do `qemu-arm ./main`. But hey why not put it in the Makefile\nright.\n\n```\nmake all qemu\n```\n\nWill rebuild any changed files and run the created binary in qemu.\n\n## Debugging\n\nOh you ran the program and everything exploded? Time to debug.\n\n```\nmake all gdb\n```\n\nWill rebuild all your source files and start the program in qemu with it as a\ngdb target on port 1234, so make sure nothing else is using that port or change\nit in the `.gdbinit` file and `Makefile`.\n\n## Help nothing works\n\nComment with the problem so we can figure it out on here and everyone else can\nsee the solution.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnandersen777%2Fembeddedos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnandersen777%2Fembeddedos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnandersen777%2Fembeddedos/lists"}