OSDev.org

The Place to Start for Operating System Developers
It is currently Mon Mar 18, 2024 8:14 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: I don't like Grub2
PostPosted: Fri Nov 21, 2014 7:33 am 
Offline
User avatar

Joined: Fri Nov 21, 2014 6:30 am
Posts: 24
First of all, I just started out in the OS-Dev hobby, so I know it's probably wrong of me to have such a strong opinion about things I don't fully understand yet.

That said, what the hell were they thinking? The legacy Grub was easy to configure (huge mess in /boot/grub/ now) and to install (so far I failed to install Grub2 on a loopback device, following the Wiki instructions). Is the goal of Grub2 to be a UEFI-compliant bootloader? How does it justify how bloated and overengineered it is?

I don't like Grub2 so far, and I don't know if I should embrace it and leave Grub Legacy behind.

I would like to know what you people have to say about Grub2 and if your kernels are Multiboot2-compliant.


Top
 Profile  
 
 Post subject: Re: I don't like Grub2
PostPosted: Fri Nov 21, 2014 8:05 am 
Offline
Member
Member
User avatar

Joined: Wed Mar 21, 2012 3:01 pm
Posts: 930
I don't particularly like GRUB either. I do use it, though, and my kernel is multiboot. I wouldn't recommend using ancient GRUB, it's ancient. It's unmaintained and nothing good will come from using it. Fortunately I rarely have to actually install GRUB onto disk images and such. I'll switch to another bootloader when that becomes an issue.

Some guys here are making Gandr. Might be interesting.


Top
 Profile  
 
 Post subject: Re: I don't like Grub2
PostPosted: Fri Nov 21, 2014 9:17 am 
Offline
Member
Member
User avatar

Joined: Fri Oct 21, 2011 9:47 pm
Posts: 286
Location: Tustin, CA USA
I'm indifferent about GRUB. My problem with GRUB2 is really in the Multiboot 2 specification (which is unspecific) and the liberties that GRUB2 takes in interpreting the specification. However, I also use GRUB2 as it gets the job done (for now) and allows me to focus my attention on writing my kernel. I did make the effort to have my kernel loadable with either a multiboot 1 or multiboot 2 compliant loader.

_________________
Adam

The name is fitting: Century Hobby OS -- At this rate, it's gonna take me that long!
Read about my mistakes and missteps with this iteration: Journal

"Sometimes things just don't make sense until you figure them out." -- Phil Stahlheber


Top
 Profile  
 
 Post subject: Re: I don't like Grub2
PostPosted: Fri Nov 21, 2014 9:42 am 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 3:45 am
Posts: 9301
Location: On the balcony, where I can actually keep 1½m distance
If your kernel supports legacy multiboot, then there are several bootloaders available that supports it - GRUB2 is only one of them. However, neither version of multiboot suffices to provide everything you could ever want for your, and a dedicated bootstrap is the best option in the end.

Considering any use of GRUB is like choosing from alternative evils, you might just want to choose whichever poison seems to result in the least painful death ;)

I do have a personal aversion to GRUB2, but that's mostly because not even Ubuntu could get it right and had me manually fix the installation. A lack of usability is certainly not a good upgrade, so I'd keep preferring legacy as it requires hardly a second thought to maintain. I have since migrated to Refind.

_________________
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]


Top
 Profile  
 
 Post subject: Re: I don't like Grub2
PostPosted: Fri Nov 21, 2014 10:49 am 
Offline
Member
Member
User avatar

Joined: Mon Jun 05, 2006 11:00 pm
Posts: 2292
Location: USA (and Australia)
eryjus wrote:
My problem with GRUB2 is really in the Multiboot 2 specification (which is unspecific) and the liberties that GRUB2 takes in interpreting the specification.


What issues are you having with Multiboot 2? I know it's different from Multiboot 1 (you have to request what you want from it - here's my working example asking for the memory map), but it's no more difficult as many APIs, protocols, hardware, data structures, etc. out there. One of the hardest specs for me to decode was the SoundFont file format.

_________________
My OS is Perception.


Top
 Profile  
 
 Post subject: Re: I don't like Grub2
PostPosted: Fri Nov 21, 2014 3:59 pm 
Offline
Member
Member
User avatar

Joined: Sat Jan 15, 2005 12:00 am
Posts: 8561
Location: At his keyboard!
Hi,

Espanish wrote:
That said, what the hell were they thinking? The legacy Grub was easy to configure (huge mess in /boot/grub/ now) and to install (so far I failed to install Grub2 on a loopback device, following the Wiki instructions). Is the goal of Grub2 to be a UEFI-compliant bootloader? How does it justify how bloated and overengineered it is?


For BIOS systems; traditionally you'd have an MBR that loads the OS's boot sector (in the OS's partition). When there are multiple OSs installed, you'd use a boot manager to allow the user to select which OS they want, which "chain loads" the selected OS's boot loader. The part the selects which OS to boot and the OS's boot loader are 2 completely different and separate things. This allows the user to install any boot manager they like, and any OSs they like - any mixture of OSs and boot managers should work.

The original GRUB developers completely failed to understand the benefits of "separation of concerns" and screwed this up. They built many different boot loaders right into the boot manager (e.g. for Linux, for FreeBSD, etc; plus multi-boot). It was a poorly designed from the very beginning.

Part of the reason multi-boot exists is because they were hoping to convince a lot of OSs to abandon their existing/native boot code and switch to multi-boot, and avoid the need many different boot loaders in GRUB. This didn't happen. For example, even after the GRUB developers added multi-boot support to the Linux kernel, none of the Linux kernel developers wanted it and Linux continued to use its own/native boot protocol.

Then UEFI came along. For UEFI it's the same - when multiple OSs are installed, you're supposed to have a UEFI application that lets the user choose which OS to boot, and that application would start the OS's own UEFI boot loader. GRUB legacy was designed for BIOS only and couldn't work on UEFI. They started GRUB2 in an attempt to screw up "separation of concerns" on UEFI too. While doing that they also attempted to add support for non-80x86 systems (e.g. MIPS, ARM, Itanium, etc).

Their utter failure to understand the benefits of "separation of concerns", combined with many more very different "concerns" (including different boot devices, different "boot protocols" needed by different OSs, different firmware types, different CPUs/architectures, etc) led to "second system effect". To help cope with such a ridiculous mess, they switched to a modular approach. This mostly only made things worse (optional modules meant a whole lot more mess for installation and configuration, plus additional risk of breakage - e.g. when a module one OS needs wasn't installed by another OS).

Note: The increase in complexity also led to OSs (e.g. Ubuntu) that attempt to hide the complexity of GRUB2's configuration under their own layer of scripts, etc; where if you update the OS its scripts "auto-re-generate" GRUB2's configuration for the user. This means if you have 2 or more OSs installed, they can "fight" and trash each other's GRUB2 configuration (a side effect caused by failing to separate the different OS's concerns).

For multi-boot itself, it was similar. The original version was only designed for BIOS and didn't work so well on UEFI or other systems; so they started "multi-boot 2". However, due to lack of interest (and because few OSs cared about multi-boot) this took an extremely long time. This also means that there are people using older versions of GRUB2 on their computers with old/incompatible versions of multi-boot2.

Espanish wrote:
I would like to know what you people have to say about Grub2 and if your kernels are Multiboot2-compliant.


For my OSs; I design my own "transition state" standard that describes the state the computer has to be in when the boot loader transfers control to the OS (which information needs to be where, what state CPUs should be in, etc). Then I create a different boot loader for each different case (e.g. one for BIOS hard disk, one for BIOS network boot, one for UEFI, etc). Multi-boot is just one of those different cases - e.g. I'll have a piece of code that is started by multi-boot, that sets everything up to comply with the OS's "transition state" standard, and then passes control to the OS like any other boot loader would. However; because my own "transition state" standard is designed for my OS and includes special features that multi-boot doesn't support; the OS's multi-boot support is something my OS's user guides would warn potential end users against using (e.g. a "not officially supported" hack).


Cheers,

Brendan

_________________
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.


Top
 Profile  
 
 Post subject: Re: I don't like Grub2
PostPosted: Fri Nov 21, 2014 7:59 pm 
Offline
Member
Member
User avatar

Joined: Fri Oct 21, 2011 9:47 pm
Posts: 286
Location: Tustin, CA USA
MessiahAndrw wrote:
eryjus wrote:
My problem with GRUB2 is really in the Multiboot 2 specification (which is unspecific) and the liberties that GRUB2 takes in interpreting the specification.


What issues are you having with Multiboot 2? I know it's different from Multiboot 1 (you have to request what you want from it - here's my working example asking for the memory map), but it's no more difficult as many APIs, protocols, hardware, data structures, etc. out there. One of the hardest specs for me to decode was the SoundFont file format.


My original post on the topic is here. It might read like a toolchain issue. But most of my unnecessary issues were related to the specs and grubs interpretation. For example, the spec mentions nothing about each sub-structure alignment which grub requires in order to be recognized. Also, the definition and use of the word, "size," is inconsistent between the specification (as well as unclear in the specification) and grub's implementation.

_________________
Adam

The name is fitting: Century Hobby OS -- At this rate, it's gonna take me that long!
Read about my mistakes and missteps with this iteration: Journal

"Sometimes things just don't make sense until you figure them out." -- Phil Stahlheber


Top
 Profile  
 
 Post subject: Re: I don't like Grub2
PostPosted: Sat Nov 22, 2014 5:29 pm 
Offline
Member
Member
User avatar

Joined: Wed May 15, 2013 5:49 pm
Posts: 44
Location: Berlin
I like Brendan's narrative of how GRUB got to be the way it is :)

My own frustrations with GRUB have more to do more with long-standing brain-dead design decisions in their default configuration, encountered in my sometime capacity as a sysadmin for remote Linux machines.

For OS development, I just stick with Pure64, which is the simplest and most trouble-free bootloader solution I've yet to encounter.

_________________
Developer of libc11


Top
 Profile  
 
 Post subject: Re: I don't like Grub2
PostPosted: Mon May 09, 2016 1:05 am 
Offline
Member
Member

Joined: Wed Nov 18, 2015 3:04 pm
Posts: 396
Location: San Jose San Francisco Bay Area
grub2 looks like some "know-it-all" shitcrap person has just throw in bunch of scipt code into the configuration file and deserves himself a great assholic title. It is very unfortunate linux has gone this path. Same for many countless other stupid utilities in linux i.e. yum becoming dnf, ifconfig is obsolete in rhel7.0, linux distro-s has became a domain everyone just "disrupts" anything for their own good.

_________________
key takeaway after spending yrs on sw industry: big issue small because everyone jumps on it and fixes it. small issue is big since everyone ignores and it causes catastrophy later. #devilisinthedetails


Top
 Profile  
 
 Post subject: Re: I don't like Grub2
PostPosted: Mon May 09, 2016 1:27 am 
Offline
Member
Member

Joined: Sun Feb 01, 2009 6:11 am
Posts: 1070
Location: Germany
sortie wrote:
I wouldn't recommend using ancient GRUB, it's ancient. It's unmaintained and nothing good will come from using it.

Software doesn't become bad just because it's old. If you're happy with the features that it has, GRUB 1 is a solid piece of software that just works.

GRUB 2 is considerably harder to get installed and working on a disk image, so when there is no GRUB 1 available, I often end up using syslinux instead nowadays to boot Multiboot kernels. Of course, syslinux isn't quite as nice as GRUB when you have to edit the configuration during the boot process, but as long as it's only images run in an emulator on my development box, I don't really have a reason to do that anyway.

_________________
Developer of tyndur - community OS of Lowlevel (German)


Top
 Profile  
 
 Post subject: Re: I don't like Grub2
PostPosted: Mon May 09, 2016 12:30 pm 
Offline
Member
Member
User avatar

Joined: Fri Oct 27, 2006 9:42 am
Posts: 1925
Location: Athens, GA, USA
ggodw000: Oh, and you might want to check the date of the last post in a thread before replying to it 8)

_________________
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 4 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