Re: maybe a bit OT: EEPROMs and PCs
- From: Jure Sah <jure.sah@xxxxxxxxxxxxxx>
- Date: Fri, 12 Aug 2005 03:34:03 +0200
Hello,
wolfgang kern wrote:
No OT anyway,
ROM-BIOS are mainly written in pure bare-metal ASM,
even I've seen a few HLL crap routines (push ebp |mov ebp,esp..) also in there.
What exactly does "bare-metal ASM" mean? Plain any ASM or some special ASM considered "bare-metal"?
| 1. I'll need hardware to access the data in the EEPROMs. I got an old | HW-9007 ISA RAM-EEPROM card with supporting programs, so I could write | to the EEPROMs using that, but I'd preffer to buy myself something more | for the purpose (I have yet to sucessfully align the EEPROM legs to | insert one into that old thing). How cheap can I get what I need?
There may be some old Eprom-burners available on Ebay (spell: Ipay).
I see... but what exactly am I looking for? "EPROM burner" as quoted or is there any other particular way this industry calls the simplest devices capable of recording binaries to EEPROMs? I came accross "EPROM eraser" that was evidently capable of burning binaries while looking.
| 2. I got the i386 computer with it's BIOS in two 128 kb EEPROMs (meaning | lots of room and x86 assembly). My assembler makes .com files, to write | to EEPROM I'll need properly alligned bits in raw .bin files.
| How exactly is the EEPROM being fed into the CPU on PC bootup?
The opposite direction: after power-up/reset the CPU is fed with the BIOS-code :)
start point is a 16-bit far jump at FFFF:0000 (=F000:FFF0)
Ahh, so would it be wise to set the starting address for the entire program at that offset (org), or just convince my assembler to put a jump back to the usual COM starting offset (100h) at that exact position?
| Can I use a normal assembler to make the binaries I can burn directly?
What would you consider as normal ?
Every assembler which can create mixed binary code (16/32 bit) and allow ORG up to FFFF:0000/0fffffff0 can be used.
So even I got my own tools (HEX_WORK85/KESYS/PAL-PROM-burner) I see FASM, NASM, and for 16 bit only ye olde TASM and the original MASM as opportunities.
Well I use NewBasic Assembler (the diffirences between them aren't That Big, I easily could use another, but I chose that one). Will that one be suitable?
| What do I have to do to make that work right?
Learn all about your hardware by fully disassembling the original BIOS-ROM.
That is what I also had in mind. Thanks.
| 3. Where can I find any hints on how not to screw up?
I'm afraid 'Nowhere', except for the few clerics on 'nowhere.@nevernet' may have a few answers to your questions :)
Well I heard before that if you missprogram an EEPROM it may become unerasable or generally useless. EEPROMs aren't that expensive, but then again, I don't want to break every single one I get. What is the thing I must not do? What's the trick?
Also, I was meaning to ask: In usual PC ASM programming I used that IRQ refference provided by Ralf Brown. How do I know which of those calls are actually provided by the non-BIOS PC components? Is everything sensible like: if an IRQ belongs to VIDEO aka VGA, then I can freely call that IRQ in the BIOS code itself? etc?
| I suppose IBM never made a document on how to write BIOSes and give | it around on the internet freely.
You wont find any documented BIOS standard, it just doesn't exist.
Every motherboard got it's very own features/weak points and design. By any luck you might get a BIOS-source code from the MB-producer,
but I heavy doubt this as any useful information.
Yes dissasembly should do. Nontheless even if there aren't any particular standards, some of the hardware is simmilar anyhow. For example very many modern network cards use the same chip and I expect something simmilar with RS232 ports. Anyhow I do have two identical old computers I intend to work with.
| 4. Obviously I'll have to know the internals of some peripherial | hardware (e.g.: NICs). Any hints on where to find that sort of info? I | guess reading chip manufacturer specs will have to do for most things, | but where (or how ;) do I get things such as base addresses and such?
Yes, you need to know all about the hardware you like to use.
RBIL will be your best friend here (bits/ports/BIOS-interrupts)
RBIL = Ralph Brown's Interrupt List?
| I realize all this may be a bit complex, but I think I can do it when | it's just me and the I/Os (no workarounds to worry about).
Not that complex if you think about small changes only. I just modified my existing BIOS-ROMs with a few add-ons and kept the rest as it is. There is usually plenty of unused space at E000:0000 ...
I was intending to remove all the bits that I will not need to make room for any programming I wish to add (I will only be using NICs / RS232 ports / graphics card / Beeper / maybe keyboard, other things such as any disk access or PnP might as well not be there).
By the way, what dissasembler do you recomend? Will it be safe to dissasemble / update / reassemble the BIOS without breaking it (provided that none of the modifications were harmfull)? I have tried multiple dissasemblers and it appears many of them produce output that can't really be assembled again, but serves more an educational purpose. I may just have had bad luck at picking.
your questions are welcome here... __ wolfgang
Nice one, thanks.
There should be an ASM Wiki. =P
-- Model: INFJ Primary function: Coprocessor Secondary function: Cluster commander
Yes I'm a therian: http://www.wikitherian.org
Creationism & Darwin: "The bible says humans were supposed to use animals to do work for them and I like to work so I must be an animal!" .
- Follow-Ups:
- Re: maybe a bit OT: EEPROMs and PCs
- From: wolfgang kern
- Re: maybe a bit OT: EEPROMs and PCs
- References:
- maybe a bit OT: EEPROMs and PCs
- From: Jure Sah
- Re: maybe a bit OT: EEPROMs and PCs
- From: wolfgang kern
- maybe a bit OT: EEPROMs and PCs
- Prev by Date: Re: Best Way to Create String Variables in Assembly
- Next by Date: Re: public domain
- Previous by thread: Re: maybe a bit OT: EEPROMs and PCs
- Next by thread: Re: maybe a bit OT: EEPROMs and PCs
- Index(es):
Relevant Pages
|