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
* nimble (* or use other nake install method)
* clang
* nasm
* grub2
* qemu

View File

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

View File

@ -17,7 +17,7 @@ task "clean", "Removes build files.":
task "bootloader", "Builds the 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."
task "build", "Builds the operating system.":