OSDev.org

The Place to Start for Operating System Developers
It is currently Sat Apr 27, 2024 8:17 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: how can i have grub2-linux-install make the mbr file into a
PostPosted: Mon Feb 05, 2024 8:07 am 
Offline

Joined: Sun Jun 25, 2023 9:53 am
Posts: 4
how can i have grub2-linux-install make the mbr file into a 512byte file instead of writing to the MBR? and how to create boot.img to dd to the 1M space thx


Top
 Profile  
 
 Post subject: Re: how can i have grub2-linux-install make the mbr file int
PostPosted: Mon Feb 05, 2024 11:39 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5146
Why do you want to do that? The GRUB installer customizes those files to match your setup. If the GRUB installer doesn't guess the correct settings, you can pass options to override its guesses.

If you're trying to install GRUB on a disk that isn't bootable, the usual strategy is to boot a live CD and chroot into the unbootable system so the installer has access to everything it needs.


Top
 Profile  
 
 Post subject: Re: how can i have grub2-linux-install make the mbr file int
PostPosted: Mon Feb 05, 2024 1:38 pm 
Offline

Joined: Sun Jun 25, 2023 9:53 am
Posts: 4
Octocontrabass wrote:
Why do you want to do that? The GRUB installer customizes those files to match your setup. If the GRUB installer doesn't guess the correct settings, you can pass options to override its guesses.

If you're trying to install GRUB on a disk that isn't bootable, the usual strategy is to boot a live CD and chroot into the unbootable system so the installer has access to everything it needs.


Its for turning off the mbp10,1's nvidia via outb commands. I am using bootcamp and the Metro booter can boot a MBR sector .. anyway I am testing vbt debugging blackscreen .. its complicated I don't think I can solve it.

Now I try bosch emulator and install ubuntu server to try to step thru how it gets the 2048 sector to load the 2nd stage img


Top
 Profile  
 
 Post subject: Re: how can i have grub2-linux-install make the mbr file int
PostPosted: Tue Feb 06, 2024 8:30 am 
Offline

Joined: Fri Nov 26, 2021 11:08 am
Posts: 8
I don’t understand the reference to 2048 byte sectors, but in the normal BIOS/MBR boot setup with 512 byte sectors, GRUB does not only occupy the MBR, but also the free space behind it, that is/was traditionally at least 62 sectors. The BIOS only loads the first one, which then loads the rest, and this is enough code space to make it understand filesystems and partitions, and then it goes from there.


Top
 Profile  
 
 Post subject: Re: how can i have grub2-linux-install make the mbr file int
PostPosted: Tue Feb 06, 2024 11:04 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5146
kocoman wrote:
Its for turning off the mbp10,1's nvidia via outb commands.

Why do you need to extract the MBR and boot.img to do that? Can't you put those commands in grub.cfg and install it like normal?


Top
 Profile  
 
 Post subject: Re: how can i have grub2-linux-install make the mbr file int
PostPosted: Wed Feb 21, 2024 3:50 pm 
Offline

Joined: Sun Jun 25, 2023 9:53 am
Posts: 4
ok I got it to work. the core.img is compressed is very hard to edit.. (just blank screen with cursor) I got to grub rescue, then booted normally, then rerun the grub-install.. that installed the correct core.img
I got the outb commands to work to disable the dgpu


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: DotBot [Bot] and 24 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group