From e6491d2d1dc1d4238d31e6af6fecdf82b3c6a779 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 25 Aug 2016 17:03:01 -0600 Subject: [PATCH] Arm! --- arm/start.s | 17 ++++++++ x86/kernel.ld | 62 ---------------------------- {x86 => x86_64}/bootsector.asm | 0 {x86 => x86_64}/descriptor_flags.inc | 0 {x86 => x86_64}/gdt_entry.inc | 0 {x86 => x86_64}/harddrive.asm | 0 {x86 => x86_64}/initialize.asm | 0 {x86 => x86_64}/memory_map.asm | 0 {x86 => x86_64}/print16.asm | 0 {x86 => x86_64}/startup-common.asm | 0 {x86 => x86_64}/startup-i386.asm | 0 {x86 => x86_64}/startup-x86_64.asm | 0 {x86 => x86_64}/unreal.asm | 0 {x86 => x86_64}/vesa.asm | 0 {x86 => x86_64}/vesa.inc | 0 15 files changed, 17 insertions(+), 62 deletions(-) create mode 100644 arm/start.s delete mode 100644 x86/kernel.ld rename {x86 => x86_64}/bootsector.asm (100%) rename {x86 => x86_64}/descriptor_flags.inc (100%) rename {x86 => x86_64}/gdt_entry.inc (100%) rename {x86 => x86_64}/harddrive.asm (100%) rename {x86 => x86_64}/initialize.asm (100%) rename {x86 => x86_64}/memory_map.asm (100%) rename {x86 => x86_64}/print16.asm (100%) rename {x86 => x86_64}/startup-common.asm (100%) rename {x86 => x86_64}/startup-i386.asm (100%) rename {x86 => x86_64}/startup-x86_64.asm (100%) rename {x86 => x86_64}/unreal.asm (100%) rename {x86 => x86_64}/vesa.asm (100%) rename {x86 => x86_64}/vesa.inc (100%) diff --git a/arm/start.s b/arm/start.s new file mode 100644 index 0000000000..8495600c4e --- /dev/null +++ b/arm/start.s @@ -0,0 +1,17 @@ +interrupt_vector_table: + b . @ Reset + b . + b . @ SWI instruction + b . + b . + b . + b . + b . + +.comm stack, 0x10000 @ Reserve 64k stack in the BSS +_start: + .globl _start + ldr sp, =stack+0x10000 @ Set up the stack + bl kstart @ Jump to the main function +1: + b 1b @ Halt diff --git a/x86/kernel.ld b/x86/kernel.ld deleted file mode 100644 index c5e3a9deeb..0000000000 --- a/x86/kernel.ld +++ /dev/null @@ -1,62 +0,0 @@ -ENTRY(kstart) -OUTPUT_FORMAT(elf64-x86-64) - -KERNEL_OFFSET = 0x100000; - -SECTIONS { - . = KERNEL_OFFSET; - - . += SIZEOF_HEADERS; - . = ALIGN(4096); - - .text : AT(ADDR(.text) - KERNEL_OFFSET) { - __text_start = .; - *(.text*) - . = ALIGN(4096); - __text_end = .; - } - - .rodata : AT(ADDR(.rodata) - KERNEL_OFFSET) { - __rodata_start = .; - *(.rodata*) - . = ALIGN(4096); - __rodata_end = .; - } - - .data : AT(ADDR(.data) - KERNEL_OFFSET) { - __data_start = .; - *(.data*) - . = ALIGN(4096); - __data_end = .; - } - - .tdata : AT(ADDR(.tdata) - KERNEL_OFFSET) { - __tdata_start = .; - *(.tdata*) - . = ALIGN(4096); - __tdata_end = .; - __tbss_start = .; - *(.tbss*) - . += 8; - . = ALIGN(4096); - __tbss_end = .; - } - - .bss : AT(ADDR(.bss) - KERNEL_OFFSET) { - __bss_start = .; - *(.bss*) - . = ALIGN(4096); - __bss_end = .; - } - - __end = .; - - /DISCARD/ : { - *(.comment*) - *(.debug*) - *(.eh_frame*) - *(.gcc_except_table*) - *(.note*) - *(.rel.eh_frame*) - } -} diff --git a/x86/bootsector.asm b/x86_64/bootsector.asm similarity index 100% rename from x86/bootsector.asm rename to x86_64/bootsector.asm diff --git a/x86/descriptor_flags.inc b/x86_64/descriptor_flags.inc similarity index 100% rename from x86/descriptor_flags.inc rename to x86_64/descriptor_flags.inc diff --git a/x86/gdt_entry.inc b/x86_64/gdt_entry.inc similarity index 100% rename from x86/gdt_entry.inc rename to x86_64/gdt_entry.inc diff --git a/x86/harddrive.asm b/x86_64/harddrive.asm similarity index 100% rename from x86/harddrive.asm rename to x86_64/harddrive.asm diff --git a/x86/initialize.asm b/x86_64/initialize.asm similarity index 100% rename from x86/initialize.asm rename to x86_64/initialize.asm diff --git a/x86/memory_map.asm b/x86_64/memory_map.asm similarity index 100% rename from x86/memory_map.asm rename to x86_64/memory_map.asm diff --git a/x86/print16.asm b/x86_64/print16.asm similarity index 100% rename from x86/print16.asm rename to x86_64/print16.asm diff --git a/x86/startup-common.asm b/x86_64/startup-common.asm similarity index 100% rename from x86/startup-common.asm rename to x86_64/startup-common.asm diff --git a/x86/startup-i386.asm b/x86_64/startup-i386.asm similarity index 100% rename from x86/startup-i386.asm rename to x86_64/startup-i386.asm diff --git a/x86/startup-x86_64.asm b/x86_64/startup-x86_64.asm similarity index 100% rename from x86/startup-x86_64.asm rename to x86_64/startup-x86_64.asm diff --git a/x86/unreal.asm b/x86_64/unreal.asm similarity index 100% rename from x86/unreal.asm rename to x86_64/unreal.asm diff --git a/x86/vesa.asm b/x86_64/vesa.asm similarity index 100% rename from x86/vesa.asm rename to x86_64/vesa.asm diff --git a/x86/vesa.inc b/x86_64/vesa.inc similarity index 100% rename from x86/vesa.inc rename to x86_64/vesa.inc