Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/apfelteesaft/shard
Shard is a minimalistic attempt to an Operating System with minimal Functionality
https://github.com/apfelteesaft/shard
assembly c kernel minimalistic operating-system os
Last synced: about 1 month ago
JSON representation
Shard is a minimalistic attempt to an Operating System with minimal Functionality
- Host: GitHub
- URL: https://github.com/apfelteesaft/shard
- Owner: ApfelTeeSaft
- License: gpl-3.0
- Created: 2024-08-05T10:31:44.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-08-06T10:00:06.000Z (3 months ago)
- Last Synced: 2024-10-12T20:24:45.864Z (about 1 month ago)
- Topics: assembly, c, kernel, minimalistic, operating-system, os
- Language: Assembly
- Homepage:
- Size: 64.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ShardOS
ShardOS is a simple operating system built from scratch for educational purposes. This project demonstrates the basics of OS development, including bootloading, kernel development, and simple hardware interaction.
## Screenshot
![image](https://github.com/user-attachments/assets/f58939df-0d91-4950-bf9f-4168f074a2dc)
## Prerequisites
To build ShardOS, you need the following tools installed on your Linux system:
- `nasm` (Netwide Assembler)
- `gcc` (GNU Compiler Collection)
- `ld` (GNU Linker)
- `qemu` (for emulation and testing)You can install these tools using your package manager. For example, on Debian-based systems like Ubuntu, run:
```sh
sudo apt update
sudo apt install nasm gcc make qemu-system-x86
```## Building ShardOS
### 1. Assemble the Bootloader
Assemble the bootloader using `nasm`:
```sh
nasm -f elf32 boot/boot.asm -o boot.o
```### 2. Compile the Kernel
Compile the kernel using `gcc`:
```sh
gcc -m32 -ffreestanding -c kernel.c -o kernel.o
```### 3. Link the Object Files
Link the bootloader and kernel using `ld`:
```sh
ld -m elf_i386 -T link.ld -o ShardOS.bin boot.o kernel.o
```### 4. Create a Bootable Image
Create a bootable image by concatenating the boot sector and the kernel:
```sh
dd if=/dev/zero of=boot.img bs=512 count=2880
dd if=ShardOS.bin of=boot.img conv=notrunc
```### 5. Run with QEMU
Run your OS using QEMU:
```sh
qemu-system-i386 -fda boot.img
```## File Structure
- `boot/boot.asm`: Assembly code for the bootloader.
- `kernel.c`: C code for the kernel.
- `link.ld`: Linker script for combining the bootloader and kernel into a single binary.
- `deprecated/stage1/2.asm`: Old attempt at making a Standalone OS purely in Assembly## Contributing
Contributions are welcome! Feel free to submit issues or pull requests.
## License
This project is licensed under the GNU General Public License v3.0.