The unified diff between revisions [da9f7de4..] and [144fb125..] is displayed below. It can also be downloaded as a raw diff.
#
#
# add_file "src/boards/x86/kernel.adb"
# content [18b135d3035f21646e18a0289ceaf8a02dd4c16d]
#
# add_file "src/boards/x86/kernel.ads"
# content [cb96a0512e576521400a0a50a3fb16753c88a499]
#
# add_file "src/boards/x86/linker.ld"
# content [8e089eb3688644050ce8b7ce50f50d00bf1ee089]
#
# add_file "src/boards/x86/loader.s"
# content [b9b965db5856899da6c9df324a34bd29bae82174]
#
# patch "config/boards/qemu_x86.mk"
# from [6097eed67c4af06d357fa271715d4fb7ed7b5b0b]
# to [89fc6c758de8fe7c4e283a6467673f95889fc1b4]
#
# patch "copyright"
# from [c4dee32ae2bd32f01f0bcfee3a63f694ae24ec6b]
# to [73db7f703340a06958d506da6fd1a627b66f3c7c]
#
# patch "debian/patches/series"
# from [11364ff22585a5fb2fb0749c78418624336b2357]
# to [faf9fd2d10125685c398362ae1476d1948150c26]
#
============================================================
--- src/boards/x86/kernel.adb 18b135d3035f21646e18a0289ceaf8a02dd4c16d
+++ src/boards/x86/kernel.adb 18b135d3035f21646e18a0289ceaf8a02dd4c16d
@@ -0,0 +1,26 @@
+with System.Storage_Elements;
+
+procedure Kernel (Mdb : System.Address;
+ Magic : Interfaces.Unsigned_32) is
+ use type Interfaces.Unsigned_32;
+begin
+ if Magic /= 16#2BADB002# then
+ loop
+ null;
+ end loop;
+ end if;
+
+ -- char * boot_loader_name =(char*) ((long*)mbd)[16];
+
+ declare
+ type Ram is array (1 .. 2) of Interfaces.Unsigned_8;
+ Videoram : Ram;
+ for Videoram'Address use System.Storage_Elements.To_Address (16#000b_8000#);
+ begin
+ Videoram (1) := 65;
+ Videoram (2) := 7;
+ end;
+ loop
+ null;
+ end loop;
+end Kernel;
============================================================
--- src/boards/x86/kernel.ads cb96a0512e576521400a0a50a3fb16753c88a499
+++ src/boards/x86/kernel.ads cb96a0512e576521400a0a50a3fb16753c88a499
@@ -0,0 +1,6 @@
+with System;
+with Interfaces;
+procedure Kernel (Mdb : System.Address;
+ Magic : Interfaces.Unsigned_32);
+pragma No_Return (Kernel);
+pragma Export (C, Kernel, "kmain");
============================================================
--- src/boards/x86/linker.ld 8e089eb3688644050ce8b7ce50f50d00bf1ee089
+++ src/boards/x86/linker.ld 8e089eb3688644050ce8b7ce50f50d00bf1ee089
@@ -0,0 +1,25 @@
+ENTRY (loader)
+
+SECTIONS{
+ . = 0x00100000;
+
+ .text :{
+ *(.text)
+ }
+
+ .rodata ALIGN (0x1000) : {
+ *(.rodata)
+ }
+
+ .data ALIGN (0x1000) : {
+ *(.data)
+ }
+
+ .bss : {
+ sbss = .;
+ *(COMMON)
+ *(.bss)
+ ebss = .;
+ }
+}
+
============================================================
--- src/boards/x86/loader.s b9b965db5856899da6c9df324a34bd29bae82174
+++ src/boards/x86/loader.s b9b965db5856899da6c9df324a34bd29bae82174
@@ -0,0 +1,29 @@
+.global loader # making entry point visible to linker
+
+# setting up the Multiboot header - see GRUB docs for details
+.set ALIGN, 1<<0 # align loaded modules on page boundaries
+.set MEMINFO, 1<<1 # provide memory map
+.set FLAGS, ALIGN | MEMINFO # this is the Multiboot 'flag' field
+.set MAGIC, 0x1BADB002 # 'magic number' lets bootloader find the header
+.set CHECKSUM, -(MAGIC + FLAGS) # checksum required
+
+.align 4
+.long MAGIC
+.long FLAGS
+.long CHECKSUM
+
+# reserve initial kernel stack space
+.set STACKSIZE, 0x4000 # that is, 16k.
+.comm stack, STACKSIZE, 32 # reserve 16k stack on a quadword boundary
+
+loader:
+ mov $(stack + STACKSIZE), %esp # set up the stack
+ push %eax # Multiboot magic number
+ push %ebx # Multiboot data structure
+
+ call kmain # call kernel proper
+
+ cli
+hang:
+ hlt # halt machine should kernel return
+ jmp hang
============================================================
--- config/boards/qemu_x86.mk 6097eed67c4af06d357fa271715d4fb7ed7b5b0b
+++ config/boards/qemu_x86.mk 89fc6c758de8fe7c4e283a6467673f95889fc1b4
@@ -14,9 +14,23 @@ ADACTL=config/boards/project_x86.adp
ADACTL=config/boards/project_x86.adp
-all:$(OBJ_DIR) fd.img fd_alternative.img
+all:test_kernel.elf
-all_sources:runtime_files sos_sources
+test_kernel.elf:$(OBJ_DIR)/kernel.o $(OBJ_DIR)/loader.o
+ ld -T $(LOVELACE_TOPDIR)/src/boards/x86/linker.ld -m elf_i386 \
+ -o test_kernel.elf $(OBJ_DIR)/kernel.o $(OBJ_DIR)/loader.o
+
+$(OBJ_DIR)/kernel.o:$(LOVELACE_TOPDIR)/src/boards/x86/kernel.adb \
+$(LOVELACE_TOPDIR)/src/boards/x86/kernel.ads $(OBJ_DIR) all_sources
+ gcc -m32 -c -nostdlib -nostdinc -I$(LOVELACE_TOPDIR)/runtime_kernel \
+ -o $@ $<
+
+$(OBJ_DIR)/loader.o:$(LOVELACE_TOPDIR)/src/boards/x86/loader.s $(OBJ_DIR)
+ gcc -m32 -c -o $@ $<
+
+lovelace.elf:
+
+all_sources:runtime_files
quilt push -a
touch all_sources
============================================================
--- copyright c4dee32ae2bd32f01f0bcfee3a63f694ae24ec6b
+++ copyright 73db7f703340a06958d506da6fd1a627b66f3c7c
@@ -71,3 +71,8 @@ one modification was done to memcpy.S ma
* @(#)asm.h 5.5 (Berkeley) 5/7/91
*/
one modification was done to memcpy.S machine/asm.h becomes asm.h
+
+files src/boards/x86/linker.ld and src/boards/x86/loader.s comes from [1].
+Licence isn't very clear at the moment, intent is to be "free", as soon as the
+licence is known I'll write it here.
+[1] http://wiki.osdev.org/
============================================================
--- debian/patches/series 11364ff22585a5fb2fb0749c78418624336b2357
+++ debian/patches/series faf9fd2d10125685c398362ae1476d1948150c26
@@ -1,2 +1 @@
-build_image_patch
runtime_base_patch