Lightshow works now
Followed a tip from http://forum.osdev.org/viewtopic.php?f=1&t=20150 about moving the location of labels around, that made the linker error go away and it looks like that fixed the restarting problem. This commit also adds debugging flags to the build, and adds a debug make target with the right commands to run gdb under qemu, which I'll probably want to do in the future.
This commit is contained in:
9
Makefile
9
Makefile
@@ -29,12 +29,15 @@ run_terminal_keyboard: 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
|
||||
rustc --emit obj -o lightshow_rust.o --target i686-unknown-linux-gnu -g lightshow.rs
|
||||
nasm -f elf32 -g 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
|
||||
qemu-system-i386 -kernel lightshow
|
||||
|
||||
debug_lightshow: lightshow
|
||||
qemu-system-i386 -kernel lightshow -gdb tcp::9999 -S
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
%include "multiboot_header.asm"
|
||||
%include "x86_vram.asm"
|
||||
|
||||
;;extern rust_entry
|
||||
extern rust_entry
|
||||
|
||||
section .bss
|
||||
|
||||
@@ -9,27 +8,33 @@ stack resb 0x1000
|
||||
|
||||
section .data
|
||||
|
||||
[bits 32]
|
||||
section .text
|
||||
global boot
|
||||
|
||||
%include "multiboot_header.asm"
|
||||
%include "x86_vram_functions.asm"
|
||||
|
||||
global boot:
|
||||
mov esp, stack + 0x1000
|
||||
boot:
|
||||
mov esp, stack + 0x100
|
||||
xor ebp, ebp
|
||||
mov eax, 0x55
|
||||
jmp main
|
||||
|
||||
main:
|
||||
push word BG.CYAN | ' '
|
||||
call clear
|
||||
add esp, 2
|
||||
;;call rust_entry
|
||||
|
||||
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
|
||||
|
||||
loop_label:
|
||||
jmp loop_label
|
||||
|
||||
halt:
|
||||
hlt
|
||||
|
||||
Reference in New Issue
Block a user