GRUB Error 7 Troubles
Posted: Sat May 14, 2011 7:22 pm
Hi, I'm new to this forum!
Anyway, I was developing an operating system under DJGPP (following Bran's Kernel Development Tutorial) and it worked until I had to switch to using FreeDOS (due to getting a new 64 bit computer). Whenever I try to run it, I always get GRUB Error 7.
My linker script:
And my assembler file:
Anyway, I was developing an operating system under DJGPP (following Bran's Kernel Development Tutorial) and it worked until I had to switch to using FreeDOS (due to getting a new 64 bit computer). Whenever I try to run it, I always get GRUB Error 7.
My linker script:
Code: Select all
OUTPUT_FORMAT("binary")
ENTRY(start)
SECTIONS {
.text 0x0100000 : {
code = .;
*(.text)
. = ALIGN(4096);
}
.data : {
data = .;
*(.data)
. = ALIGN(4096);
}
.bss : {
bss = .;
*(.bss)
. = ALIGN(4096);
}
end = .;
}
Code: Select all
[BITS 32]
[extern code]
[extern bss]
[extern end]
[extern _main]
[global start]
; This part MUST be 4byte aligned, so we solve that issue using 'ALIGN 4'
ALIGN 4
mboot:
; Multiboot macros to make a few lines later more readable
MULTIBOOT_PAGE_ALIGN equ 1<<0
MULTIBOOT_MEMORY_INFO equ 1<<1
MULTIBOOT_AOUT_KLUDGE equ 1<<16
MULTIBOOT_HEADER_MAGIC equ 0x1BADB002
MULTIBOOT_HEADER_FLAGS equ MULTIBOOT_PAGE_ALIGN | MULTIBOOT_MEMORY_INFO | MULTIBOOT_AOUT_KLUDGE
MULTIBOOT_CHECKSUM equ -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)
EXTERN code, bss, end
; This is the GRUB Multiboot header. A boot signature
dd MULTIBOOT_HEADER_MAGIC
dd MULTIBOOT_HEADER_FLAGS
dd MULTIBOOT_CHECKSUM
; AOUT kludge - must be physical addresses. Make a note of these:
; The linker script fills in the data for these ones!
dd mboot
dd code
dd bss
dd end
dd start