Page 1 of 1
Help with GRUB --EDIT: Stupid Mistake
Posted: Thu Jun 28, 2007 11:48 am
by t0xic
Hey everyone,
EDIT:
Apparently I mis-crafted my makefile, and it was compiling source from my backup directory... don't you just hate it when you make stupid mistakes?
I'm just switching over from a custom bootloader to grub. (using windows) Grub was working fine the first couple of times, but now when I replace the kernel.bin file, I have to reconfigure the entire bootdisk every time. Also, grub doesn't want to boot the correct version of my kernel. What's wrong, and is there any way to permanently config grub?
Thanks,
--Michael
Posted: Thu Jun 28, 2007 12:28 pm
by Kevin McGuire
I think it could help if you tell us more about:
- How you reconfigure the boot disk?
- The error message, or description of problem, when GRUB boots?
- More specific information about not booting the version you want?
Posted: Thu Jun 28, 2007 12:37 pm
by t0xic
I have to use the "install (fd0)/boot/stage1 (fd0) (fd0)/boot/stage2 (fd0)/boot/menu.cfg", on my aux disk each time to configure the boot disk.
When I want to put an updated kernel on the disk, grub doesn't start and I get the "non-system disk" fat12 error.
What I mean about an old version is: For instance: if I add a new line saying: "printk("Testing Grub");" It's like it never happens. The kernel is compiling right (im using gcc cross i586-elf), so I think it's a Fat error (not really overwriting or something)
Hope this helps,
Thanks,
--Michael
Posted: Thu Jun 28, 2007 2:07 pm
by frank
what program are you using to edit the disk with.
Posted: Thu Jun 28, 2007 6:29 pm
by t0xic
I'm using the grub auxiliary disk to get the boot disk with my kernel on it running. Each time I copy my kernel over to the boot disk in a:\boot\, I have to use the aux disk to reconfigure my boot disk
Grub is evil...
--Michael
Posted: Thu Jun 28, 2007 7:38 pm
by Kevin McGuire
I have never heard of
or had GRUB delete or modify the contents of my floppy disk before..
We need more information:
- What are the contents of the disk after GRUB supposedly screws it up? Are the GRUB stage files including the grub.conf still there and not corrupted?
- Have you verified that you actually placed the newly compiled kernel image onto the disk by reading back the file to double check?
Posted: Thu Jun 28, 2007 8:31 pm
by t0xic
Grub just started this yesterday
I wouldn't call it corrupted, but something else. Everything is still on the image, and even after I fully format and try again, still same error.
Here is an example of what I'm doing:
mount image
copy kernel to a:\boot\kernel.bin
dismount image
copy image to bochs folder
run bochs
I can tell there is an error because I made my entry function only do a loop, took out all text and everything, recompiled it and did the steps above
after formating the image, and bochs will load an old kernel that still starts up. It's confusing. If I switch back to my custom bootloader, everything works fine... may just have to screw grub
Thanks for listening to me rant,
--Michael
Posted: Fri Jun 29, 2007 8:43 am
by Bughunter
Here's an example GRUB 0.97 image (check the attachment), it immediately boots your 'kernel.bin' without waiting.
Put 'kernel.bin' in the root of the floppy disk.
Posted: Fri Jun 29, 2007 11:27 am
by t0xic
Thanks for the grub disk... But now grub assures me that my kernel is below the 1 MB mark... here is my linker script:
Code: Select all
OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
OUTPUT_ARCH(i386)
ENTRY(start)
SECTIONS
{
. = 0xC0000000;
.text :
{
code = .; _code = .;
*(.text)
. = ALIGN(4096);
}
.data :
{
data = .; _data = .;
*(.data)
. = ALIGN(4096);
}
.bss :
{
bss = .; _bss = .;
*(.bss)
. = ALIGN(4096);
}
.rodata :
{
rodata = .; _rodata = .;
*(.rodata)
. = ALIGN(4096);
}
. = ALIGN(4096);
end = .; _end = .;
}
Is there anything obviously wrong here that I'm missing?
Thanks,
--Michael
Posted: Fri Jun 29, 2007 12:04 pm
by Bughunter
What is going wrong then?
Posted: Fri Jun 29, 2007 12:06 pm
by t0xic
Thats what I don't know
My kernel should be loading at the 3 GB mark, but grub says it's not. I'll try again I guess...
--Michael
Posted: Fri Jun 29, 2007 1:42 pm
by frank
It doesn't get loaded at the 3gb mark (I doubt most people have RAM there anyways) grub loads it at the 1mb mark (I believe) and you have to map it to the 3gb mark using paging yourself.
Posted: Fri Jun 29, 2007 2:00 pm
by t0xic
Meh, it's working now.
Thanks to everyone who helped,
--Michael