Why is GRUB automatically going to the GRUB in the HDD?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.

Moderators: JAAman, klange, Octocontrabass, sortie, kmcguire, chase, thepowersgang, Owen, Combuster, AJ, 01000101, carbonBased, Candy, pcmattman

Post Reply
NunoLava1998
Member
Member
Posts: 273
Joined: Sun Oct 09, 2016 4:38 am
Freenode IRC: NunoLava1998

Why is GRUB automatically going to the GRUB in the HDD?

Post by NunoLava1998 »

I installed GRUB on my USB using xboot and that application lets me skip the GRUB steps and put the iso automatically. I removed the boot-to-HDD and help options (and help.iso), but when i booted it up, it just goes to the GRUB in my HDD since i dual boot Windows and Luninux Linux.

How can i take care of this? I have modified grub.cfg and menu.lst to ONLY go to the system, and what i seem to see is GRUB loads itself but then it realizes there is no disk or something is invalid (NOTHING IS INVALID AND THERE IS A DISK) and jumps to the hard drive.
Pressing Shift rarely does anything and when it does it's just "Loading GRUB" then going to the HDD GRUB yet again.

I have uploaded here a zip with my GRUB files on mediafire, i cannot upload a 64KB+ file and trying the highest compression possible only gives 708 KB, so here it is: http://www.mediafire.com/file/rnga5fpb66ejgja/grub.rar
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.

https://github.com/NunoLava1998/DixiumOS
User avatar
matt11235
Member
Member
Posts: 286
Joined: Tue Aug 02, 2016 1:52 pm
Location: East Riding of Yorkshire, UK

Re: Why is GRUB automatically going to the GRUB in the HDD?

Post by matt11235 »

It's probably because your BIOS/UEFI is booting to the hard drive instead of your flash drive.

I can't speak for your motherboard, but on mine I need to mash F8 while it boots and then I can pick a boot device.
com.sun.java.swing.plaf.nimbus.InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState
Compiler Development Forum
NunoLava1998
Member
Member
Posts: 273
Joined: Sun Oct 09, 2016 4:38 am
Freenode IRC: NunoLava1998

Re: Why is GRUB automatically going to the GRUB in the HDD?

Post by NunoLava1998 »

zenzizenzicube wrote:It's probably because your BIOS/UEFI is booting to the hard drive instead of your flash drive.

I can't speak for your motherboard, but on mine I need to mash F8 while it boots and then I can pick a boot device.

I do pick it, i even have my first boot device as the USB itself. It just JUMPS to the HDD GRUB for no reason.
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.

https://github.com/NunoLava1998/DixiumOS
User avatar
matt11235
Member
Member
Posts: 286
Joined: Tue Aug 02, 2016 1:52 pm
Location: East Riding of Yorkshire, UK

Re: Why is GRUB automatically going to the GRUB in the HDD?

Post by matt11235 »

For some reason I can't download from your Mediafire link.

Is the image you put on the flash drive actually bootable/does it have 0xAA55 at the end of the first sector? When I try and boot into something without this, the UEFI on my motherboard just silently skips over it and goes to the next entry.
com.sun.java.swing.plaf.nimbus.InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState
Compiler Development Forum
NunoLava1998
Member
Member
Posts: 273
Joined: Sun Oct 09, 2016 4:38 am
Freenode IRC: NunoLava1998

Re: Why is GRUB automatically going to the GRUB in the HDD?

Post by NunoLava1998 »

zenzizenzicube wrote:For some reason I can't download from your Mediafire link.

Is the image you put on the flash drive actually bootable/does it have 0xAA55 at the end of the first sector? When I try and boot into something without this, the UEFI on my motherboard just silently skips over it and goes to the next entry.

If it said "GRUB Loading" during Shift and actually took some time and looked like GRUB was loading graphics, definetly yes. I have formatted the USB as an attempt to get GRUB4DOS on there.
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.

https://github.com/NunoLava1998/DixiumOS
onlyonemac
Member
Member
Posts: 1146
Joined: Sat Mar 01, 2014 2:59 pm

Re: Why is GRUB automatically going to the GRUB in the HDD?

Post by onlyonemac »

I'm going to second the suggestion that the drive isn't bootable. Many users aren't aware that they need to actually install GRUB in the boot sector of their drive, and not just copy the grub files to /boot/grub. Unless you've used grub-install to install GRUB on your drive then it's probably not bootable.
When you start writing an OS you do the minimum possible to get the x86 processor in a usable state, then you try to get as far away from it as possible.

Syntax checkup:
Wrong: OS's, IRQ's, zero'ing
Right: OSes, IRQs, zeroing
NunoLava1998
Member
Member
Posts: 273
Joined: Sun Oct 09, 2016 4:38 am
Freenode IRC: NunoLava1998

Re: Why is GRUB automatically going to the GRUB in the HDD?

Post by NunoLava1998 »

onlyonemac wrote:I'm going to second the suggestion that the drive isn't bootable. Many users aren't aware that they need to actually install GRUB in the boot sector of their drive, and not just copy the grub files to /boot/grub. Unless you've used grub-install to install GRUB on your drive then it's probably not bootable.

I used XBoot beta. It's part BIOS since to boot actual bootable and 100% 10/10 condition things you have to go to boot menu and then press Esc assuming the USB is the first drive on BIOS.
And it's part GRUB beacuse... i can't do ANYTHING
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.

https://github.com/NunoLava1998/DixiumOS
NunoLava1998
Member
Member
Posts: 273
Joined: Sun Oct 09, 2016 4:38 am
Freenode IRC: NunoLava1998

Re: Why is GRUB automatically going to the GRUB in the HDD?

Post by NunoLava1998 »

I guess i will have to design a new bootloader, since XBOOT's GRUB4DOS literally freezes on a blinking cursor.
I used PLOP which should force me into the USB.
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.

https://github.com/NunoLava1998/DixiumOS
User avatar
matt11235
Member
Member
Posts: 286
Joined: Tue Aug 02, 2016 1:52 pm
Location: East Riding of Yorkshire, UK

Re: Why is GRUB automatically going to the GRUB in the HDD?

Post by matt11235 »

NunoLava1998 wrote:I guess i will have to design a new bootloader, since XBOOT's GRUB4DOS literally freezes on a blinking cursor.
I used PLOP which should force me into the USB.


You could just try grub-mkrescue instead of dealing with whatever xboot is.
com.sun.java.swing.plaf.nimbus.InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState
Compiler Development Forum
glauxosdever
Member
Member
Posts: 501
Joined: Wed Jun 17, 2015 9:40 am
Freenode IRC: glauxosdever
Location: Athens, Greece

Re: Why is GRUB automatically going to the GRUB in the HDD?

Post by glauxosdever »

Hi,


NunoLava1998 wrote:I guess i will have to design a new bootloader
While it is good to write your own bootloader when you are more advanced, you definitely shouldn't write one right now. I suggest using GRUB for now, and after you have seen in what ways Multiboot/Multiboot2 are suboptimal, design your own boot specification and your own bootloader.


Regards,
glauxosdever
NunoLava1998
Member
Member
Posts: 273
Joined: Sun Oct 09, 2016 4:38 am
Freenode IRC: NunoLava1998

Re: Why is GRUB automatically going to the GRUB in the HDD?

Post by NunoLava1998 »

glauxosdever wrote:Hi,


NunoLava1998 wrote:I guess i will have to design a new bootloader
While it is good to write your own bootloader when you are more advanced, you definitely shouldn't write one right now. I suggest using GRUB for now, and after you have seen in what ways Multiboot/Multiboot2 are suboptimal, design your own boot specification and your own bootloader.


Regards,
glauxosdever

I cannot use GRUB. I wrote a simple assembly one which worked on my machine but on some emulators just plain out "THERE IS NO OS", but those emulators always say that even when there's a AA55.
And behold...
it rebooted? The random colors it for a bit displays when i reboot suggests the C code has problems on my hardware, as my UEFI BIOS which is written in C gives the exact same results when rebooting. Probably no halt was implemented and it went running beyond the address and rebooted beacuse of that.
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.

https://github.com/NunoLava1998/DixiumOS
Post Reply