USB-Boot unter FreeBSD

Yamagi

Possessed With Psi Powers
Teammitglied
Eine gute Nachricht für alle, die immer Probleme damit hatten ihr FreeBSD von USB-Geräten zu starten. John Baldwin hat im Rahmen seiner Arbeit an den unteren Stufen des Bootprozesses BTX überarbeitet, sodass dieser nun sauber mit USB funktionieren sollte. Ich selbst kann mit den Änderungen endlich von einer USB-Platte booten, was vorher nicht möglich war.

Code:
jhb         2008-03-10 21:43:31 UTC

  FreeBSD src repository

  Modified files:
    sys/boot/i386/btx/btx btx.S
  Log:
  Change the BTX kernel to drop all the way out to real mode to invoke BIOS
  routines (V86 requests from the client and hardware interrupt handlers):
  - Install trampoline real mode interrupt handlers at IDT vectors 0x20-0x2f
    to handle hardware interrupts by invoking the appropriate vector (0x8-0xf
    or 0x70-0x78).  This allows the 8259As to use vectors 0x20-0x2f in real  
    mode as well as protected mode will ensuring that the master 8259A     
    doesn't share IDT space with CPU exceptions in protected mode.    
  - Since we don't need to reserve space for page tables and a page directory
    anymore since dropping paging support, move the TSS and protected mode   
    IDT up by 16k.  Grow the ring 1 link stack by 16k as a result.        
  - Repurpose the ring 1 link stack to be used as a real mode stack when
    invoking real mode routines either via a V86 request or a hardware  
    interrupts.  This simplifies a few things as we avoid disturbing the
    original user stack.                                                
  - Add some more block comments to explain how the code interacts with the
    V86 structure as this wasn't immediately obvious from the prior comments
    (e.g. that we explicitly copy the seg regs for real mode out of the V86 
    struct onto the stack to be popped off when going into real mode, etc.).
    Also, document some of the stack frames we create going to real mode and
    back.                                                                   
  - Remove all of the virtual 86 related code including having to simulate
    various instructions and BIOS calls on a trap from virtual 86 mode.   
  - Explicitly panic if a user client attempts to perform a V86 CALL
    request that isn't a far call.                                  
  - Bump version to 1.2.

  Assuming this works ok this should fix some of the long standing issues
  with USB booting as well as etherboot.

  MFC after:      2 weeks
  Submitted by:   kib (some parts from his original real mode patch)

  Revision  Changes    Path
  1.46      +317 -402  src/sys/boot/i386/btx/btx/btx.S

EDIT: Wer das ganze ausprobieren möchte sollte beachten, dass boot0 per fdisk -B und boot2 per bsdlabel -B reinstalliert werden muss. Beides muss klappen, sind sie asynchron, wird das System nicht mehr starten. Da am MBR und am Disklabel rumdoktern immer so eine Sache ist, sollte zudem der Inhalt der Platten gesichert werden.
 
Zuletzt bearbeitet:
Interessant, ich kann seitdem ich geom Labels verwende problemlos von USB booten. Ob das klappt schien mir immer vom BIOS des Geräts abzuhängen. Mein Notebook bootet von meiner USB-Platte, ein HP Thin-Client tut das nicht (das BIOS findet gar nicht erst die Platte).
 
Hurra, vielleicht löst das auch mein USB Bootproblem, ich werds gleich heute abend ausprobieren ....
 
Hoffentlich geht das endlich auf meinem Thinkpad :)

EDIT:
6.3 aktueller Snapshot bootet nicht - mit 8 gggeeeeehts :) Endlich weg mit Ubuntu :)
 
Zuletzt bearbeitet:
Zurück
Oben