Sunday, October 6, 2013

SeaBIOS - Source Code Study (1)


SeaBIOS handle fw_cfg


entry_elf -> handle_post() -> dopost() -> maininit() -> interface_init() -> qemu_cfg_init()

ENTRY(entry_elf)

SeaBIOS serial port configuration


Serial Port Information is listed as follows:














  • debug_serial_preinit()
  • DebugOutputPort = 0x402

Make BIOS Writable


BDF Architecture is blow:
bus << 16 | device << 11 | function << 8 | offset
But in SeaBIOS:
bus << 8 | dev << 3 | fn
Because when out 0xcf8 port, bdf will be << 8
  • foreachbdf(BDF, BUS)
    • pci_bus_devfn_to_bdf(bus, devfn)
    • pci_next(int bdf, int bus)
    • pci_config_readb(u16, bdf, u32 addr)

No comments:

Post a Comment