We help IT Professionals succeed at work.

BIOS Programming

syed71
syed71 asked
on
25,008 Views
Last Modified: 2011-08-18
How to compile micro assembly language for BIOS and what assembly compiler do I need?
Comment
Watch Question

Commented:
Still trying, a ? ;) It is good.
Can you please be more specific...?
Usually BIOS (that I don't believe anybody will give you in source) has makefiles for specific compiler.

Author

Commented:
Hi Dimitry,

We meet again. I have already replaced all the boards and CPUs. My company gave up and moved on with e Intel. But, I don’t give up so easily. Anyway, under the influence of my company I have managed to convince my mobo manufactured to release the bios source code to us. Anyway, we had to sign few legal documents (NDA and other docs) to obtain the bios source code. Source code I have received is in micro assembly. I have compiled it using assembler and assembler produced EXE file. But, bios except only BIN file. Now, I don’t know which direction to move….

Googled around for last few days and got nothing about bios compiling.


Need your help.

Commented:
There are 4 (maybe more) compilers that can be used for BIOS compilation.
VC (with MASM), BC (with TASM), Watcom and Nasm...
But again, your specific BIOS vendor has BIOS sources for specific compiler. To ask him is the proper way to do this.
Who is BIOS Vendor ?

Author

Commented:
phoenix bios.

I have tried compiling with MASM and it compiled without any error. Compiled program is an exe. But, I need bin file.

Commented:
BIOS Source tree usually has a lot of files, mostly in C and you need C-compiler as well.
Do you mean they gave you small piece to add to BIOS ? It is one file ?

Author

Commented:
Yap, number of files. Entire bios source code. It has been confirmed that the codes are in micro assembly not C/C++.
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION

Commented:
Download the bios editor from phoenix website. You can try https://forms.phoenix.com/channels/en/forms/ld/eval/default.asp to download the demo copy.

Author

Commented:
Thanks guys, I will try both e file and will post the outcomes here later...
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION

Author

Commented:
hello aib_42, I will try your method too... will update ya soon.

Author

Commented:
I've tried bios editor, bios editor is for OEM PC Builder. So, it has no use to me.
I've tried exe2bin and produced bin format isn't compatible with bios.
tried MASM and NASM. None helped either.

Any other ideas guys?

Commented:
Can you show please the Makefile you have with your BIOS package ?

Author

Commented:
hey guys, sorry for the late reply. Had to settle some family matters.

Anyway, back now and restarting the bios project.

dimitry, I don't have any make file. I'm just using command line...

I using following command

C:\MASM611\BIN>ML.EXE C:\MASM611\BS\p.asm

error and output as follows...

Microsoft (R) Macro Assembler Version 6.11
Copyright (C) Microsoft Corp 1981-1993.  All rights reserved.

C:\MASM611\BIN\p.asm(630): error A2006: undefined symbol : COMPILE_FOR_E0
C:\MASM611\BIN\p.asm(3910): error A2006: undefined symbol : COMPILE_FOR_E0
C:\MASM611\BIN\p.asm(3977): error A2085: instruction or register not accepted in current CPU mode
C:\MASM611\BIN\p.asm(3978): error A2085: instruction or register not accepted in current CPU mode
C:\MASM611\BIN\p.asm(3979): error A2085: instruction or register not accepted in current CPU mode
.
.
.
K8_CPUID(2): Macro Called From C:\MASM611\BIN\p.asm(4288): Main Line Code
.
.


Commented:
Then you need to talk to somebody you got your BIOS code from...
Also ml.exe has a lot of different flags like /AT for tiny model (that later can be converted to BIN by EXE2BIN utility).
However, you need to check how BIOS developers compile it (I mean EXACTLY) because BIOS is sensetive issue - once you will program it and it is wrong - your computer will
be literally dead...

Author

Commented:
Thanks dimitry. Finally manage to make it work with aib_42's and your solution.

Steps as follows....

ML /AT phoenix.asm /link /TINY
EXE2BIN UTIL to convert it.
Finally used universal programmer to upload it to the chip.
Booting the Mobo.....
BOOM... just kidding..
It worked.....
now booting time system displays...

AMD Athlon 64 3400+

But, when we check cpuid using UTIL, it shows AMD Athlon 64 and the vendor is INTEL
..... my application is working fine...
.
.
.

Thank you guys