Questions tagged [grub]

GENERAL GRUB SUPPORT IS OFF-TOPIC. Support questions may be asked on https://superuser.com. GRUB, the GNU GRand Unified Bootloader, is a boot loader used on x86 systems, typically used to boot Linux. Questions about using or configuring GRUB are rarely on-topic for Stack Overflow outside of unusual circumstances.

GRUB is the reference implementation of the Multiboot Specification, which provides a user the choice to boot one of multiple operating systems installed on a computer or select a specific kernel configuration available on a particular operating system's partitions.

As GRUB is not a tool specifically used for software development, questions about it will typically be considered off-topic on Stack Overflow unless it is being used in a particularly unusual manner, e.g. if you are developing custom modules for GRUB, or if you have developed your own operating system kernel.

If you are having a problem with using or configuring GRUB on your computer, please consider asking your question on SuperUser.com, the Stack Exchange site for computer enthusiasts and power users, or on a site specific to the Linux distribution you are using, such as the Ask Ubuntu Stack Exchange or UNIX & Linux Stack Exchange.

171 questions
3
votes
1 answer

Custom code with GRUB?

Can I run some some custom code at the time when GRUB loads up? In other words does GRUB provide a facility to run some custom code before loading any operating system?
Uthman
  • 9,251
  • 18
  • 74
  • 104
3
votes
2 answers

Implementing GDT with basic kernel

I've recently become fascinated with kernel development, and started with the bare bones tutorial on the OSDev Wiki. After implementing the Hello World example, I moved on and began attempting to create the Global Descriptor Table. From various…
Jumhyn
  • 6,687
  • 9
  • 48
  • 76
3
votes
3 answers

Debian GRUB rescue - "invalid arch independent ELF magic"

I have recently dual-booted a Windows PC with Debian Wheezy. The installation went fine with no errors, but when I boot to Debian I am immediately greeted with GRUB rescue: Welcome to GRUB! error: unknown filesystem. Entering rescue mode... After…
Parker Hoyes
  • 2,118
  • 1
  • 23
  • 38
3
votes
3 answers

Booting a non-multiboot kernel with GRUB2

I want to boot a custom kernel (non-multiboot) with GRUB2, I've read that I need grub.cfg like this: menuentry "custom kernel" { set root=(hd0,0) chainloader +1 } So, I have some questions: How grub detect kernel? (with multiboot spec I…
Vanzef
  • 453
  • 1
  • 5
  • 17
3
votes
0 answers

grub2 chainloading - how does it pass drive number and partition entry point?

I am writing my own bootloader and would like to make it possible to chainload it using grub2. In which registers does grub pass the drive number and the partition entry point? Is there a specification in which registers they should regularely be…
Zulakis
  • 7,859
  • 10
  • 42
  • 67
3
votes
1 answer

Brans Kernel Development : Grub Multiboot header?

I am following Bran's kernel development tutorial. In his assembly code, he has the following block of code that he describes to be not so important but something that is do with GRUB. ; This part MUST be 4byte aligned, so we solve that issue using…
Ankit
  • 6,772
  • 11
  • 48
  • 84
2
votes
2 answers

Grub run in which mode?

I learn that when computer starts it is in real mode.And kernel is responsible for switching mode from real to protected.Ok , my question is Grub boot loader runs in real mode or in protected mode ?
Vikram
  • 1,999
  • 3
  • 23
  • 35
2
votes
1 answer

Where in memory will os boot code be loaded when using grub chainloader?

Problem Description Hi. I want to use grub chainloader to load my minios (an os I developed myself, not linux or windows). Before using grub chainloader, minios boot process was BIOS->MBR->os boot(stored in sector 0 of the primary…
DanielSun
  • 33
  • 4
2
votes
0 answers

VESA BIOS Extensions: How to Change Resolution?

I just finished writing a small boot loader and kernel that switches into protected mode and sets up a basic physical and virtual memory manager: Currently, I'm displaying text onto the screen by writing to the video address 0xB8000 in memory.…
user541686
  • 205,094
  • 128
  • 528
  • 886
2
votes
1 answer

Jumping back to Grub from the kernel in UEFI system

I am working on a tiny x86 64 bit kernel that is multiboot2 compliant, the kernel is loaded and launched by Grub. The requirement is that, once the kernel finishes its activity it needs to relaunch Grub. In non UEFI based systems, we used to achieve…
GKT
  • 23
  • 5
2
votes
1 answer

QEMU Hangs At Boot Time

Attempting to boot from a Live Linux Mint 18.4 (x64) ISO using QEMU under macOS Catalina (with patches to use hvf as hypervisor in place of kvm). I am able to get as far as the boot menu, but attempting to boot into the installer leaves me with a…
2
votes
1 answer

Multiboot 1 Boot Information total size

Is there a quick and reliable way find out the total size of the Multiboot 1 boot information in memory? Just to clarify: I'm not asking about the size of the structure pointed to by the value in the EBX register, I'm asking about the total size of…
ajxs
  • 3,347
  • 2
  • 18
  • 33
2
votes
2 answers

Unable to boot a custom kernel in VirtualBox : "could not read from boot medium"

I followed the tutorial series on Write your own operating system in 1 hour to create a basic OS to print just "Hello World" with just 4 files : Makefile, kernel.cpp, loader.s and linker.ld. I am creating a mykernel.iso file but when I boot it into…
Naveen
  • 7,944
  • 12
  • 78
  • 165
2
votes
1 answer

Grub memory map in higher half x86 kernel

I am writing a higher-half 32-bit kernel loaded at 0xC0000000 (3GByte) virtual address and I am using multiboot_info struct to get the physical memory map. When I use #1, the first mmap_addr I'm getting is 0x9000 but I'm not able to examine the…
rithvikp
  • 133
  • 1
  • 11
2
votes
1 answer

How to compile a simple multiboot2 bare-metal executable?

I want to start to write an os kernel, and then, i found a document introducing multboot2 spec. There are three example code files, named boot.S, kernel.c and multiboot2.h, belonging to the multiboot2 branch of grub project. Firstly, i tried to…
linux40
  • 368
  • 1
  • 9