Need a list of x86 RAM Locations
Need a list of x86 RAM Locations
I'm planning to program my own OS.
I'm just a noob.
I know C, and it is a HUGE challenge to program a operating system with nothing but simple procedures, and no includes.
Anyways, does anyone have a list of ram locations?
For example:
0xb8000 = VIdeo ram.
That's the only one I know of =/.
Thanks.
I'm just a noob.
I know C, and it is a HUGE challenge to program a operating system with nothing but simple procedures, and no includes.
Anyways, does anyone have a list of ram locations?
For example:
0xb8000 = VIdeo ram.
That's the only one I know of =/.
Thanks.
-
- Member
- Posts: 524
- Joined: Sun Nov 09, 2008 2:55 am
- Location: Pennsylvania, USA
Re: Need a list of x86 RAM Locations
Most of them aren't fixed. You need to use ACPI or something similar to detect devices and their associated memory areas. The only exception AFAIK is legacy (ISA) devices that have fixed I/O port numbers for the most part.
And the locations you are looking for aren't RAM, they're memory mapped I/O areas.
And the locations you are looking for aren't RAM, they're memory mapped I/O areas.
Re: Need a list of x86 RAM Locations
The best place to start looking is in our wiki.
x86 memory map
x86 memory map
Re: Need a list of x86 RAM Locations
Bewing, thanks that isn' what I wanted, but it will certainly help later on.
Johnny, how would I go about.. Say, going about grabbing input, or status and data from the I\O buses?
I just want to make a simple operating system..
Johnny, how would I go about.. Say, going about grabbing input, or status and data from the I\O buses?
I just want to make a simple operating system..
-
- Member
- Posts: 524
- Joined: Sun Nov 09, 2008 2:55 am
- Location: Pennsylvania, USA
Re: Need a list of x86 RAM Locations
Depends what kind of input, status, and data. If you're staying simple, you may want to just stick with legacy ISA devices (keyboard, mouse, etc.). They're covered on the wiki.
Re: Need a list of x86 RAM Locations
http://wiki.osdev.org/ISA
I looked at the following article, and the DMA & IRQ articles, but by input I ment keyboard input..
Do you have any examples?
Like I said, I just started this so PLEASE Make it broken down as much as possible.
Thanks alot!
I looked at the following article, and the DMA & IRQ articles, but by input I ment keyboard input..
Do you have any examples?
Like I said, I just started this so PLEASE Make it broken down as much as possible.
Thanks alot!
-
- Member
- Posts: 524
- Joined: Sun Nov 09, 2008 2:55 am
- Location: Pennsylvania, USA
Re: Need a list of x86 RAM Locations
From the wiki: PS2 Keyboard.
Don't worry that it says PS2 keyboard, most (maybe all?) chipsets emulate USB keyboards as PS2 keyboards.
Don't worry that it says PS2 keyboard, most (maybe all?) chipsets emulate USB keyboards as PS2 keyboards.
Re: Need a list of x86 RAM Locations
kernel.c:(.text+0x6f): undefined reference to `inb'
Yeah...
Little help, please.
On second thought, if you don't mind helping me out, give me your FaceBook, MSN or Yahoo, if you have any and you don't mind helping out a poor old newbie.
Yeah...
Little help, please.
Code: Select all
void kmain( void* mbd, unsigned int magic )
{
unsigned char *videoram = (unsigned char *) 0xb8000;
clearscreen();
videoram[0] = KeyboardIsr();
//YES - I know that I would need to add a loop for videoram, but I'm just testing atm.
}
void clearscreen()
{
int clearint;
unsigned char *videoram = (unsigned char *) 0xb8000;
for( clearint = 0; clearint < 4000; clearint++ ) {
videoram[clearint] = 32;
clearint++;
videoram[clearint] = 66;
}
}
void haltcpu()
{
asm( "hlt" ); //Halts CPU!
}
void KeyboardIsr()
{
int new_scan_code = inb(0x60);
//outportb(0x20, 0x20);
return new_scan_code;
}
- Troy Martin
- Member
- Posts: 1686
- Joined: Fri Apr 18, 2008 4:40 pm
- Location: Langley, Vancouver, BC, Canada
- Contact:
Re: Need a list of x86 RAM Locations
Hurk!Saustin wrote:FaceBook
You need to write an inb and an outb function. Use inline assembly. There's an example on the wiki. Search.
-
- Member
- Posts: 524
- Joined: Sun Nov 09, 2008 2:55 am
- Location: Pennsylvania, USA
Re: Need a list of x86 RAM Locations
A few things...
You haven't written inb. You need to write it. You can find an inb implementation on the wiki.
You can't call the ISR and put the return value in video memory like that. You need to remap the Programmable Interrupt Controler, setup a Global Descriptor Table, setup an Interrupt Descriptor Table, and put the ISR address in the proper address in the IDT. The ISR can't return anything, it must take actions itself to display something on the screen. IIRC you could poll the keyboard instead of using interrupts, but this uses up all of the CPU.
EDIT:
Troy, what was the point of the facebook rebuke? Weren't you recently aspiring to be a mod?
<ot ignore=true>
Facebook has its issues, but anything big and corporate will. Myspace is much worse, it practices blatant link censorship and is owned by News Corp. These are the same wonderful people who bring you Fox, the TV network that is fair and balanced (for republicans).
</ot>
You haven't written inb. You need to write it. You can find an inb implementation on the wiki.
You can't call the ISR and put the return value in video memory like that. You need to remap the Programmable Interrupt Controler, setup a Global Descriptor Table, setup an Interrupt Descriptor Table, and put the ISR address in the proper address in the IDT. The ISR can't return anything, it must take actions itself to display something on the screen. IIRC you could poll the keyboard instead of using interrupts, but this uses up all of the CPU.
EDIT:
Troy, what was the point of the facebook rebuke? Weren't you recently aspiring to be a mod?
<ot ignore=true>
Facebook has its issues, but anything big and corporate will. Myspace is much worse, it practices blatant link censorship and is owned by News Corp. These are the same wonderful people who bring you Fox, the TV network that is fair and balanced (for republicans).
</ot>
Re: Need a list of x86 RAM Locations
Heh, yes I know facebook sucks.
Anyways..
Like I said, I'm keeping this simple as possible.
INB.. Inb.. let me find that on the wiki real quick..
I love you, google.
"site wiki.osdev.org inb"
I found this:
http://wiki.osdev.org/Inline_Assembly/Examples#INx
One second, I'll try it and post.
Okay, I ran..
I typed random stuff, like "A", "B" etc, and all I got was random *** things on the ASCII chart.
//NOOB :Is that what interupts are for?
Where can I find these maps, and how do I implement them?
Anyways..
Yes, MySpace sucks.JohnnyTheDon wrote:A few things...
You haven't written inb. You need to write it. You can find an inb implementation on the wiki.
You can't call the ISR and put the return value in video memory like that. You need to remap the Programmable Interrupt Controler, setup a Global Descriptor Table, setup an Interrupt Descriptor Table, and put the ISR address in the proper address in the IDT. The ISR can't return anything, it must take actions itself to display something on the screen. IIRC you could poll the keyboard instead of using interrupts, but this uses up all of the CPU.
EDIT:
Troy, what was the point of the facebook rebuke? Weren't you recently aspiring to be a mod?
<ot ignore=true>
Facebook has its issues, but anything big and corporate will. Myspace is much worse, it practices blatant link censorship and is owned by News Corp. These are the same wonderful people who bring you Fox, the TV network that is fair and balanced (for republicans).
</ot>
Like I said, I'm keeping this simple as possible.
INB.. Inb.. let me find that on the wiki real quick..
I love you, google.
"site wiki.osdev.org inb"
I found this:
http://wiki.osdev.org/Inline_Assembly/Examples#INx
One second, I'll try it and post.
Okay, I ran..
I typed random stuff, like "A", "B" etc, and all I got was random *** things on the ASCII chart.
//NOOB :Is that what interupts are for?
Where can I find these maps, and how do I implement them?
Last edited by Saustin on Sat Mar 21, 2009 11:15 pm, edited 1 time in total.
-
- Member
- Posts: 524
- Joined: Sun Nov 09, 2008 2:55 am
- Location: Pennsylvania, USA
Re: Need a list of x86 RAM Locations
It isn't a matter of simplicity, I'm pretty sure it just plain won't work. If the keyboard controller has no key to give you, it won't print the key on the screen. Also, the value you get from the controller is a scan code, not an ASCII key. You need to do the translation before you print anything on the screen.Saustin wrote:Like I said, I'm keeping this simple as possible.
Re: Need a list of x86 RAM Locations
I know about interrupts. Basically, if I would be anoob and want to rape my processor [like I am now!], all I'm doing is while(1)'ing until it's declared a non null value.
So then I'd do a loop which would compare the scan code to a map?
Also, where can I get a map?
--PLEASE don't give me this: "http://wiki.osdev.org/GDT_Tutorial" I don't understand a bit!
So then I'd do a loop which would compare the scan code to a map?
Also, where can I get a map?
--PLEASE don't give me this: "http://wiki.osdev.org/GDT_Tutorial" I don't understand a bit!
-
- Member
- Posts: 524
- Joined: Sun Nov 09, 2008 2:55 am
- Location: Pennsylvania, USA
Re: Need a list of x86 RAM Locations
Its on the PS2 keyboard page: http://www.win.tue.nl/~aeb/linux/kbd/scancodes.html .
A simpler version here: http://www.barcodeman.com/altek/mule/scandoc.php .
A simpler version here: http://www.barcodeman.com/altek/mule/scandoc.php .
Re: Need a list of x86 RAM Locations
Ah! I feel like such a moron..
So, is it just a case of comparing the hex numbers...
Or is it a case of calculating?
Do you mind giving me your contact info, please?
Private message me if you want to.
So, is it just a case of comparing the hex numbers...
Or is it a case of calculating?
Do you mind giving me your contact info, please?
Private message me if you want to.