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.
Hello Again!
I would like my kernel to run with 'multiboot2' command of GRUB2. but can't find any specification online that standards MULTIBOOT2. i made a multiboot2 header in my kernel (at the start of text section), but GRUB2 says: "multiboot header not found". here is my header:
...
/* The magic field should contain this. */
#define MULTIBOOT2_HEADER_MAGIC 0xe85250d6
...
struct multiboot_header
{
/* Must be MULTIBOOT_MAGIC - see above. */
multiboot_uint32_t magic;
/* Feature flags. */
multiboot_uint32_t flags;
/* The above fields plus this one must equal 0 mod 2^32. */
multiboot_uint32_t checksum;
...
};
Where did you get the information for the new header format ?
If a trainstation is where trains stop, what is a workstation ?
thanks, i got the file and included it in my kernel.
right now, is there any way to know the size of the kernel from GRUB or the boot loader?? i need the kernel to know the size of itself every time it boots in order to mark its memory space as used in an implemented memory map. this will help allocating free memory space in an accurate way. do u have any idea, plz???
Regards,
mostafazizo wrote:thanks, i got the file and included it in my kernel.
right now, is there any way to know the size of the kernel from GRUB or the boot loader?? i need the kernel to know the size of itself every time it boots in order to mark its memory space as used in an implemented memory map. this will help allocating free memory space in an accurate way. do u have any idea, plz???
Regards,
I don't know how to get it from Grub. I feel the best way is to define a variable in your linker script that marks the end of the loadable image. I think this will probably work.
I wonder if i could know the boot device path (PCI bus/dev/func and so on) from GRUB2. do u have any idea? any help is appreciated...
sorry for the large quantity of questions, but this is only because i stayed months developing my kernel neglecting this part of it, cause it is full of obstacles.
Regards,
mostafazizo wrote:I wonder if i could know the boot device path (PCI bus/dev/func and so on) from GRUB2. do u have any idea? any help is appreciated...
sorry for the large quantity of questions, but this is only because i stayed months developing my kernel neglecting this part of it, cause it is full of obstacles.
Regards,
You can get the bios drive number and the partition numbers from the multiboot_info struct.
If a trainstation is where trains stop, what is a workstation ?
mostafazizo wrote:I wonder if i could know the boot device path (PCI bus/dev/func and so on) from GRUB2. do u have any idea? any help is appreciated...
sorry for the large quantity of questions, but this is only because i stayed months developing my kernel neglecting this part of it, cause it is full of obstacles.
Regards,
You can get the bios drive number and the partition numbers from the multiboot_info struct.
I know well but the BIOS Drive Number is not enough for a kernel that supports ATA/SATA HDDs, CD-ROMs, USB Mass Storage Devices and USB CD-ROMs to know which of those devices is the boot device...
mostafazizo wrote:I know well but the BIOS Drive Number is not enough for a kernel that supports ATA/SATA HDDs, CD-ROMs, USB Mass Storage Devices and USB CD-ROMs to know which of those devices is the boot device...
I don't think there is one easy way. This thread may help.
If a trainstation is where trains stop, what is a workstation ?
The problem with that document is that it doesn't match the current version of Grub (1.98). The version of multiboot2.h in the Grub distro and the version in the multiboot documentation are quite different. Oddly the magic numbers are the same. I'm not sure what the Grub guys are doing.
I think Grub 1.98 (and multiboot2.h in particular) are not Multiboot 2 compliant.
If a trainstation is where trains stop, what is a workstation ?