Removed NASM dependency.

This commit is contained in:
neviyn 2018-05-06 20:23:43 +01:00
parent e9db400e15
commit 5f0b2ce33e
3 changed files with 18 additions and 23 deletions

View File

@ -7,7 +7,6 @@ A hobby OS written in Nim.
* nim * nim
* nimble (* or use other nake install method) * nimble (* or use other nake install method)
* clang * clang
* nasm
* grub2 * grub2
* qemu * qemu

View File

@ -1,31 +1,27 @@
; http://wiki.osdev.org/Bare_Bones_with_NASM # http://wiki.osdev.org/Bare_Bones_with_NASM
MBALIGN equ 1<<0 ; align loaded modules on page boundaries .set MBALIGN, 1<<0 # align loaded modules on page boundaries
MEMINFO equ 1<<1 ; provide memory map .set MEMINFO, 1<<1 # provide memory map
FLAGS equ MBALIGN | MEMINFO ; this is the Multiboot 'flag' field .set FLAGS, MBALIGN | MEMINFO # this is the Multiboot 'flag' field
MAGIC equ 0x1BADB002 ; 'magic number' lets bootloader find the header .set MAGIC, 0x1BADB002 # 'magic number' lets bootloader find the header
CHECKSUM equ -(MAGIC + FLAGS) ; checksum of above, to prove we are multiboot .set CHECKSUM,-(MAGIC + FLAGS) # checksum of above, to prove we are multiboot
section .multiboot .section .multiboot
align 4 .align 4
dd MAGIC .long MAGIC
dd FLAGS .long FLAGS
dd CHECKSUM .long CHECKSUM
section .bss .section .bss
align 16
stack_bottom: stack_bottom:
resb 16384 ; 16 KiB .skip 16384 # 16 KiB
stack_top: stack_top:
section .text .section .text
global _start:function (_start.end - _start) .global _start
.type _start, @function
_start: _start:
mov $stack_top, %esp
mov esp, stack_top
extern kernel_main
call kernel_main call kernel_main
cli cli
.hang: hlt .hang: hlt
jmp .hang jmp .hang

View File

@ -17,7 +17,7 @@ task "clean", "Removes build files.":
task "bootloader", "Builds the bootloader.": task "bootloader", "Builds the bootloader.":
echo "Building bootloader." echo "Building bootloader."
direShell("nasm -felf32 kernel/arch/i386/boot.s -o boot.o") direShell("clang -c --target=i386-pc-none-elf kernel/arch/i386/boot.s -o boot.o")
echo "Done." echo "Done."
task "build", "Builds the operating system.": task "build", "Builds the operating system.":