rust
E. Almqvist 3 years ago
parent 54337e72e9
commit ed32566174
  1. 11
      .gitignore
  2. 7
      Cargo.lock
  3. 15
      Cargo.toml
  4. 13
      src/Makefile
  5. 0
      src/bootloader/bios/convert.asm
  6. 0
      src/bootloader/bios/disk.asm
  7. 0
      src/bootloader/bios/memory.asm
  8. 0
      src/bootloader/bios/print.asm
  9. 0
      src/bootloader/bootloader.asm
  10. 0
      src/bootloader/equ/ascii.asm
  11. 0
      src/bootloader/equ/bios.asm
  12. 0
      src/bootloader/equ/vga.asm
  13. 0
      src/bootloader/pm/gdt.asm
  14. 0
      src/bootloader/pm/vga/print.asm
  15. 0
      src/drivers/vga.c
  16. 0
      src/drivers/vga.h
  17. 0
      src/grub/grub.cfg
  18. 0
      src/kernel/enable_paging.asm
  19. 0
      src/kernel/io.c
  20. 0
      src/kernel/io.h
  21. 0
      src/kernel/kernel.c
  22. 0
      src/kernel/kernel.h
  23. 0
      src/kernel/kernel_entry.asm
  24. 0
      src/kernel/memory.c
  25. 0
      src/kernel/memory.h
  26. 0
      src/kernel/paging.c
  27. 0
      src/kernel/paging.h
  28. 0
      src/kernel/test.rs
  29. 0
      src/lib/conv.c
  30. 0
      src/lib/conv.h
  31. 0
      src/lib/math.c
  32. 0
      src/lib/math.h
  33. 0
      src/lib/str.c
  34. 0
      src/lib/str.h
  35. 0
      src/lib/types.h
  36. 0
      src/lib/util.c
  37. 0
      src/lib/util.h
  38. 14
      src/main.rs

11
.gitignore vendored

@ -1,7 +1,12 @@
bin/
src/bin/
*.bin
*.o
os-image
src/os-image
*.dis
boot/
src/boot/
*.iso
# Added by cargo
/target

7
Cargo.lock generated

@ -0,0 +1,7 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "eOS"
version = "0.1.0"

@ -0,0 +1,15 @@
[package]
name = "eOS"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
[profile.release]
panic = "abort"
[profile.dev]
panic = "abort"

@ -4,12 +4,6 @@
CC = gcc
CFLAGS = -fno-pie -m32 -Os -ffreestanding
# Rust
RC = rustc
# WARN: target might not exist on your machine. Just swap it out to whatever 32bit target that you have.
RTARGET = i686-unknown-linux-gnu
RFLAGS = --emit=obj --target $(RTARGET)
# Assembly
AA = nasm
AFLAGS =
@ -25,10 +19,8 @@ VMFLAGS =
# Do not touch these.
C_SOURCES = $(wildcard kernel/*.c drivers/*.c lib/*.c)
HEADERS = $(wildcard kernel/*.h drivers/*.h lib/*.h)
R_SOURCES = $(wildcard kernel/*.rs drivers/*.rs lib/*.rs)
OBJ = $(C_SOURCES:.c=.o)
ROBJ = $(R_SOURCES:.rs=.o)
all: eos.iso
@ -49,15 +41,12 @@ eos_grub.iso : kernel.bin grub/grub.cfg
eos.iso: bootloader/bootloader.bin kernel.bin
cat $^ > eos.iso
kernel.bin: kernel/kernel_entry.o kernel/enable_paging.o $(OBJ) $(ROBJ)
kernel.bin: kernel/kernel_entry.o kernel/enable_paging.o $(OBJ)
$(LD) -o $@ $^ $(LDFLAGS)
%.o : %.c ${HEADERS}
$(CC) $(CFLAGS) -c $< -o $@
%.o : %.rs
$(RC) $< -o $@ $(RFLAGS)
%.o : %.asm
$(AA) $< -f elf -o $@ $(AFLAGS)

@ -0,0 +1,14 @@
#![no_std]
#![no_main]
use core::panic::PanicInfo;
#[no_mangle]
pub extern "C" fn _start() -> ! {
loop {}
}
#[panic_handler]
fn panic(_info: &PanicInfo) -> ! {
loop {}
}
Loading…
Cancel
Save