OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 3:13 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: BIOS + OS for 80186/Am186 System
PostPosted: Sun Jan 07, 2018 11:51 am 
Offline
User avatar

Joined: Wed Nov 02, 2016 2:20 am
Posts: 9
Hi,

I have a SD186ES/EM-Demonstration Board from AMD equipped with an Am186ES, that runs at 40MHz. It is an 80186 compatible chip.

It has 2 serial ports, LEDs and 256kB RAM+256kb Flash onboard.
It uses a monitor program that is located in flash (e86mon).

I tried a lot, and finally I have everything together to write code for this very old board on a recent linux pc (terminal, toolchain, ...).

The monitor has a very limited int21 implementation, but i had to extend it heavily to run simple turbo-c-hello-world programs. I think that DOS-emulation is not what I want.
For modifying the monitor and it's extensions I need a Windows 3.x/9x, DOS, Visual C++, MASM. This leads to a seperate VM only for this job...

The idea is, maybe i could get real (MS) DOS running on this chip.

For easy (partially) PC-compatiblity I want to connect a Winbond ISA Controller (IDE, Floppy, 2x RS232, 1xLPT) as well as a Cirrus or Tseng ISA VGA.

The memory map of the system so far:
RAM:
0x00000 - 0x003FF IVT
0x00400 - 0x0040F Monitor Data (like BDA?, but smaller)
0x00410 - 0x3EFFF ~250k RAM
0x3F000 - 0x3FFFF 4k Stack+Data for Monitor

FLASH:
0xC0000 - 0xFFFFF Flash with Monitor, Space for User Application (managed by monitor)

I have all the stuff to connect more RAM (256k or 512k). The Monitor always uses top 4k of RAM. There are a few programmable chip selects available for the free memory regions.

How could i start making this system PC compatible?

What do i need at least to run DOS 5.0?
Do i need a PIT? Or is a 18.2Hz interrupt, generated by the Am186's timer, enough?
Do i need a KBC or does DOS use BIOS for keyboard?
Do i need a DMA Controller? The Internal one could be cascaded with 8259s, but the IO address would be different.
If i really need some of these components they could be added to bus easily, as this chip already has a demultiplexed bus with up to 12 CS for memory and IO regions.

I want to build a extension board that holds 128kx16 (256kB) Flash, that is switchable between the onboard-flash /CS and a programmable CS. So that i can have a program within the monitor flash, that maps the additional flash to a free area. I write the BIOS image to that flash.
I'll press reset and switch the flash memories. On power-up my BIOS loads and inits the system.

Where should i start when looking for a small generic BIOS?
Where do I find details about porting DOS and requirements for DOS? I read something about MS-DOS OAKs, is this the right direction? I don't want to modify DOS, i want to build everything around, so that unmodified DOS runs...


Top
 Profile  
 
 Post subject: Re: BIOS + OS for 80186/Am186 System
PostPosted: Tue Jan 09, 2018 1:51 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
sdose wrote:
How could i start making this system PC compatible?

Start with the BIOS. You'll be able to get pretty far with just that. Unfortunately, you might have to disable a few of the CPU-internal peripherals to make your BIOS PC-compatible.

sdose wrote:
What do i need at least to run DOS 5.0?

You need a PC-compatible BIOS and... actually, I'm not sure if you need anything else. DOS relies pretty heavily on the BIOS.

sdose wrote:
Where should i start when looking for a small generic BIOS?

I don't think there's a BIOS generic enough to port to your board.

sdose wrote:
Where do I find details about porting DOS and requirements for DOS? I read something about MS-DOS OAKs, is this the right direction? I don't want to modify DOS, i want to build everything around, so that unmodified DOS runs...

The OAKs contain a good chunk of source code, and they should include all of the machine-specific parts so you can see exactly what DOS expects your computer to provide.


Top
 Profile  
 
 Post subject: Re: BIOS + OS for 80186/Am186 System
PostPosted: Wed Jan 17, 2018 11:32 am 
Offline
User avatar

Joined: Wed Nov 02, 2016 2:20 am
Posts: 9
Working on a BIOS is much harder than i thought... Everytime I solve a problem, I run into the next.

Most headache makes the monitor, that resides there, where a BIOS usually is located.
The internal Chip-Selects are not that smart enough, that i can switch between 2 flash-chips in software.
I'm still not sure what to do - locating my bios at C0000 and let the monitor start it OR having some (discrete) logic, that switches flash-chips.

A BIOS started by this monitor could be very helpful, it features a nice debugger and all the stuff I need to work with this board. On the other side i have concerns about compatiblity...

For now i have 512k SRAM from 0x00000 to 0x7FFFF and I am working on "bare bones" for NASM and C (bcc/dev86). bcc is able to produce code, that has first argument always in AX, not on stack. This could be useful for implementing interrupts in C.
I still have to do this flash-stuff, but I got stuck because of the not-so-flexible CS-implementation on this MCU. I have a lot of AM29F010, two of them would give me 128kx16. Perfect for BIOS...

I found that datalight provided an embedded x86 bios that is highly configurable. But i couldn't find any sources or else.
I also found a XT-ROM with MS-DOS 3.31 on the net, but not had a look at it.

I read this: http://www.drdos.net/documentation/romhtml/romch1.htm
It is about making a DR-DOS rom. I found a few DR-DOS releases on the internet, but not contain any of the stuff needed for this job and listed in the manual.
I assume, there was a seperate development-package or something similar....
Maybe someone could tell me more about this?


Top
 Profile  
 
 Post subject: Re: BIOS + OS for 80186/Am186 System
PostPosted: Wed Jan 17, 2018 12:20 pm 
Offline
User avatar

Joined: Wed Nov 02, 2016 2:20 am
Posts: 9
I forgot about the OAKs. I found some of these and it is quite a lot of useful information.


Top
 Profile  
 
 Post subject: Re: BIOS + OS for 80186/Am186 System
PostPosted: Sun Jan 20, 2019 5:15 pm 
Offline

Joined: Sun Jan 20, 2019 5:05 pm
Posts: 4
Hi, sdose I hope you are still around the forum.
I have a very nice board from a dlink router that is based on the Am186ED cpu, more info here:
https://wikidevi.com/wiki/D-Link_DI-713P_rev_A1
Anyway while trying to upgrade its firmware I managed to brick it, and now I have a dead board.
I notice on your first post your reference to E86MON which I guess is the bootloader OS for this particular CPU, I was wondering if you'll be kind enough to provide a copy of the rom from your board, as I have searched the web for days now to no avail, I would like to be able to run other programs on this board or restore it to its original firmware as I like to collect old routers for fun.

Thank you so much

Luis


Top
 Profile  
 
 Post subject: Re: BIOS + OS for 80186/Am186 System
PostPosted: Mon Jan 21, 2019 8:19 am 
Offline
Member
Member
User avatar

Joined: Mon Jan 15, 2018 2:27 pm
Posts: 201
Check Zet processor project (https://github.com/marmolejo/zet). It's 80186 CPU implementation in FPGA. It has its own BIOS implementation and since it runs on FPGA, it could probably run on real 80186 based machine (maybe with some modifications) as well.


Top
 Profile  
 
 Post subject: Re: BIOS + OS for 80186/Am186 System
PostPosted: Mon Jan 21, 2019 12:27 pm 
Offline

Joined: Sun Jan 20, 2019 5:05 pm
Posts: 4
Thanks pvc very much for the link, very nice project however looks to me to be oriented toward full blown PC or at least boards with VGA out and my board only has serial human interface which is what E86mon does.
Any more ideas are welcome

Regards
Luis


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 66 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group