News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Port I/O

Started by GoneFishing, July 03, 2013, 01:18:18 AM

Previous topic - Next topic

GoneFishing

Hello, DOS guys!

I'm a happy owner of a pair of older machines (Pentium I, Pentium III) and a pair of motherboards with CPUs and RAM on them. So I must make a use of all these toys  ;)

My idea is to make a bootable  floppy disk  with a kind of hardware testing utility on it. What I want to achieve is  to interact with every (if possible) microcontroller  on the motherboard .

I've already taught my floppy disk to say Hello to me. Now it's not enough. I want him to talk about those things hidden deep inside the hardware controllers. First of all I plan to read vendor/model/version info and output it to the screen.I will use only BIOS interrupts and real mode.

I know that PORT I/O is tricky and need some guidance.

MichaelW

You are probably going to need Ralf Brown's Interrupt List, an HTML version is here and a downloadable version here. The downloadable version includes an I/O port list.

Another good reference would be The Undocumented PC by Frank van Gilluwe.

What do you mean by vendor/model/version info?
Well Microsoft, here's another nice mess you've gotten us into.

GoneFishing

Quote from: MichaelW on July 03, 2013, 08:59:10 AM
You are probably going to need Ralf Brown's Interrupt List, an HTML version is here and a downloadable version here. The downloadable version includes an I/O port list.

Another good reference would be The Undocumented PC by Frank van Gilluwe.

What do you mean by vendor/model/version info?

Thank you for your help,  Michael.  It'll check those links.
I'll try to explain. Lets take a BIOS  for example.The  BIOS ROM chip (hardware)  has its own specs (i.e. manufacturer, model, physical capacity etc.) while BIOS  itself (firmware)  also has its own specifications.
First thing I want to do is to read this sort of info .

   


sinsi

A lot of that information is stored in tables in the ROM BIOS but the pointers usually point to memory >1MB, so no real mode.

MichaelW

For an application like this you can just switch to PM, load a selector with a 32-bit limit into an appropriate segment register (probably GS because it's unlikely to be used by the BIOS) then return to RM and access anywhere in address space with a segment override.
Well Microsoft, here's another nice mess you've gotten us into.

FORTRANS

Hi,

   You can search the old forum for boot sector code.  There was
some that used the bios to map the computer's memory.

   The process that MichaelW mentioned is sometimes called unreal
mode, big real mode, or flat real mode if you need to locate code.

HTH,

Steve N.

GoneFishing

Till today I believed there are only three CPU modes:real, protected and virtual real ones.
Thanks to MichaelW and FORTRANS for pointing  at new horizons!

Gunther

Hi vertograd,

Quote from: vertograd on July 04, 2013, 01:44:44 AM
Till today I believed there are only three CPU modes:real, protected and virtual real ones.
Thanks to MichaelW and FORTRANS for pointing  at new horizons!

it's not so new. But you should know that it'll work only under plain DOS; there's no chance to do it under modern OS with DOS emulations.

Gunther
You have to know the facts before you can distort them.

GoneFishing

Quote from: Gunther on July 04, 2013, 06:01:06 AM
Hi vertograd,

Quote from: vertograd on July 04, 2013, 01:44:44 AM
Till today I believed there are only three CPU modes:real, protected and virtual real ones.
Thanks to MichaelW and FORTRANS for pointing  at new horizons!

it's not so new. But you should know that it'll work only under plain DOS; there's no chance to do it under modern OS with DOS emulations.

Gunther

Fortunately I have old box to play with. It'll be a  simple bootable floppy without any OS at all.

Gunther

Hi vertograd,

Quote from: vertograd on July 04, 2013, 09:45:05 PM
Fortunately I have old box to play with. It'll be a  simple bootable floppy without any OS at all.

so, that's the way to go. Good luck.

Gunther
You have to know the facts before you can distort them.

GoneFishing

Thank you, Gunther!
Already digging in the old forum archives.

dedndave

never tried any of this in real mode,
but - the CPU is fairly easy to read - see CPUID
AMD and Intel have a number of related documents

for the other devices, like disk controllers, video cards, etc, you can look into the APIC identifiers

Gunther

Hi vertograd,

I've found an old 16 bit assembly language source for switching under DOS into flat mode. I think it was written 20 years ago for PowerBASIC. If you're interested, I can send it to you via mail. That shows at least the direction to go. Please send me a PM for the details.

Gunther
You have to know the facts before you can distort them.

dedndave

that code may have been written for the 80286
a strange animal - and they played some strange tricks to make it go to protected mode

i seem to recall something like - you set the reset code address, then cause a triple fault - lol

GoneFishing

Quote
i seem to recall something like - you set the reset code address, then cause a triple fault - lol
Hi,Dave!
" ... a triple fault " does sound good  ;)
and thanks for the hint on APIC.