Skip to content

Commit 8cf0d87

Browse files
authored
Merge pull request #3 from shikaan/readme
feat: add a new readme with all associated resources
2 parents 8025680 + e0c60ee commit 8cf0d87

File tree

11 files changed

+283
-76
lines changed

11 files changed

+283
-76
lines changed

Makefile

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,24 @@
22
AS:=nasm
33
ASFLAGS:=-f bin
44

5+
%.bin: %.s
6+
sdk/build $<
7+
58
.PHONY: osle_test
69
osle_test: osle fixtures/text.txt.bin test/fs.test.bin
7-
dd if=/dev/zero of=osle.img bs=512 count=2880
8-
dd if=osle.o of=osle.img bs=512 count=1 conv=notrunc
9-
dd if=bin/snake.bin of=osle.img bs=512 seek=36 conv=notrunc
10-
dd if=test/fs.test.bin of=osle.img bs=512 seek=72 conv=notrunc
11-
dd if=fixtures/text.txt.bin of=osle.img bs=512 seek=108 conv=notrunc
12-
dd if=bin/ed.bin of=osle.img bs=512 seek=144 conv=notrunc
13-
dd if=bin/more.bin of=osle.img bs=512 seek=180 conv=notrunc
14-
dd if=bin/rm.bin of=osle.img bs=512 seek=216 conv=notrunc
15-
dd if=bin/mv.bin of=osle.img bs=512 seek=252 conv=notrunc
16-
dd if=bin/help.bin of=osle.img bs=512 seek=288 conv=notrunc
10+
sdk/pack test/fs.test.bin
11+
sdk/pack fixtures/text.txt.bin
1712

1813
.PHONY: osle
1914
osle: osle.o bin/snake.bin bin/ed.bin bin/more.bin bin/rm.bin bin/mv.bin bin/help.bin
2015
dd if=/dev/zero of=osle.img bs=512 count=2880
2116
dd if=osle.o of=osle.img bs=512 count=1 conv=notrunc
22-
dd if=bin/snake.bin of=osle.img bs=512 seek=36 conv=notrunc
23-
dd if=bin/ed.bin of=osle.img bs=512 seek=72 conv=notrunc
24-
dd if=bin/more.bin of=osle.img bs=512 seek=108 conv=notrunc
25-
dd if=bin/rm.bin of=osle.img bs=512 seek=144 conv=notrunc
26-
dd if=bin/mv.bin of=osle.img bs=512 seek=180 conv=notrunc
27-
dd if=bin/help.bin of=osle.img bs=512 seek=216 conv=notrunc
28-
29-
%.bin: %.s
30-
$(AS) $(ASFLAGS) -o $*.o $<
31-
@filename=$(shell basename $@ .bin | cut -c -22) && \
32-
( printf "$$filename" | dd bs=22 conv=sync of=header.bin 2>/dev/null && \
33-
filesize=$$(stat -c %s "$*.o" 2>/dev/null || stat -f %z "$*.o") && \
34-
perl -e 'print pack("v", '$$filesize');' >> header.bin )
35-
cat header.bin $*.o > $@
36-
rm -f header.bin $*.o
17+
sdk/pack bin/snake.bin
18+
sdk/pack bin/ed.bin
19+
sdk/pack bin/more.bin
20+
sdk/pack bin/rm.bin
21+
sdk/pack bin/mv.bin
22+
sdk/pack bin/help.bin
3723

3824
.PHONY: start
3925
start: osle

README.md

Lines changed: 90 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,122 @@
1-
OSle
2-
---
1+
<p align="center">
2+
<img width="256" src="./docs/logo.svg" alt="logo">
3+
</p>
34

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>
58

6-
## tl;dr
79

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>
1313

14-
## Dependencies
1514

16-
* [GNU make](https://www.gnu.org/software/make/)
17-
* [nasm](https://www.nasm.us)
18-
* [bochs](https://bochs.sourceforge.io)
15+
## 👀 Overview
1916

20-
### MacOS
17+
OSle is a [real-mode](https://wiki.osdev.org/Real_Mode) OS that fits in a
18+
bootloader.
2119

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:
2352

2453
```sh
2554
brew install nasm
2655
brew install bochs
2756
```
2857

29-
### Linux
58+
#### Linux
3059

31-
Using your local package manager, for example in Debian
60+
Install dependencies using your local package manager, e.g., on Debian:
3261

3362
```sh
3463
apt install nasm bochs
3564
```
65+
</details>
3666

37-
Please refer to the respective packages pages should you experience any problem.
67+
### Build and Run OSle locally
3868

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.
4071

4172
```sh
73+
# build and run osle on bochs
4274
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
4382
```
4483

45-
## Build locally
84+
### Build and Run your OSle program
4685

4786
```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
4998
```
5099

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`:
52103

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.
54107
55108
```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)

bin/help.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ str_print:
4343
ret
4444

4545
VERSION: db 0x0a, 0x0d
46-
db "OSle: A tiny but mighty OS - https://github.com/shikaan/OSle"
46+
db "OSle - https://github.com/shikaan/OSle"
4747
db 0x0a, 0x0d, 0
4848

4949
BUILTINS: db 0x0a, 0x0d, "Builtins:", 0x0a, 0x0d

0 commit comments

Comments
 (0)