Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do I write a text input driver on my x86 console OS

Status
Not open for further replies.

redwing26

Programmer
Feb 16, 2006
21
0
0
GB
Hi I have been reading assembly books like nothing else, I have a reasnable experience with c. At present I have made a bootsector on a floppy disk, this reads a file loader.bin (assembled via nasmw). Loader.bin is whats going to be the console os , I have followed a guide at the following page to its conclusion
Anyway it reccomends loosning my ties with the bios and not using interrupts for text input and that graphics memmory is on the graphics card at
b8000-is ascii code for upper corner of screen
b8001-is color/style of the char
etc

Is this a standard for every card? and is it reffering to addresses on the actual graphics card.

More importantly how is a device driver coded like this without using interrupts? I want to build a small console os but do it in as proper a way as possible so I can expand it as I learn more. At the same time I want to keep it basic so its doable while Im still learning. I also want to stick to the way above but dont know 100% how to immplement what they are suggesting.

I have a ati x800 gto pci express, will this have certain registers on it like processors? where could I find out info to do with that model of card which relates to assembly language programming.

Can anyone provide the most basic form of a text input driver and f possible some guides on writting a console os

heres the guide Im reading:

david

Its not linux Im using at this time .......also if anyone knows of any good basic guides that cover the above I would be grateful
 
If you are writing a console OS, the buffer will always be at B800:0000. For the life of me I can't see the point of not using the BIOS interrupts; MS-DOS certainly does, and that's what they are there for. I wouldn't envy anybody the job of trying to program a floppy disk controller directly. Believe me, I've tried. As hardware goes, it doesn't come any more temperamental than floppy disk controller.

If you are intent on placing text directly into the video buffer (which is all you need to get it on screen), the first ascii character (top left of screen) goes at b800:0000, followed by its attribute byte at b800:0001, then the second character on the top row at b8000:0002, followed by it's attribute byte at b800:0003, and so on. An attribute of 7 will get you a white character on black background. If you want to avoid using int 16h to retrieve keyboard data you will need to learn how to manipulate the circular queue in the BIOS data area. I can't remember its address now, but it will be something like 0400:????H
 
The B8000 Text Buffer address is standard for all cards made since the inception of VGA; However prior to VGA, ther were a few card standards that did not use B8000; The Hercules Monochrome adapter stands out in my mind. But IF any of those are still even functioning after 20 years, they soon won't be. The same for the CGA Standard, which also had the annoying problem of having to sync your buffer writes with refresh starts so you wouldn'ty get snow on the display. Ahh, the good old days!

The simplest solution is the best!
 
Since the EGA, MDA, Hercules and CGA were all ISA adaptors, nothing made in the last 6 or 7 years will accept the cards anyway...

Nothing is quite as exciting as running Windoze 3.0 on a 286 with a Hercules card...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top