Add lightshow

Doesn't work right now, not sure why
This commit is contained in:
greg
2015-09-23 23:22:15 -07:00
parent fb62be4420
commit 66c8833908
3 changed files with 66 additions and 0 deletions

View File

@@ -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
View 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
View 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() {
}