You are viewing olivermcfadden

Previous Entry | Next Entry

Radeon AtomBIOS Hacking...

I've been thinking about doing some reverse engineering of AtomBIOS, the BIOS
used on newer Radeon cards; R500, R600, etc. Ultimately I'd like to create a
free software (GPL) replacement BIOS for at least one Radeon card... Please
refrain from comments regarding my sanity. :-)

As far as I know, AtomBIOS is a modular BIOS consisting of initialization
code, an AtomBIOS script interpreter, AtomBIOS scripts, and some data tables.
Having access to the AtomBIOS parser code should be helpful, although I
suspect there are some sections that AMD have intentionally omitted...

I expect that I would have to build a flash memory programmer that could be
connected to the card for reading/writing/verifying the flash memory. It's
likely that the flash can be programmed via the GPIO registers, but one
mistake means a bricked card; a flash programmer should, in theory, be a
somewhat safer method.

Oh, if anyone knows the part number of the flash memory used on any Radeon
card, post a comment. It's neigh on impossible to find this information
online... I guess I'll have to look at some of my Radeon cards.

Comments

( 18 comments — Leave a comment )
daeken_eulogy
Oct. 23rd, 2007 12:51 am (UTC)
Wow, that actually sounds like a fun project (re: creating a free software BIOS) -- if you ever work on that and are looking for any help, I'd love to help out. Oh, and no reason for me to question your sanity, as I decided to write BIOS code to cure boredom last week ;)
(Anonymous)
Oct. 23rd, 2007 08:24 am (UTC)
Free your BIOS :)
>comments regarding my sanity. :-)
Great project to kill some time & boredom. Totaly sane for sure. ;)
Surely, atomB & r500+ limit the effort somewhat: you'd get much more interrested users :) for r400 and below, i guess.

Did you contact LinuxBIOS project? They might be not that interested in "full-featured" re-implrmentation of prop.technology, but they have that flashrom tool (natural choice for _vga_ bios flasher funcionality integration to me, and they just started to imlpement SPI parts flashing), plenty of rev.-engeering experts at one place (some of them undoubtfully have much to say WRT vga BIOS-es |-) ).

Free-VGA-BIOS, someone?

Luc Verhaegen made BIOS-less :)) X driver for VIA / Unichrome vga and booted that on a device w/LinuxBIOS... Best vga BIOS -- no vga BIOS, in the end?
olivermcfadden
Oct. 23rd, 2007 10:23 am (UTC)
Re: Free your BIOS :)
I haven't contacted the LinuxBIOS project yet; this is just a side project which
I may look at developing... Although if the LinuxBIOS project is
developing tools for flashing the BIOS on graphics cards, that would certainly
be useful.

I'm not completely sure what happens when you power up a system with a graphics
card that has a bad BIOS. I would need a hardware flash programmer if the system
BIOS decides to be "helpful" and halt at POST... Otherwise it could likely be
recovered by software flashing.
(Anonymous)
Oct. 23rd, 2007 11:41 am (UTC)
Re: Free your BIOS :)
Although if the LinuxBIOS project is developing tools for flashing the BIOS on graphics cards, that would certainly be useful.
They do detect and flash chips connected to the motherboard chipset (southbridge? superio?), there's no code for video card re-flashing. Yet? I guess, this could be as easy as pointing an existing code to some other i/o port or memory range or as "entertaining" as any other reverse engineering effort, who knows... If you intend to write a flashing util for video card, flashrom could be a good start and a good project to contribute. If you're not -- vendor flash util should do.
I'm not completely sure what happens when you power up a system with a graphics card that has a bad BIOS.
You get a blank screen? %-) And some beeps, hangs, reboots may follow. Or you get a paperweight and а need for...
I would need a hardware flash programmer
Or you use a serial console (linuxbios folks do that. lacking free video bios :) maybe?) to reflash (if you convince main bios not to run that "bad" one)...
Or you plug in 2nd video and hope it will run as the video card when rebooted and "vendor" flash util will "see" 1st ("bad") card to re-flash it...
Or you "just" :) run a "fallback" firmware after reboot (like linuxbios folks do. or do they?)...
Or... :))

More fun any minute? ;-) Just my musings, no actual experience though, sorry.
(Anonymous)
Dec. 7th, 2007 04:55 pm (UTC)
Re: Free your BIOS :)
Hi!

I'm one of the LinuxBIOS developers, so I'm probably qualified to answer these questions. We have code to check the signature of option ROMs (e.g. Video BIOS) and (depending on the configuration) can skip execution if the signature is not there (as would probably be the case if flashing failed). You're of course free to disable execution of option ROMs unconditionally if you want.

Feel free to either join our mailing list http://linuxbios.org/mailman/listinfo/linuxbios or drop by in #linuxbios on freenode (which is an alias to #openbios).

Regards,
Carl-Daniel Hailfinger
(Anonymous)
Nov. 21st, 2007 07:06 pm (UTC)
Bad card
> I'm not completely sure what happens when you power up a system with a graphics card that has a bad BIOS

If the card is configured as secondary and there's a nother card in the system : Pretty much nothing peculiar happens. Modern BIOS only boot the BIOS of the first card and rely on the OS for subsequent initialisation of the secondary card.

You could, say, plug a last-gen PCIe card that you want to hack, plug some old PCI card for backup, and configure the BIOS to boot on that card first.
If you brick your card, only the second head of your dual setup will open, but you'll still be able to recover the card from there.

(Not I happen to have an old AGP+PCI dual card setup, with a half-fried AGP card).
(Anonymous)
Nov. 21st, 2007 07:07 pm (UTC)
Re: Bad card
Sorry, forgot to sign :
- DrYak -
wendyfidaz
Jul. 17th, 2008 02:08 pm (UTC)
The SCSI was the built-in card on Itanium systems (not sure which one right now, system is down). I tried several 2.
(Anonymous)
Oct. 23rd, 2007 09:14 am (UTC)
Yes and no
Yes, it would be interesting to have some some insights in the AtomBIOS.
This would help to make ATI cards work on some more hardware platforms.

For me a special interesting point would be: Can we support the card without
the AtomBIOS? I own an MacBookPro and it would be interesting to know if
I can boot Linux directly via EFI (probably without using AtomBIOS?)...

But I'm not sure, if it's worth the time to implement a complete replacement,
because it would be very time consuming until you finished it and in the
meantime AMD replaced it together with some new hardware...

olivermcfadden
Oct. 23rd, 2007 10:15 am (UTC)
Re: Yes and no
I think that AtomBIOS will be around for quite some time; AtomBIOS is AMD/ATI's
replacement for the legacy BIOS, which is a blob of x86 code unique to every
card.

As far as I know, AtomBIOS uses a simple assembly language (AtomBIOS scripts) to
perform most of the work; the interpreter just executes these scripts. The
scripts may differ from card to card, but all cards could share the same generic
interpreter code.

In fact, there are a few clues suggesting the AtomBIOS parser which was released
by AMD may also be used by the BIOS...

#if (PARSER_TYPE!=DRIVER_TYPE_PARSER)
              BIOS_STACK_MODIFIER();
#endif


Currently I'm just guessing and haven't looked deeply into the AtomBIOS yet, but
it's quite interesting...
(Anonymous)
Oct. 23rd, 2007 02:42 pm (UTC)
doesn't really matter what bios you use
It doesn't really have to be the ATOM bios. there's enough info around to write your own bios for most ati cards. The problem is, with both ATOM and the legacy bios, the clock/ram/connector setup is very oem specific.
olivermcfadden
Oct. 23rd, 2007 11:24 pm (UTC)
Re: doesn't really matter what bios you use
Yes, the connectors are OEM specific, but AtomBIOS provides standard structures
for connector information, and the parser in xf86-driver-radeonhd can parse
them...

I don't think the connectors would be too much of a problem, although
xf86-driver-radeonhd may have some slight work arounds, but I think generally,
it's pretty good.

I would be staying compatible with the proprietary BIOS, obviously. It's too
much to ask for the drivers to support two completely different BIOS's.
(Anonymous)
Oct. 23rd, 2007 04:29 pm (UTC)
OpenFirmware
1. Figure out what initialisation it performs.

2. The most useful thing you could do is replace it with some OpenFirmware FCode doing the same.

I don't know how you'd also get vga character tables etc. working at the same time. But then again, we've got to move to legacy-free PCs at some point. And if you're looking at reverse engineering it for use on non-x86 systems, vga compatibility won't be an issue anyway.

Difficult but probably fun & satisfying.
(Anonymous)
Oct. 23rd, 2007 07:19 pm (UTC)
This would be very useful for us on non-x86 platforms. I've been trying to get standard PCI video cards on MIPS machines. While the drivers exist in Linux and other OSes, POSTing the cards is very difficult as the graphics card's BIOS relies on PC BIOS and low-level assembly support which does not exist on other platforms. While the Open graphics project is one way to get better graphics on non-x86 platforms, open alternatives for ATI (or any other graphics card) would also be very welcome.
olivermcfadden
Oct. 24th, 2007 03:52 am (UTC)
I got linked to some information on replacing the 64K ROM on a Radeon 7000 PCI
card with a 128K version to support the larger Mac BIOS. This page confirms the
ROM is Serial Flash Memory using the SPI interface.

Although I haven't completely read the datasheet linked on the page, it should
be a lot easier to program the SPI flash than the much larger parallel flash; it
would also be easier to (de-)solder when something goes wrong...

It might be possible to build something similar to the RD1 BIOS Saviour but for
SPI flash memory... Anyone got any ideas? I really do need to get more into
electronics design...
(Anonymous)
Dec. 7th, 2007 04:50 pm (UTC)
BIOS saviour for SPI flash memory
Hi Oliver,

I'm one of the LinuxBIOS developers. Some of our project members are developing a BIOS-Saviour-like tool for SPI flash. It's called FLASH-PLAICE. We recently have been notified about another project similar to the FLASH-PLAICE that may be useful as well.

I have written the (Super I/O translation chip based) SPI flashing code in flashrom (our BIOS flashing tool) and am interested in adding SPI support for more chipsets, regardless of which card the SPI chips live on.

Join our mailing list and ask away... http://linuxbios.org/mailman/listinfo/linuxbios

Regards,
Carl-Daniel Hailfinger
(Anonymous)
Oct. 29th, 2007 12:54 pm (UTC)
good luck!
I hope one day I can remove ati's crap from my x1300 flash and replace it with proper bios.
Btw, I think projects like Boschs might benefit from this as well.
Wish you the very best Oliver.
(Anonymous)
Apr. 5th, 2009 01:40 pm (UTC)
AMD released some OpenSource Specs
http://www.phoronix.com/scan.php?page=article&item=amd_r600_oss_3d&num=1

I dont have exact link to the stuff discussed there, but, maybe it helps you ati users, nvidia pwns!
( 18 comments — Leave a comment )

Profile

olivermcfadden
Oliver McFadden

Latest Month

October 2010
S M T W T F S
     12
3456789
10111213141516
17181920212223
24252627282930
31      
Powered by LiveJournal.com
Designed by Tiffany Chow