Can't get GRUB to pass memory map
Can't get GRUB to pass memory map
hey guys, I've been setting bit 6 of the multiboot flags for grub, which should cause it to pass me a memory map according to the documentation. It is not doing this.
I have been using the pre-made floppy with grub installed, which I downloaded from the James Molloy tutorial.
Wondering if anyone else has experienced this before... Is this my version of grub not supporting this?
I am using this line to set the flags:
MBOOT_HEADER_FLAGS equ 1000001b
Also, would it be possible/practical after being booted into protected mode by grub, to drop down into unreal mode and use the bios interupts to grab the memory map myself?
I have been using the pre-made floppy with grub installed, which I downloaded from the James Molloy tutorial.
Wondering if anyone else has experienced this before... Is this my version of grub not supporting this?
I am using this line to set the flags:
MBOOT_HEADER_FLAGS equ 1000001b
Also, would it be possible/practical after being booted into protected mode by grub, to drop down into unreal mode and use the bios interupts to grab the memory map myself?
Re: Can't get GRUB to pass memory map
Make sure you are using grub 0.97 ? Grub 0.96 cannot detect memory on my newest PC.anonlalo wrote:hey guys, I've been setting bit 6 of the multiboot flags for grub, which should cause it to pass me a memory map according to the documentation. It is not doing this.
I have been using the pre-made floppy with grub installed, which I downloaded from the James Molloy tutorial.
Wondering if anyone else has experienced this before... Is this my version of grub not supporting this?
I am using this line to set the flags:
MBOOT_HEADER_FLAGS equ 1000001b
Also, would it be possible/practical after being booted into protected mode by grub, to drop down into unreal mode and use the bios interupts to grab the memory map myself?
If a trainstation is where trains stop, what is a workstation ?
Re: Can't get GRUB to pass memory map
Of course it would, although you just need real, not unreal, mode.anonlalo wrote:Also, would it be possible/practical after being booted into protected mode by grub, to drop down into unreal mode and use the bios interupts to grab the memory map myself?
JAL
-
- Member
- Posts: 255
- Joined: Tue Jun 15, 2010 9:27 am
- Location: Flyover State, United States
- Contact:
Re: Can't get GRUB to pass memory map
I would recommend creating your own floppy with a more recent version of GRUB and see if that works.
Also, check if GRUB is sending a NULL pointer for the memory map or not. If it isn't, it probably is passing it correctly. If you are using a higher-half kernel or otherwise have paging enabled when you try to parse the memory map, make sure you convert its physical address into the correct linear address.
Also, check if GRUB is sending a NULL pointer for the memory map or not. If it isn't, it probably is passing it correctly. If you are using a higher-half kernel or otherwise have paging enabled when you try to parse the memory map, make sure you convert its physical address into the correct linear address.
Re: Can't get GRUB to pass memory map
So, I got grub 1.98 installed on a usb, and I booted it on my netbook... I'm getting this from grub:
I really am lost, as the documentation I am reading on multiboot specification says this should be working. this is where i am looking mostly: http://www.gnu.org/software/grub/manual ... iboot.html
I have also tried looking for examples or explanations in the forum with no luck. Anyone know what is going on here?
Now if I change "MBOOT_FLAGS equ 1000001b" to "MBOOT_FLAGS equ 1", it boots fine, so I am pretty sure it's not my header format. Hoping someone has figured out this before. Also, I have tried this on VMware player, bochs, and my netbook so I don't think it's hardware incompatibility or I would have found some forum posts asking about it.
Code: Select all
error: unsupported flag: 0x41
error: no loaded kernel.
Press any key to continue..._
I have also tried looking for examples or explanations in the forum with no luck. Anyone know what is going on here?
Code: Select all
MBOOT_FLAGS equ 1000001b
MBOOT_MAGIC equ 0x1BADB002
MBOOT_CHKSUM equ -(MBOOT_HEADER_MAGIC + MBOOT_HEADER_FLAGS)
mboot:
dd MBOOT_MAGIC
dd MBOOT_FLAGS
dd MBOOT_CHKSUM
Re: Can't get GRUB to pass memory map
Could you offer a little more details. Do you know a specific version of grub that does support full multiboot spec, or another bootloader which will work?Grub 2 (version 1.98) uses a different (incompatible) multiboot standard implementation.
Re: Can't get GRUB to pass memory map
Okay, so bit 1 sends mmap info... which does not line up with the docs...
Is it still the same structure it passes? this is the one I found it somewhere somewhere, forget where:
I'm just writing my own bootloader... I don't like the fact that grub doesn't work the way it's documented to... and I'm having other problems that I think are related to grub too so I want to have total control over the environment, but I still would like to figure this out for my own sanity.
Is it still the same structure it passes? this is the one I found it somewhere somewhere, forget where:
Code: Select all
struc multiboot_info
.flags resd 1
.memoryLo resd 1
.memoryHi resd 1
.bootDevice resd 1
.cmdLine resd 1
.mods_count resd 1
.mods_addr resd 1
.syms0 resd 1
.syms1 resd 1
.syms2 resd 1
.mmap_length resd 1
.mmap_addr resd 1
.drives_length resd 1
.drives_addr resd 1
.config_table resd 1
.bootloader_name resd 1
.apm_table resd 1
.vbe_control_info resd 1
.vbe_mode_info resd 1
.vbe_mode resw 1
.vbe_interface_seg resw 1
.vbe_interface_off resw 1
.vbe_interface_len resw 1
endstruc
-
- Member
- Posts: 255
- Joined: Tue Jun 15, 2010 9:27 am
- Location: Flyover State, United States
- Contact:
Re: Can't get GRUB to pass memory map
GRUB works the way it's supposed to, so long as you tell it what you want correctly.
Depending on how you look at it, you were either using the wrong version of GRUB or the wrong version of the multiboot specification.
Most other problems with GRUB have the same source: the multiboot header isn't aligned correctly, it's not early enough in the kernel binary, it's a non-ELF kernel without the AOUT kludge, the linker script was incorrect, etc. Did you check to make sure you were doing all that correctly?
Trying to write your own bootloader is a good way to lose your sanity, not that us OS developers have much in the first place.
Depending on how you look at it, you were either using the wrong version of GRUB or the wrong version of the multiboot specification.
Most other problems with GRUB have the same source: the multiboot header isn't aligned correctly, it's not early enough in the kernel binary, it's a non-ELF kernel without the AOUT kludge, the linker script was incorrect, etc. Did you check to make sure you were doing all that correctly?
Trying to write your own bootloader is a good way to lose your sanity, not that us OS developers have much in the first place.
Re: Can't get GRUB to pass memory map
Behold a prime example of NIH syndrome. Prove, don't assume, before you decide to roll-your-own.anonlalo wrote:I'm just writing my own bootloader... I don't like the fact that grub doesn't work the way it's documented to... and I'm having other problems that I think are related to grub too so I want to have total control over the environment, but I still would like to figure this out for my own sanity.
Your chances at doing better than any one well-established project are slim. Pick your battle - writing a better GRUB is a good-sized project for a single person all in itself. Wouldn't it be a shame if it turned out the sole reason why you sunk countless hours in developing and debugging a bootloader is a failure to use e.g. GRUB correctly?
Every good solution is obvious once you've found it.
Re: Can't get GRUB to pass memory map
Fwiw, I have never had any problem getting GRUB to do what I wanted. Given the fact that I'm an average, out of practice developer, that makes me hold those who claim to have problems with it in very low regard...
JAL
JAL
Re: Can't get GRUB to pass memory map
re-read. fixed problems. Thanks for your guys inputs. The problems were arising from a) my being confused by different versions of grub and the multiboot spec and b) I had set some other stuff up wrong and it didn't come to light until now.
And in regards to holding programmers in low regard who can't figure this stuff out. Try searching through wikis and documentation and finding what you need when you have dyslexia. I wasn't asking for anyone to write code for me, I was just asking for some direction as to where to look, because after a couple days of reading the documentation I knew I was in the wrong place. Other than to make me feel bad about myself, and to reinfroce your feeling of superiority over others, I'm really not sure what the point of that comment was.
And in regards to holding programmers in low regard who can't figure this stuff out. Try searching through wikis and documentation and finding what you need when you have dyslexia. I wasn't asking for anyone to write code for me, I was just asking for some direction as to where to look, because after a couple days of reading the documentation I knew I was in the wrong place. Other than to make me feel bad about myself, and to reinfroce your feeling of superiority over others, I'm really not sure what the point of that comment was.
Re: Can't get GRUB to pass memory map
A condition that was anything but obvious from your posts so far. You may consider this a compliment.anonlalo wrote:And in regards to holding programmers in low regard who can't figure this stuff out. Try searching through wikis and documentation and finding what you need when you have dyslexia.
Unfortunately it's not much of an excuse. Either one decides that a certain condition doesn't hinder him being a good programmer, in which case he shouldn't excuse yourself with it. Or he decides that it does hinder him, in which case he should look for a different hobby. (And yes, I know what I'm talking about, as my wife is both dyslexic and a SCJP.)
The upside of it is that programmers tend to be a community judging by achievement only. You may be a kid, a chain-smoking transsexual, you may look like you could use a shower and a haircut, you may look like a maniac who is a night's sleep short and made up for it with a beer too many(*). Doesn't matter, as long as you're skilled.
(*): That's actually me, at a demo party six years ago. I don't claim to be en par with Bunten or Stallman, I was just looking for another "weird" photo.
Every good solution is obvious once you've found it.
Re: Can't get GRUB to pass memory map
Dyslexia is no excuse, as Solar already pointed out. If dyslexia keeps you from being able to program, then don't program.anonlalo wrote:And in regards to holding programmers in low regard who can't figure this stuff out. Try searching through wikis and documentation and finding what you need when you have dyslexia.
If you are feeling bad because of a single comment on the internet, you'd better nog get on-line.Other than to make me feel bad about myself
I place myself at the bottom of the scale among the more experienced developers here, and in no way I feel superior in general. It is no achievement though feeling "superior" (your word) over anyone that can't read a very-easy-to-digest spec anc complains about it.and to reinfroce your feeling of superiority over others
Good question, neither do I.I'm really not sure what the point of that comment was.
JAL
Re: Can't get GRUB to pass memory map
Solar wasn't a jerk about it.Dyslexia is no excuse, as Solar already pointed out. If dyslexia keeps you from being able to program, then don't program.
Most people with disabilities feel bad when they are discriminated against.If you are feeling bad because of a single comment on the internet, you'd better nog get on-line.
Yourself jal, and to a lesser extent solar have given a perfect example of ableism. You think that because I have a disadvantage in this field (or any other that requires a lot of reading) that I shouldn't attempt to try it. Why don't you go one further and say that no disabled person should ever try anything if they know they won't do it as well and a non-disabled person.
I love coding in assembly, and I have wanted to write my own OS since I was 11 or 12 when I first taught myself C and I won't let some elitist developers discourage me because I have a disability(actually many) that puts me at a disadvantage over others.
-
- Member
- Posts: 255
- Joined: Tue Jun 15, 2010 9:27 am
- Location: Flyover State, United States
- Contact:
Re: Can't get GRUB to pass memory map
They aren't saying to not try because you have a disability, but not to use that as an excuse when you are unable to do something.
If anything they are encouraging you to try despite your disability, and I encourage you to do so as well.
The problem seems to be not that you weren't reading the documentation, but that you were reading the wrong documentation. The documentation for GRUB should say the version number at the top. If it is >1.0 then it is not Legacy.
I do agree that this community is slightly elitist, but they have reason to be. Writing an OS is one of the most complicated and advanced programming tasks there is, and having any kind of success in it says a lot about one's programming skills. Similarly, not being able to write an OS doesn't mean one is a bad programmer.
If anything they are encouraging you to try despite your disability, and I encourage you to do so as well.
The problem seems to be not that you weren't reading the documentation, but that you were reading the wrong documentation. The documentation for GRUB should say the version number at the top. If it is >1.0 then it is not Legacy.
I do agree that this community is slightly elitist, but they have reason to be. Writing an OS is one of the most complicated and advanced programming tasks there is, and having any kind of success in it says a lot about one's programming skills. Similarly, not being able to write an OS doesn't mean one is a bad programmer.