Add lightshow
Doesn't work right now, not sure why
This commit is contained in:
9
Makefile
9
Makefile
@@ -27,6 +27,15 @@ run_keyboard: keyboard
|
||||
run_terminal_keyboard: keyboard
|
||||
qemu-system-i386 -display curses -kernel keyboard
|
||||
|
||||
|
||||
lightshow: lightshow.asm lightshow.rs
|
||||
rustc --emit obj -o lightshow_rust.o --target i686-unknown-linux-gnu lightshow.rs
|
||||
nasm -f elf32 lightshow.asm
|
||||
ld -m elf_i386 -nostdlib -T linker.ld lightshow.o lightshow_rust.o -o lightshow
|
||||
|
||||
run_lightshow: lightshow
|
||||
qemu-system-i386 -display curses -kernel lightshow
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -f *.o
|
||||
|
||||
36
lightshow.asm
Normal file
36
lightshow.asm
Normal file
@@ -0,0 +1,36 @@
|
||||
%include "multiboot_header.asm"
|
||||
%include "x86_vram.asm"
|
||||
|
||||
;;extern rust_entry
|
||||
|
||||
section .bss
|
||||
|
||||
stack resb 0x1000
|
||||
|
||||
section .data
|
||||
|
||||
section .text
|
||||
|
||||
%include "x86_vram_functions.asm"
|
||||
|
||||
global boot:
|
||||
mov esp, stack + 0x1000
|
||||
xor ebp, ebp
|
||||
jmp main
|
||||
|
||||
main:
|
||||
push word BG.CYAN | ' '
|
||||
call clear
|
||||
add esp, 2
|
||||
;;call rust_entry
|
||||
|
||||
push dword BG.BLACK | FG.YELLOW | FG.BRIGHT | 'A'
|
||||
push dword 0
|
||||
push dword 0
|
||||
call write_to_coord
|
||||
add esp, 12
|
||||
jmp halt
|
||||
|
||||
halt:
|
||||
hlt
|
||||
jmp halt
|
||||
21
lightshow.rs
Normal file
21
lightshow.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
#![feature(lang_items, start, no_core)]
|
||||
#![no_core]
|
||||
#![no_main]
|
||||
|
||||
#[lang = "eh_personality"]
|
||||
extern fn eh_personality() {}
|
||||
|
||||
#[lang = "panic_fmt"]
|
||||
fn panic_fmt() -> ! { loop {} }
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern fn rust_entry() {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user