flat assembler
Message board for the users of flat assembler.

Index > OS Construction > Disassembling a BIOS

Author
Thread Post new topic Reply to topic
microkernel



Joined: 10 Jun 2004
Posts: 5
Location: Australia
microkernel
Does anyone know of a decent disassembler that outputs sane code so I can disassemble my BIOS? Can I directly disassemble one of the downloadable BIOS images from motherboard manufacturer's websites or are they compressed/mangled?

I'd really like to know how a BIOS works... would be nice to have a completely free open source BIOS to replace horrid Award, Phoenix and AMI BIOSes...
Post 10 Jun 2004, 12:44
View user's profile Send private message Reply with quote
ntrf



Joined: 01 Jun 2004
Posts: 9
Location: Belgorod,Russia
ntrf
when I disasmed WinME bootsector (2 KB) i tryed to read it
for 3 weaks Exclamation

You crazy Confused
Post 10 Jun 2004, 13:08
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
IDA... IDA IDA IDA, only choice.

But it's going to be an insane amount of work - BIOSes are usually compressed, so you'll have to decompress it by hand (or, more sane, write tools to do it). The code is going to be tricky and chipset-dependent, and there's going to be a *lot* of code - a compressed BIOS image of 512kb, how much code/data do you think that is unpacked? Wink

As for
Quote:

would be nice to have a completely free open source BIOS to replace horrid Award, Phoenix and AMI BIOSes...

...you're not going to get that by disassembling+reimplementing an existing BIOS - that would be quite a (copyright, perhaps?) violation. What's horrid about the existing BIOSes anyway, they're nice and easy to use?

There's some people working on their own BIOSes, like http://www.linuxbios.org/ - which isn't exactly what you want. Thing is, writing "your own BIOS", a complete and fully working replacement, just isn't going to happen... chipset initialization, MTRR programming, etc etc etc.
Post 10 Jun 2004, 14:07
View user's profile Send private message Visit poster's website Reply with quote
Ralph



Joined: 04 Oct 2003
Posts: 86
Ralph
What kind of bios to you have? If it's award, there are utilities available that will extract the bios code from the compressed image (LZH compressed if I remember correctly, and it includes things like microcode patches, logo image, etc). Try googling for cbrom.exe.
There is also modbin which lets you tweak a bios image before flashing so you can for example change strings and oher settings.
I have used both and successfully flashed my bios with changes, so they seem to work fine, at least for me.

By the way, if you want to work on your own bios, bochs will be handy for that as it lets you specify your own image file to be used as a bios. I've done this before to boot a simple proof-of-concept "OS". Check the intel manuals for initial CPU state info. You can also get a dual-bios motherboard which might make testing a custom bios on real hardware more feasable.
Post 10 Jun 2004, 21:24
View user's profile Send private message Reply with quote
microkernel



Joined: 10 Jun 2004
Posts: 5
Location: Australia
microkernel
Quote:

...you're not going to get that by disassembling+reimplementing an existing BIOS - that would be quite a (copyright, perhaps?) violation. What's horrid about the existing BIOSes anyway, they're nice and easy to use?


I seriously doubt it's a violation of anything, and besides, I couldn't care less. What's horrid about them is that they are proprietary and closed source. What's more, Phoenix is planning for so-called "Trusted Computing" in all future BIOSes, and Phoenix owns Award at least. How many BIOS vendors are there for PCs? How can you compete or have a *choice* if they keep hardware specs secret and pass them around to each other in order to lock out competition and keep themselves in business? If that isn't an illegal monopoly or cartel, tell me what is. If you don't grok that, I can't help you any further.

Quote:

Thing is, writing "your own BIOS", a complete and fully working replacement, just isn't going to happen...


Hmm, we'll see about that. When I disassemble and make changes, it will happen whether they like it or not.
Post 11 Jun 2004, 02:24
View user's profile Send private message Reply with quote
microkernel



Joined: 10 Jun 2004
Posts: 5
Location: Australia
microkernel
Ralph wrote:
What kind of bios to you have? If it's award, there are utilities available that will extract the bios code from the compressed image (LZH compressed if I remember correctly, and it includes things like microcode patches, logo image, etc). Try googling for cbrom.exe.

<snip>

You can also get a dual-bios motherboard which might make testing a custom bios on real hardware more feasable.


Thanks for the tips!!!
Post 11 Jun 2004, 02:25
View user's profile Send private message Reply with quote
microkernel



Joined: 10 Jun 2004
Posts: 5
Location: Australia
microkernel
ntrf wrote:
when I disasmed WinME bootsector (2 KB) i tryed to read it
for 3 weaks Exclamation

You crazy Confused


I've used NASM's disassembler so far, and I've found the code that looks for 0x55AA and attempts to load an image. I've also found nonsense and headers describing a compressed image. So far so good. I'll stick at it and eventually I'll have something. I don't care if it takes me a year. The principles will be the same regardless of chipset, and most chipsets in a family of chipsets work identically, so there won't need to be a completely new BIOS per chipset.

Besides, I get a warm fuzzy feeling while doing this... I rather enjoy it... I MUST be stark raving mad/crazy/insane... the more the BIOS vendors try to shut me out the more I'm determined to have them for breakfast one day.
Post 11 Jun 2004, 02:30
View user's profile Send private message Reply with quote
Ralph



Joined: 04 Oct 2003
Posts: 86
Ralph
Use IDA. It's quite simply the most powerful disassembler you can get, and it happens to be free. I had no problems disassembling, editing and reassembling my bios with it.
Post 11 Jun 2004, 04:31
View user's profile Send private message Reply with quote
microkernel



Joined: 10 Jun 2004
Posts: 5
Location: Australia
microkernel
Ralph wrote:
Use IDA. It's quite simply the most powerful disassembler you can get, and it happens to be free. I had no problems disassembling, editing and reassembling my bios with it.


Thanks Ralph. There seems to be two IDAs... IDA Pro and IDA something or other. I assume you mean IDA Pro which is quite expensive and only available for Windows it seems. I don't use Windows, so I can't make any use of it. Pity - would be nice to have such a capable tool for Linux.
Post 11 Jun 2004, 04:50
View user's profile Send private message Reply with quote
Ralph



Joined: 04 Oct 2003
Posts: 86
Ralph
Yah it's for windows only. Get windows. :)
For reverse engineering and the like, windows just has better tools. IDA is just one among many. The closest to it I have ever used on Unix would be htedit (hte.sf.net), which is also available for windows. It's an excellent tool but it can't touch IDA.
Post 11 Jun 2004, 06:20
View user's profile Send private message Reply with quote
ntrf



Joined: 01 Jun 2004
Posts: 9
Location: Belgorod,Russia
ntrf
IDA is to hevy for it Exclamation Use something light
Post 11 Jun 2004, 14:46
View user's profile Send private message Reply with quote
neonz



Joined: 02 Aug 2003
Posts: 62
Location: Latvia
neonz
If you simply want to understand how BIOS works, I suggest you to study following code. It is disassembly of XT BIOS (from OSRC).


Description: This is the source code for an IBM-PC/xt compatible 10 mhz motherboard. It shows some interesting things about the (primitive) hardware and how to interface with it. It seems that Ya`akov Miles disassembled the code and commented it... he remarks that he
Download
Filename: bios-asm.zip
Filesize: 36.39 KB
Downloaded: 468 Time(s)

Post 11 Jun 2004, 14:54
View user's profile Send private message Visit poster's website Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
Quote:

I seriously doubt it's a violation of anything, and besides, I couldn't care less.


I'm not a lawyer and I know nothing about Australian laws, but in most countries doing what you want to do would be illegal... disassembling is basically okay when you have to do it to gain interoperability, but basing your own work off a disassembly is a no-go. And if you "open-source" and spread it, it could have some pretty nasty legal consequences, award is big enough that you don't want to mess with them - and I do think they care about their code Wink

Quote:

What's horrid about them is that they are proprietary and closed source.


Ah yes, everything must be opensource Rolling Eyes. If you want the specs necessary to build a BIOS, you can just cash out, and get it from the various vendors - if you don't like this, I suggest you move to some socialist country Wink. I'm not a fan of trusted computing, though - it's a good thing for banks, governmental agencies and other places where you need the security, but I don't like the idea of it in home computers.

DataRescue is in the process of making an IDA version for linux, btw - no GUI yet, only turbo vision based textmode interface, but it's coming along. Until that's ready, you ought to grab a copy of the freeware IDA version, and run it under w(h)ine, there just aren't any disassemblers that can compete with it. And as for the price, IDA is *not* expensive, considering it's great power, and the limited market.
Post 11 Jun 2004, 18:15
View user's profile Send private message Visit poster's website Reply with quote
Andrew Youll



Joined: 19 Sep 2004
Posts: 20
Andrew Youll
looks like topics been dead for a while but anyways:

1) dis-assembling the BIOS is illegal as it breaks the BIOS licence and Copyright laws.
2) in the EU its legal to CLEAN ROOM reverse engineer something if something has a monopoly unless its licence states otherwise, not sure about Australia but in USA Reverse engineering is illegal.
3) any code you get will be in violation of international copyright laws.

and finally if you get caught you will most likely end up in jail longer than a murderer would in most countries.
Post 19 Sep 2004, 13:19
View user's profile Send private message Visit poster's website Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1171
Location: Overflow
Matrix
Andrew Youll wrote:
looks like topics been dead for a while but anyways:

1) dis-assembling the BIOS is illegal as it breaks the BIOS licence and Copyright laws.
2) in the EU its legal to CLEAN ROOM reverse engineer something if something has a monopoly unless its licence states otherwise, not sure about Australia but in USA Reverse engineering is illegal.
3) any code you get will be in violation of international copyright laws.

and finally if you get caught you will most likely end up in jail longer than a murderer would in most countries.


This is crazy.
Why can't i disassemble my bios in my computer?
ii have payed for it.
and what do you say, when you have a bug in your bios and there is no upgrade for it, or the upgrade costs more than your computer?
And what do you say on that that the ones who made your bios was directly putting errors into your bios, so when for example there will be larger capacity disks like 30GB it won't function properly. then you will have to buy a new bios.

MATRIX
Post 19 Sep 2004, 13:52
View user's profile Send private message Visit poster's website Reply with quote
ASHLEY4



Joined: 28 Apr 2004
Posts: 376
Location: UK
ASHLEY4
There is a free bios http://www.linuxbios.org/
Also there are 100 of asm bios code's, all over the net so Y decompile ?.

\\\\||////
(@@)
ASHLEY4.
Post 19 Sep 2004, 13:53
View user's profile Send private message Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1171
Location: Overflow
Matrix
microkernel wrote:
Does anyone know of a decent disassembler that outputs sane code so I can disassemble my BIOS? Can I directly disassemble one of the downloadable BIOS images from motherboard manufacturer's websites or are they compressed/mangled?

I'd really like to know how a BIOS works... would be nice to have a completely free open source BIOS to replace horrid Award, Phoenix and AMI BIOSes...


You won't have easy work cause' bioses are usually compressed, and are written in 1-2Mbit Flash chips, for example my chip is W29C020-12, which you can read/write with your motherboard, and also with a flasher equipment. older ones had UV eraseable chps like in 386, you can easily identify those, there is a little window on the top of the chip, usually covered with some sticker to prevent unwanted erases. These UV eproms can be erased with for example an 500W quartz lamp for 8 minutes, then you can write it with an external programmer.


MATRIX
Post 19 Sep 2004, 14:15
View user's profile Send private message Visit poster's website Reply with quote
crc



Joined: 21 Jun 2003
Posts: 637
Location: Penndel, PA [USA]
crc
Quote:
This is crazy.
Why can't i disassemble my bios in my computer?
ii have payed for it.


No you didn't. With software (even a BIOS), you don't own the software unless you wrote it. Otherwise you just have whatever permissions are granted to you by the owner. I doubt that anyone will care if you disassemble/modify the BIOS in your PC, unless you share it with others. Of course I am not a lawyer so I could be wrong.
Post 19 Sep 2004, 18:33
View user's profile Send private message Visit poster's website Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1171
Location: Overflow
Matrix
There is only one thing that you might never be able to modify/read/disassemble/crack:

microcontrollers have internal code/memory/data protections which prevent their contents to be read if it is locked.

in this case, you have to write your own software which does the same as the one you want to crack/modify in any way.

MATRIX
Post 19 Sep 2004, 18:50
View user's profile Send private message Visit poster's website Reply with quote
Dragontamer



Joined: 24 Aug 2003
Posts: 84
Dragontamer
Matrix wrote:
Andrew Youll wrote:
looks like topics been dead for a while but anyways:

1) dis-assembling the BIOS is illegal as it breaks the BIOS licence and Copyright laws.
2) in the EU its legal to CLEAN ROOM reverse engineer something if something has a monopoly unless its licence states otherwise, not sure about Australia but in USA Reverse engineering is illegal.
3) any code you get will be in violation of international copyright laws.

and finally if you get caught you will most likely end up in jail longer than a murderer would in most countries.


This is crazy.
Why can't i disassemble my bios in my computer?
ii have payed for it.


By paying for it, you agree with the licence. Don't pay for it if you don't like the licence.

Quote:

and what do you say, when you have a bug in your bios and there is no upgrade for it, or the upgrade costs more than your computer?
And what do you say on that that the ones who made your bios was directly putting errors into your bios, so when for example there will be larger capacity disks like 30GB it won't function properly. then you will have to buy a new bios.

MATRIX


That is the reason for the open source movement.
Post 19 Sep 2004, 20:00
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
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 vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.