Hi Peter. Thanks for the great info.
Ok, the main thing is I don't want my OS to have to load this, I want it loaded before the OS is loaded.
I understood that, and an option ROM satisfies this.
Ok, thanks for confirming.
The bare board only needs power to run, everything is onboard. Some resellers may offer the board mounted in a case.
Ok, I was hoping not to be involved in computers where even getting a case is a challenge.
Does this imply most computers don’t allow their firmware to be flashed with SeaBIOS?
You can flash it, but the computer will no longer start.
Ok. :-)
SeaBIOS doesn't perform hardware initialization of e.g. RAM and PCI busses.
SeaBIOS was created to be a coreboot payload when a system with coreboot needed a BIOS to start the OS.
Oh I see. In that case, let me rephrase - does this imply most computers don't allow their firmware to be flashed with coreboot?
If that is the case, is there someone else I should be negotiating with?
Good question - it probably depends on the bigger picture of your project.
What do you want to accomplish in the end? Is this a one-off thing or high volume, how deterministic must it be in which environment etc.?
I have an operating system already, called PDOS/386, available at http://pdos.org
It uses the BIOS almost exclusively (switching back and forth to RM16). I intend to eliminate the non-BIOS code, and I intend to start using INT 14H to access the outside world.
But for now, that’s the limits of the design changes I wish to make to the OS.
I instead want to see if I can make the hardware/firmware conform to the published specs I rely on, while operating in a modern environment, with Wifi replacing modems.
And then I want to recommend to anyone purchasing a computer to pay extra to get one that runs PDOS/386. Other things they should ensure is that the BIOS can convert all 3 USB sticks/ports into hard disks, not just the one that is being booted.
Currently I don't know what to recommend, because I don't understand the other side of the INT 13H/14H, only the OS side.
And I don't know what is technically possible, so that there is something to recommend in the future.
Think of an option ROM as a modular expansion to any BIOS.
This sounds promising. So perhaps manufacturers allow option ROMs to be flashed, but just not the entire BIOS to be replaced?
Option ROMs traditionally exist primarily on option cards. SeaBIOS is cleverer and can also run option ROMs in the boot flash.
A proprietary BIOS or UEFI will not likely run an option ROM from the boot flash.
I don't need the proprietary one to work, so long as it can be replaced with coreboot + SeaBIOS.
Here's an open source option ROM: https://github.com/alson/sgabios
It's x86 real mode assembly; the typical BIOS environment.
I took a look thanks. But actually I am hoping all of this will be in C. I was expecting INT 14H to be minimal x86 real mode that switched to UEFI C code,
Oh, UEFI..
You may know, but interrupt services such as int 14h are a BIOS interface, as provided by traditional BIOS implementations.
Sure. For now, I want PDOS/386 to remain traditional. When I have exhausted everything that is possible via the BIOS, I will consider adding UEFI support.
UEFI implementations do not provide interrupt services, but a CSM can.
Sure. And there's no disadvantage in CSM, is there?
the same as CSM does (right?).
I don't think UEFI mandates /how/ a CSM implements the interrupt services, I'd expect that a CSM can do what it wants without calling into UEFI, but depending on what it needs to do it may /want/ to call into UEFI.
Yeah, I'm on the "want" side of that. I'd like to be executing C-derived code as much as possible.
I read that SeaBIOS supports CSM.
SeaBIOS can act as CSM, at a minimum in VMs, I don't know what the situation is with UEFI implementations on hardware.
I don't really understand this. What I'm looking for, at least ideally, is for a BIOS implementation that switches to 32-bit or 64-bit mode, and C, to do the actual work.
I thought that was how modern systems worked, and the very definition of CSM?
Ok, for the specific case of converting INT 14H into Bluetooth - I assume that much Bluetooth hardware is proprietary.
Bluetooth is one of the most, if not the most, proprietary contemporary technologies. I think it may be the original case of a quasi-open standardization process coupled with fierce intent to keep any implementations as closed as possible.
Ok, this is a good starting point for analysis then. The protocol itself must be open, for two bluetooth devices to talk to each other. So at what level is it proprietary? Everyone develops their own silicon?
But I know that libbluetooth exists.
What does libbluetooth refer to, exactly?
If you mean the shared library (.so file) on Linux systems then that isn't relevant for your idea.
Yes, that's what I was referring to. I read that the specs for bluetooth were buried in the libbluetooth source code, rather than a document.
Basically is it possible to flash libbluetooth onto an option ROM, add 100 lines of x86 assembler to switch to long mode from INT 14H, call libbluetooth, and call it a day?
No way.
Ok. But that's where my level of understanding is. :-)
Or approximately how many lines of x86 assembler and C code are required in addition to what SeaBIOS + libbluetooth already provide? Or is there some technical problem prohibiting this solution?
The latter. libbluetooth.so is a mere fraction of the software involved in using BT on a Linux system. The majority exists in the Linux kernel and uses lots of kernel infrastructure, so can not run standalone.
Could it have been modularized so that it could run standalone? Isn't that what drivers are for? Maybe if drivers were written to a particular standard they could be flashed onto the firmware?
You very likely don't want to get into developing a BT stack, especially not one running in a BIOS environment.
I had hoped it already existed, and just needed to be rearranged and flashed.
The only abnormal thing I wish to do is to get a traditional INT 14H to call someone else's stack.
I strongly recommend to keep all BT parts of this project in separate hardware outside of the x86 system and to choose/design that hardware such that it's comfortable to use in your int 14h handler.
Since the apu board has two serial ports (one internal on a header) its BIOS may already provide int 14h services for those ports, then you could just connect a transparent BT UART and be done, no software needed at all for that.
The point of my firmware project is not to make BT UARTs sell like hotcakes. BT is just one target. A more useful one is Wifi. But I think BT is better for abstracting the problem.
This is a general question about the hardware manufacturing process.
What options exist for bending hardware (firmware) to the will of my operating system?
Someone mentioned "SeaBIOS" which is why I'm here, but I may be in the wrong place.
Obviously I can always go back to 1990 and my OS will work fine with a real serial port and a real modem.
But I'd like to transport all of that software, designed for that environment, and change nothing at all, and have it work on a new environment that includes Wifi, bluetooth and maybe ethernet, and maybe infrared, and maybe other things I don't know about, but make sense (at some level) to be accessed via INT 14H.
But I'm only talking about functions 1 (write) and 2 (read) of INT 14H. I expect function 0 (initialize) to have no meaning on modern hardware, and should always have been done via a separate "MODE" command in MSDOS (and now PDOS/386), and in a modern environment, you can do the MODE command if you want, and PDOS/386 will dutifully pass that on to function 0, as MSDOS presumably did, but (something - SeaBIOS?) will not actually do anything, because everything (ie the bluetooth hardware) is effectively operating at N,8,1 and maximum speed.
Thanks. Paul.