Author Topic: Port I/O  (Read 5714 times)

GoneFishing

  • Member
  • ****
  • Posts: 965
  • Gone fishing
Port I/O
« on: July 03, 2013, 01:18:18 AM »
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

  • Global Moderator
  • Member
  • *****
  • Posts: 1209
Re: Port I/O
« Reply #1 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?
Well Microsoft, here’s another nice mess you’ve gotten us into.

GoneFishing

  • Member
  • ****
  • Posts: 965
  • Gone fishing
Re: Port I/O
« Reply #2 on: July 03, 2013, 07:02:40 PM »
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

  • Member
  • *****
  • Posts: 1004
Re: Port I/O
« Reply #3 on: July 03, 2013, 07:43:32 PM »
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.
I can walk on water but stagger on beer.

MichaelW

  • Global Moderator
  • Member
  • *****
  • Posts: 1209
Re: Port I/O
« Reply #4 on: July 03, 2013, 09:14:28 PM »
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

  • Member
  • ****
  • Posts: 946
Re: Port I/O
« Reply #5 on: July 03, 2013, 11:26:05 PM »
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

  • Member
  • ****
  • Posts: 965
  • Gone fishing
Re: Port I/O
« Reply #6 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!

Gunther

  • Member
  • *****
  • Posts: 3517
  • Forgive your enemies, but never forget their names
Re: Port I/O
« Reply #7 on: July 04, 2013, 06:01:06 AM »
Hi vertograd,

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
Get your facts first, and then you can distort them.

GoneFishing

  • Member
  • ****
  • Posts: 965
  • Gone fishing
Re: Port I/O
« Reply #8 on: July 04, 2013, 09:45:05 PM »
Hi vertograd,

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

  • Member
  • *****
  • Posts: 3517
  • Forgive your enemies, but never forget their names
Re: Port I/O
« Reply #9 on: July 04, 2013, 11:30:31 PM »
Hi vertograd,

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
Get your facts first, and then you can distort them.

GoneFishing

  • Member
  • ****
  • Posts: 965
  • Gone fishing
Re: Port I/O
« Reply #10 on: July 05, 2013, 01:01:29 AM »
Thank you, Gunther!
Already digging in the old forum archives.

dedndave

  • Member
  • *****
  • Posts: 8749
  • Still using Abacus 2.0
    • DednDave
Re: Port I/O
« Reply #11 on: July 05, 2013, 01:07:10 AM »
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

  • Member
  • *****
  • Posts: 3517
  • Forgive your enemies, but never forget their names
Re: Port I/O
« Reply #12 on: July 05, 2013, 05:02:56 AM »
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
Get your facts first, and then you can distort them.

dedndave

  • Member
  • *****
  • Posts: 8749
  • Still using Abacus 2.0
    • DednDave
Re: Port I/O
« Reply #13 on: July 05, 2013, 01:09:07 PM »
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

  • Member
  • ****
  • Posts: 965
  • Gone fishing
Re: Port I/O
« Reply #14 on: July 05, 2013, 05:40:16 PM »
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.