Some info

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.
Post Reply
kp

Some info

Post by kp »

I'm writing a bootloader in Nasm. How do I get
information like: Conventional memory, Extended memory
and print this on the screen. And how do I check
if my CPU is a 32-bit?

I'm very glad if you can give me some sample code.
Ben Hsu

RE:Some info

Post by Ben Hsu »

Hello,

>On 2001-04-18 12:04:40, kp wrote:
>I'm writing a bootloader in Nasm. How do I get
>information like: Conventional memory, Extended memory
You can get the BIOS's interrupts list from Mr.
Ralf Brown at http://www.ctyme.com/rbrown.htm,
which will have a section on memory.

>and print this on the screen. And how do I check
>if my CPU is a 32-bit?

This you will have to make sure you perserved the EDX
register from the very beginning after booting. It was
quoted from this place, http://webster.cs.ucr.edu/Page_asm/Doc386/S10_01.HTM,
where it suggested the idea that DH will hold 3 if
the target CPU is a 80386, and if not than it's not. Do
not assume though that it will be 4 when on 80486, but possible.

>I'm very glad if you can give me some sample code.

Sorry I don't have any codes to say ...
Chris Giese

RE:Some info

Post by Chris Giese »

>On 2001-04-18 12:04:40, kp wrote:
>I'm writing a bootloader in Nasm. How do I get
>information like: Conventional memory, Extended memory
>and print this on the screen. And how do I check
>if my CPU is a 32-bit?
>
>I'm very glad if you can give me some sample code.

http://www.execpc.com/~geezer/osd/boot/ ... m#snippets
Guest

RE:Some info

Post by Guest »

>On 2001-04-18 12:04:40, kp wrote:
>I'm writing a bootloader in Nasm. How do I get
>information like: Conventional memory, Extended memory
>and print this on the screen. And how do I check
>if my CPU is a 32-bit?
>
>I'm very glad if you can give me some sample code.
Well, my knowledge isn't too big, but you can as far it goes for the memory stuff you can try to get it from CMOS via i/o ports, or from BIOS via interrupts. And about the cpu - I don't know how it is with other processors, but you can check the type of a cpu if it's a x86 compatible one (using the eflags register or the cpuid instruction etc.) There are some papers about this topic on the net.
Post Reply