Option ROM on Dell Dimension L533cx

Started by jakent, January 25, 2010, 14:26:30 PM

Previous topic - Next topic

jakent

Hello Elmar

I've been messing around for the last few days attempting to get PLoP bootloader to run correctly on a Dell Dimension L533cx as an option rom.  I am flashing it to the option ROM on a 3c905C-TX-M (64KB).  The goal is to boot this system via USB without help from CD, HD, PXE, or floppy.

PLoP bootloader will boot USB (UHCI) on this system booted via floppy.  I'm investigating an intermittent problem that causes boot to sometimes work and sometimes fail.  I feel that it is unrelated to PLoP, as my root device (flash drive) can also disappear randomly under linux, showing back up as /dev/sdb1.  I'll update when I find out.

While using bios A07 on this board, I actually got plpbtrom to bring up the UI as long as I hit ESC at the BIOS's boot splash.  However, it fails to boot anything.  I've since updated the BIOS on this machine to the latest, A14, and now when plpbtrom get initialized a string of binary data gets dumped to the screen and the system halts.  I've tried using the bootloader's built-in int19h hook on both BIOS versions with no improvement.  I have a feeling the ROM to RAM copy in the header is causing this, overwriting data the BIOS is using for its own incomplete initialization.

I have begain to implement an option ROM header that hooks int19h.  That way the bootloader isn't copied to RAM before int19h is called.  My x86 asm isn't great, so any pointers in the right direction would be appreciated, especially preconditions on the entry point at 2000h:100h.  :)

Thanks!

jakent

Just an update, I swapped out flash drives, and I now have what seems to be reliable USB booting from PLoP on a floppy.  Amusingly, the new flash drive that works is a Chinese freebie.

That just leaves the challenge of getting the option ROM to run.

Elmar

hi,

Quote from: jakent on January 25, 2010, 14:26:30 PM
I have begain to implement an option ROM header that hooks int19h.  That way the bootloader isn't copied to RAM before int19h is called.  My x86 asm isn't great, so any pointers in the right direction would be appreciated, especially preconditions on the entry point at 2000h:100h.  :)

the header simply copies the boot manager to this location.

regards
elmar

jakent

There are no requirements as to the state of any registers upon entry?

Elmar

yes, the rom and the plpbt.bin don't need any initial register values.

jakent

#5
Thank you very much! -- I've got an int19h starting the bootloader in Qemu now.  What exactly happens when you press escape?

I'll be releasing my code when all is said and done. :)

Elmar

the rom version makes a far return
the bin version makes an int 19h

jakent

Great stuff, I can now chain the original int19h, tested with an int18h call.

It is still not running correct on real hardware, so it looks like I need to dig into the POST memory manager specs.

I'm calling it a night, but thanks again Elmar!

jakent

#8
[edited to fix URL after receiving private message asking if I still have the code]

Okay, so I've confirmed that this Dimension L533cx has some strange issue with PLoP boot manager.  gPXE and the 3Com option roms run fine on it.  My code I have ported (AT&T to Intel syntax) and written work great in both Qemu and on a Dell Dimension 4700.

Something seems to go terribly wrong within the boot manager's initialization code.  Everything works great up to that point.  The symptoms are pretty much the same with your option rom loader.  The only thing I seem to have fixed at this point with a new loader is the boot splash, by using PnP BEV or int19.  Floppy still boots the machine fine (I boot it via USB to flash ROM).

Elmar, do you want to diagnose this?  I have ordered a CF->IDE adapter, so its not a big deal.

My working source: https://jeffkent.net/~jkent/code/optrom.asm
Sorry for being GPL2, but as a separate component that does not "link" it should be ok.

Thanks and best regards,
Jeff

Elmar

did you try to configure the rom version to start in textmode and does it hang too?

jakent

I have just tested like so:

plpbt-5.0.8/cfg/plpcfgbt vm=text stm=menu cnt=off dbt=usb stf=off zan=off font=bios usb1=1 int19h=off hotkey=no plpbtrom.bin

And it works with my loader.  Hah.  I guess I was half-expecting Ctrl-ESC to work.  Glad it was something silly I missed.  :)  I tried your header/loader with the same configuration just now, it dumps random ASCII on the screen and halts the boot process.  I went back to my ROM, and pressed ESC, and the boot process continues to the next device successfully, so the stack is kept intact.  Great!

plpbt-5.0.8/cfg/plpcfgbt vm=text stm=hidden cnt=on cntval=1 dbt=usb stf=off zan=off font=bios usb1=1 int19h=off hotkey=no plpbtrom.bin

Also works!  I see GRUB before my LCD even gets sync.  Fabulous.

Thank you very much, and thank you for the extremely useful boot manager! That was too easy. :)

Elmar

fine,
but it does not work with my header, or?
can you make a photo from the random ascii chars?

jakent

Sorry if I was unclear.  No, your header fails on this machine.

firewall:~# plpbt-5.0.8/cfg/plpcfgbt vm=text stm=menu cnt=off dbt=usb stf=off zan=off font=bios usb1=1 int19h=off hotkey=no plpbtrom.bin
data changed

firewall:~# plpbt-5.0.8/rom/plpbtrom -pci -vendorid 10B7 -deviceid 9200 plpbtrom.bin plpbt.rom
plpbt.rom created
firewall:~# dd if=/dev/zero bs=512 count=43 >> plpbt.rom
43+0 records in
43+0 records out
22016 bytes (22 kB) copied, 0.000724249 s, 30.4 MB/s
firewall:~# flashrom-0.9.1/flashrom -p nic3com -w plpbt.rom
flashrom v0.9.1-r710
Found "3COM 3C905C: EtherLink 10/100 PCI (TX)" (10b7:9200, BDF 01:08.0).
Calibrating delay loop... OK.
Found chip "ST M29W512B" (64 KB, Parallel) at physical address 0xffff0000.
===
This flash part has status UNTESTED for operations: PROBE READ ERASE WRITE
Please email a report to flashrom@flashrom.org if any of the above operations
work correctly for you with this flash part. Please include the flashrom
output with the additional -V option for all operations you tested (-V, -rV,
-wV, -EV), and mention which mainboard you tested. Thanks for your help!
===
Flash image seems to be a legacy BIOS. Disabling checks.
Writing flash chip... Programming page: 0000 at address: 0x00000000
COMPLETE.
Verifying flash... VERIFIED.


This is what happens if I have quick boot on (I cannot skip the splash manually in time):


Since USB is selected as the default, I press enter, and the fade stops.  Nothing more happens.  USB is never accessed.  Ctrl-Alt-Del still works.

Now, if I turn quick boot off on the machine, kill the BIOS splash, and interrupt the memory test, this happens:


Sometimes, with a few pc speaker beeps.  It can also start with just a blinking cursor in the upper left.  I tested it like this initially when I began.  This is how I came to the conclusion that the BIOS had not setup everything quite right during option rom init.  This was the reason I decided to hook int19h and BEV, which has now solved my problem.  It also allows changing the boot order in setup, and removes the need to short the address/data lines on the flash chip to force a checksum error in the event something goes wrong.  :)

Hope this helps,
-- Jeff

jakent

Would you like me to help diagnose anything further on this system?

Best regards,
-- Jeff

Elmar

at the moment i have no idea what i can do.