Index: linker.ld
===================================================================
--- linker.ld (revision 5)
+++ linker.ld (working copy)
@@ -3,18 +3,6 @@
SECTIONS
{
. = 0x00100000;
-
- .text :
- {
- *(.text)
- *(.text.*)
- }
-
- .rodata ALIGN (0x1000) :
- {
- *(.rodata)
- }
-
.data ALIGN (0x1000) :
{
start_ctors = .;
@@ -26,6 +14,17 @@
*(.data)
}
+ .text :
+ {
+ *(.text)
+ *(.text.*)
+ }
+
+ .rodata ALIGN (0x1000) :
+ {
+ *(.rodata)
+ }
+
.bss :
{
_sbss = .;
Index: irq.inc
===================================================================
--- irq.inc (revision 5)
+++ irq.inc (working copy)
@@ -20,113 +20,113 @@
# 32: IRQ0
irq0:
cli
- pushb $0
- pushb $32
+ push $0x0
+ push $32
jmp irq_common_stub
# 33: IRQ1
irq1:
cli
- pushb $0
- pushb $33
+ push $0
+ push $33
jmp irq_common_stub
# 34: IRQ2
irq2:
cli
- pushb $0
- pushb $34
+ push $0
+ push $34
jmp irq_common_stub
# 35: IRQ3
irq3:
cli
- pushb $0
- pushb $35
+ push $0
+ push $35
jmp irq_common_stub
# 36: IRQ4
irq4:
cli
- pushb $0
- pushb $36
+ push $0
+ push $36
jmp irq_common_stub
# 37: IRQ5
irq5:
cli
- pushb $0
- pushb $37
+ push $0
+ push $37
jmp irq_common_stub
# 38: IRQ6
irq6:
cli
- pushb $0
- pushb $38
+ push $0
+ push $38
jmp irq_common_stub
# 39: IRQ7
irq7:
cli
- pushb $0
- pushb $39
+ push $0
+ push $39
jmp irq_common_stub
# 40: IRQ8
irq8:
cli
- pushb $0
- pushb $40
+ push $0
+ push $40
jmp irq_common_stub
# 41: IRQ9
irq9:
cli
- pushb $0
- pushb $41
+ push $0
+ push $41
jmp irq_common_stub
# 42: IRQ10
irq10:
cli
- pushb $0
- pushb $42
+ push $0
+ push $42
jmp irq_common_stub
# 43: IRQ11
irq11:
cli
- pushb $0
- pushb $43
+ push $0
+ push $43
jmp irq_common_stub
# 44: IRQ12
irq12:
cli
- pushb $0
- pushb $44
+ push $0
+ push $44
jmp irq_common_stub
# 45: IRQ13
irq13:
cli
- pushb $0
- pushb $45
+ push $0
+ push $45
jmp irq_common_stub
# 46: IRQ14
irq14:
cli
- pushb $0
- pushb $46
+ push $0
+ push $46
jmp irq_common_stub
# 47: IRQ15
irq15:
cli
- pushb $0
- pushb $47
+ push $0
+ push $47
jmp irq_common_stub
# handles irq calls - two bytes already pushed - error code and interrupt number
Index: kernel.cc
===================================================================
--- kernel.cc (revision 5)
+++ kernel.cc (working copy)
@@ -26,6 +26,36 @@
#include <stddef.h>
#include <io.h>
+struct __attribute__ ((__packed__)) tmbhdr{
+ unsigned long magic;
+ unsigned long flags;
+ unsigned long checksum;
+ unsigned long hdr_addr;
+ unsigned long load_addr;
+ unsigned long load_end_addr;
+ unsigned long bss_end_addr;
+ unsigned long entry_addr;
+ unsigned long mode_type;
+ unsigned long width;
+ unsigned long height;
+ unsigned long depth;
+ //
http://www.gnu.org/software/grub/manual ... der-layout
+};
+
+#define MB_MAGIC 0x1BADB002
+#define MB_FLAGS ((1<<1))
+struct tmbhdr g_mbhdr = {
+ MB_MAGIC,
+ MB_FLAGS,
+ 0x0 - MB_MAGIC - MB_FLAGS,
+ 0x0,
+ 0x0,
+ 0x0,
+ 0x0,
+ 0x0
+};
+
+
// main() must be C so no name mangling occurs
extern "C" int main( multiboot_info_t* mb, unsigned int magic_number );