[SeaBIOS] [PATCH] floppy: Support CMOS setting outside QEMU

2022-07-12 Thread Petr Cvek
SeaBIOS can be used for booting legacy OS and also Linux is still using CMOS address 0x10 to configure floppy controller. Under these assumptions it makes sense to allow boot from CMOS defined floppy drives. Signed-off-by: Petr Cvek --- src/Kconfig | 7 +++ src/hw/floppy.c | 2 +- 2

[SeaBIOS] [PATCH] timer: Configure timer1 to a standard settings

2022-07-12 Thread Petr Cvek
ASPI2DOS.SYS and KEYB.COM from Win 98 SE installation CD (and most likely other DOS versions too) depend on I/O port 0x61 bit 4 to be toggled. This requires timer 1 (I/O 0x41, legacy DRAM refresh) to be correctly set. Also Intel ICH7 Family Datasheet, chapter 5.8 states: Programming the counter

[SeaBIOS] [PATCH v4 3/4] romlayout32flag.lds: Use `. +=` instead of `. =`

2022-07-12 Thread Fangrui Song via SeaBIOS
This improves the portability of the linker script and allows lld to link rom.o Dot assignment inside an output section has an inconsistent behavior which makes lld difficult to implement. See https://bugs.llvm.org/show_bug.cgi?id=43083 Dropping `. =` turns out to be beneficial to older GNU ld

[SeaBIOS] [PATCH v4 2/4] Make rom16.o linkable with lld

2022-07-12 Thread Fangrui Song via SeaBIOS
lld requires output section descriptions to be sorted by address. Just sort the addresses beforehand. -- Changes v2 -> v3 * Sort sections by finalloc unconditionally Signed-off-by: Fangrui Song --- scripts/layoutrom.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/layoutrom.py

[SeaBIOS] [PATCH v4 4/4] test-build.sh: Delete unneeded LD capability test

2022-07-12 Thread Fangrui Song via SeaBIOS
The previous commit changed romlayout32flag.lds to use `. += ` instead of `. =`. We no longer need the LD capability test checking https://sourceware.org/bugzilla/show_bug.cgi?id=12726 Signed-off-by: Fangrui Song --- scripts/test-build.sh | 42 +- 1 file

[SeaBIOS] [PATCH v4 1/4] romlayout.S: Add missing SHF_ALLOC flag to .fixedaddr.\addr

2022-07-12 Thread Fangrui Song via SeaBIOS
It does not make sense to reference a SHF_ALLOC section from a non-SHF_ALLOC section via R_386_PC16. Conceptually, even if a non-SHF_ALLOC is loaded as part of the memory image, the distance between it and a SHF_ALLOC section may not be a constant, so the linker cannot reasonably resolve the

[SeaBIOS] [PATCH v4 0/4] Make seabios linkable with lld

2022-07-12 Thread Fangrui Song via SeaBIOS
Another try after https://mail.coreboot.org/hyperkitty/list/seabios@seabios.org/thread/KBHQU4OLW2THG5Q5F5X7EWTQDJHKNVYC/ The only change is the removal of `Makefile: Change ET_EXEC to ET_REL so that lld can link bios.bin.elf` since 699a4e5d6919cc8eae5342443025ceb6909dc276 ("ldnoexec: Add script

[SeaBIOS] [PATCH v3] Replace $(OBJDUMP) -thr with $(READELF) -WSrs

2022-07-12 Thread Fangrui Song via SeaBIOS
objdump -h relies heavily on BFD internals and the BFD flags. The output is difficult to emulate in llvm-objdump. (llvm-objdump -h has a different output https://reviews.llvm.org/D57146). Switch to READELF, so that llvm-readelf can be used as an alternative. readelf is generally better than