Author Topic: Option ROM on Dell Dimension L533cx  (Read 16694 times)

jakent

  • Newbie
  • *
  • Posts: 9
Option ROM on Dell Dimension L533cx
« on: January 25, 2010, 14:26:30 PM »
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

  • Newbie
  • *
  • Posts: 9
Re: Option ROM on Dell Dimension L533cx
« Reply #1 on: January 26, 2010, 21:02:39 PM »
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

  • Administrator
  • Hero Member
  • *****
  • Posts: 2491
  • a command shell is enough to do amazing things
Re: Option ROM on Dell Dimension L533cx
« Reply #2 on: January 26, 2010, 21:41:50 PM »
hi,

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

  • Newbie
  • *
  • Posts: 9
Re: Option ROM on Dell Dimension L533cx
« Reply #3 on: January 26, 2010, 22:00:28 PM »
There are no requirements as to the state of any registers upon entry?

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2491
  • a command shell is enough to do amazing things
Re: Option ROM on Dell Dimension L533cx
« Reply #4 on: January 27, 2010, 07:33:37 AM »
yes, the rom and the plpbt.bin don't need any initial register values.

jakent

  • Newbie
  • *
  • Posts: 9
Re: Option ROM on Dell Dimension L533cx
« Reply #5 on: January 27, 2010, 09:00:31 AM »
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. :)
« Last Edit: January 27, 2010, 09:10:58 AM by jakent »

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2491
  • a command shell is enough to do amazing things
Re: Option ROM on Dell Dimension L533cx
« Reply #6 on: January 27, 2010, 09:16:00 AM »
the rom version makes a far return
the bin version makes an int 19h

jakent

  • Newbie
  • *
  • Posts: 9
Re: Option ROM on Dell Dimension L533cx
« Reply #7 on: January 27, 2010, 10:14:05 AM »
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

  • Newbie
  • *
  • Posts: 9
Re: Option ROM on Dell Dimension L533cx
« Reply #8 on: January 31, 2010, 05:02:22 AM »
[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
« Last Edit: August 18, 2012, 09:27:10 AM by jakent »

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2491
  • a command shell is enough to do amazing things
Re: Option ROM on Dell Dimension L533cx
« Reply #9 on: January 31, 2010, 17:57:45 PM »
did you try to configure the rom version to start in textmode and does it hang too?

jakent

  • Newbie
  • *
  • Posts: 9
Re: Option ROM on Dell Dimension L533cx
« Reply #10 on: January 31, 2010, 21:26:55 PM »
I have just tested like so:

Code: [Select]
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!

Code: [Select]
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

  • Administrator
  • Hero Member
  • *****
  • Posts: 2491
  • a command shell is enough to do amazing things
Re: Option ROM on Dell Dimension L533cx
« Reply #11 on: January 31, 2010, 21:59:51 PM »
fine,
but it does not work with my header, or?
can you make a photo from the random ascii chars?

jakent

  • Newbie
  • *
  • Posts: 9
Re: Option ROM on Dell Dimension L533cx
« Reply #12 on: February 01, 2010, 00:04:24 AM »
Sorry if I was unclear.  No, your header fails on this machine.

Code: [Select]
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

  • Newbie
  • *
  • Posts: 9
Re: Option ROM on Dell Dimension L533cx
« Reply #13 on: February 02, 2010, 17:24:53 PM »
Would you like me to help diagnose anything further on this system?

Best regards,
-- Jeff

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2491
  • a command shell is enough to do amazing things
Re: Option ROM on Dell Dimension L533cx
« Reply #14 on: February 02, 2010, 17:31:09 PM »
at the moment i have no idea what i can do.