|
1 | | -OSle |
2 | | ---- |
| 1 | +<p align="center"> |
| 2 | + <img width="256" src="./docs/logo.svg" alt="logo"> |
| 3 | +</p> |
3 | 4 |
|
4 | | -OSle is a tiny OS that can be run on x86 hardware. |
| 5 | +<p align="center"> |
| 6 | +A tiny and mighty bootloader OS. |
| 7 | +</p> |
5 | 8 |
|
6 | | -## tl;dr |
7 | 9 |
|
8 | | -* tiny real-mode OS in 16 bits x86 assembly; |
9 | | -* written as a bootloader. It's only 510 bytes in total; |
10 | | -* has a shell, a file system, and process management; |
11 | | -* runs [`userland software`](./bin/); |
12 | | -* comes with an [SDK to write your own OSle software](./sdk/); |
| 10 | +<h4 align="center"> |
| 11 | + <a href="https://shikaan.github.io/OSle/">🚀 Try it out in the browser! 🚀</a> |
| 12 | +</h4> |
13 | 13 |
|
14 | | -## Dependencies |
15 | 14 |
|
16 | | -* [GNU make](https://www.gnu.org/software/make/) |
17 | | -* [nasm](https://www.nasm.us) |
18 | | -* [bochs](https://bochs.sourceforge.io) |
| 15 | +## 👀 Overview |
19 | 16 |
|
20 | | -### MacOS |
| 17 | +OSle is a [real-mode](https://wiki.osdev.org/Real_Mode) OS that fits in a |
| 18 | +bootloader. |
21 | 19 |
|
22 | | -Using Homebrew |
| 20 | +It's written in x86 assembly and, despite its tiny size (only 510 bytes), it |
| 21 | +packs essential features like: |
| 22 | + |
| 23 | +- **Shell**: Run commands and builtins. |
| 24 | +- **File System**: Read, write, and find files on the system. |
| 25 | +- **Process Management**: Cooperatively spawn child processes. |
| 26 | +- **Userland Software**: Comes with [pre-built software](./bin/) and an |
| 27 | +[SDK](./sdk/) to write your own. |
| 28 | + |
| 29 | +[Check out the online demo](https://shikaan.github.io/OSle) to see it in action. |
| 30 | + |
| 31 | +## 📚 Creating your first OSle program |
| 32 | + |
| 33 | +OSle includes a tiny [Software Development Kit (SDK)](./sdk/) that includes |
| 34 | +definitions and a toolchain to create your own OSle programs. |
| 35 | + |
| 36 | +Follow the [step-by-step tutorial](./tutorial/) to write your first program! |
| 37 | + |
| 38 | +## 🛠️ Development |
| 39 | + |
| 40 | +To develop OSle and OSle programs you will need the following tools: |
| 41 | + |
| 42 | +- [nasm](https://www.nasm.us) |
| 43 | +- [GNU make](https://www.gnu.org/software/make/) (usually preinstalled) |
| 44 | +- [bochs](https://bochs.sourceforge.io) (optional) |
| 45 | + |
| 46 | +<details> |
| 47 | +<summary>Installation instructions</summary> |
| 48 | + |
| 49 | +#### macOS |
| 50 | + |
| 51 | +Install dependencies using Homebrew: |
23 | 52 |
|
24 | 53 | ```sh |
25 | 54 | brew install nasm |
26 | 55 | brew install bochs |
27 | 56 | ``` |
28 | 57 |
|
29 | | -### Linux |
| 58 | +#### Linux |
30 | 59 |
|
31 | | -Using your local package manager, for example in Debian |
| 60 | +Install dependencies using your local package manager, e.g., on Debian: |
32 | 61 |
|
33 | 62 | ```sh |
34 | 63 | apt install nasm bochs |
35 | 64 | ``` |
| 65 | +</details> |
36 | 66 |
|
37 | | -Please refer to the respective packages pages should you experience any problem. |
| 67 | +### Build and Run OSle locally |
38 | 68 |
|
39 | | -## Run locally |
| 69 | +These recipes will compile OSle and use the [SDK](./sdk/) to compile and bundle |
| 70 | +all the pre-built programs. Using `start` will also run bochs right away. |
40 | 71 |
|
41 | 72 | ```sh |
| 73 | +# build and run osle on bochs |
42 | 74 | make start |
| 75 | + |
| 76 | +# or |
| 77 | + |
| 78 | +# build osle |
| 79 | +make osle |
| 80 | +# use QEMU to run it |
| 81 | +qemu-system-i386 -fda osle.img |
43 | 82 | ``` |
44 | 83 |
|
45 | | -## Build locally |
| 84 | +### Build and Run your OSle program |
46 | 85 |
|
47 | 86 | ```sh |
48 | | -make boot.o |
| 87 | +# ensure you have a working OSle image at osle.img |
| 88 | +make osle |
| 89 | + |
| 90 | +# compile your source to generate my_file.bin |
| 91 | +sdk/build my_file.s |
| 92 | + |
| 93 | +# bundle my_file.bin into the osle.img image |
| 94 | +sdk/pack my_file.bin |
| 95 | + |
| 96 | +# run it! |
| 97 | +qemu-system-i386 -fda osle.img |
49 | 98 | ``` |
50 | 99 |
|
51 | | -## Use it on a real device |
| 100 | +### Use OSle on a Real Device |
| 101 | + |
| 102 | +Write the built image to a device using `dd`: |
52 | 103 |
|
53 | | -For example using `dd` |
| 104 | +> [!WARNING] |
| 105 | +> The following action can damage your hardware. We take no responsibility for |
| 106 | +> any damage OSle might cause. |
54 | 107 |
|
55 | 108 | ```sh |
56 | | -sudo dd if=boot.o of=/dev/YOUR_DEVICE bs=512 count=1 |
57 | | -``` |
| 109 | +# generate an OSle image at osle.img |
| 110 | +make osle |
| 111 | + |
| 112 | +# write it on a device |
| 113 | +sudo dd if=osle.img of=/dev/YOUR_DEVICE bs=512 count=1 |
| 114 | +``` |
| 115 | + |
| 116 | +## 🤝 Contributing |
| 117 | + |
| 118 | +Feel free to explore the [issues](https://github.com/shikaan/OSle/issues) and [pull requests](https://github.com/shikaan/OSle/pulls) to contribute or request features. |
| 119 | + |
| 120 | +## License |
| 121 | + |
| 122 | +[MIT](./LICENSE) |
0 commit comments