Slashdot Mirror


In-Depth Look At LinuxBIOS

DrSkwid writes "With PhoenixBIOS reading your email because of such inordinate boot up times for Windows and other OSs, it was remarked in #plan9 about our 5s boot times using LinuxBIOS. My friend f2f pasted an article from Linux Journal which looks at the basic structure of LinuxBIOS, the origins of LinuxBIOS and how it evolved to its current state. It also covers the platforms supported and the lessons they have learned about trying to marry a GPL project to some of the lowest-level, most heavily guarded secrets that vendors possess."

32 of 284 comments (clear)

  1. Already tried...? by xeon4life · · Score: 4, Interesting

    Didn't Microsoft want to do the same thing? Only Linux advocates started to become angry... -Xeon

    --
    Real programmers can write assembly code in any language. -- Larry Wall
    1. Re:Already tried...? by Lane.exe · · Score: 4, Insightful
      Yeah, but in this case, we'd have the source code and could see what was going on, modify it if we needed to, and because of this, it couldn't be used to lock other OS's out.

      --
      IAALS.
    2. Re:Already tried...? by sflory · · Score: 4, Informative

      Actually Linuxbios already boots windows;-)
      http://www.linuxbios.org/news/index.ht ml#NT

      --
      IANALBIPOOGL (I am not a Lawyer, but I play one on GrokLaw.)
    3. Re:Already tried...? by Alsee · · Score: 5, Insightful

      Didn't Microsoft want to do the same thing?

      No, what Microsoft has ALREADY done, through pressure on Phoenix BIOS (submitted by yours truly) and on AMI BIOS (and probably every other BIOS maker), has far more sinister overtones.

      The purpose of the new Microsoft-enabled BIOSes is to enable a new kind of "trusted" software and files that ARE UNUSABLE if the owner of the machine alters any of the "protected" elements of his computer.

      Lets say you write some sort of upgrade for your computer, or you don't like something about how your computer runs and you want to change it (or someone else write such code and you want to install it). Code that changes the BIOS. What the new Trust system does is detect that you changed your computer and any "secure" software and data are unreadable. The music you downloaded will be unusable. The image processing software you had installed can no longer run. The spreadsheet you just bought can not install. Your favorite game can not connect to the server. The new "secure" e-mail Microsoft is advertizing will be unreadable.

      But here's the REALLY scary part. Another slashdot story reported Cisco Working to Block Viruses at the Router. What the story missed was the fact that these new Cisco routers are based on Trusted Computing. That don't actually do anything to block viruses. What they can do is use Trusted Computing to verify that you have specific software installed, such as approved anti-virus software and an approved firewall. The way they "fight viruses" is by refusing to permit you an internet connection unless it verifies you are compliant. Well, if you changed your BIOS at all, or if you changed anything else about your computer, then the Trust chip in your computer reports a "failed" response. The router cannot verify that the approved anti-virus software and/or firewall are installed. You are therefore DENIED an internet connection.

      The president's Cyber Security advisor gave a speech at an industry conference and he called on ISP's to install these routers and in effect to impose Trusted Computing compliance onto all of their customers as part of the terms of service for internet access.

      If you try to change or control your system in any way then none of the new software will run, none of the new files will be readable, and ultimately you may be denied internet access. In effect you would no longer own your computer.

      There is only one thing wrong with Trusted Computing - you are FORBIDDEN to know your own key that is secreted inside the Trust chip. When you don't know your own key then other people can turn your computer against you and lock you in or lock you out of anything. If you DID know this key you would be in full control of your computer.

      When it comes to Trusted Computing simply demand to know your key. If they refuse to let you know your own key then tell them to go to hell.

      -

      --
      - - You can't take something off the Internet! That's like trying to take pee out of a swimming pool.
  2. A bootloader? by ObviousGuy · · Score: 4, Interesting

    Initializes the CPU, initializes the bus, initializes the hardware, dumps to OS.

    Isn't that a bootloader? Is it special because it is burned into the ROM?

    --
    I have been pwned because my /. password was too easy to guess.
    1. Re:A bootloader? by ciroknight · · Score: 4, Informative

      Not from how I understand it. This is actually saving a Kernel-Image onto the bios chip itself, therefore booting straight to the kernel from the chip, basically skipping the step of "BIOS tells HD to find MBR, then read the data from MBR to ram, execute MBR instruction". Or at least, that's how I understand it?

      --
      "Victory means exit strategy, and it's important for the President to explain to us what the exit strategy is." G.W.Bush
    2. Re:A bootloader? by ciroknight · · Score: 5, Informative

      Well, for starters if my understanding of eXecute In Place is holding, it's completely different. The ROM chip holds a compressed kernel, that's decompressed on the fly and used to start the system. The only thing this skips is the need to do a startup seek for harddrives, and that whole step of initalizing slow hardware (ie, Hard Disk platters). eXecute In Place is intented to simply run the program natively, ie uncompressed kernel image sitting in ram, so it can just be thrown straight into the processor and executed. The difference is slight, but none-the-less important.

      --
      "Victory means exit strategy, and it's important for the President to explain to us what the exit strategy is." G.W.Bush
    3. Re:A bootloader? by AxelTorvalds · · Score: 5, Informative
      I have developed a commercial set-top box that used ideas from LinuxBIOS. It's kind of a bootloader, like there are on non-x86 machines.

      How it typically works is you develop a kernel with a small foot print. The LinuxBIOS guys are really sane about things, there is a few lines of assembly which is just about enough code to start running C code. After that the gist of it is C with some assembly macros. There isn't anything too complex, we're talking about outp mostly. There isn't anything too secret here, it's just that booting a PC is not documented really well. Some BIOS vendors have software that does runtime function with system managment interrupts. DRM will be something like that. Supposedly and there have been discussions about it on the LinuxBIOS list, Phoenix and company do some hardware error checking and such and that's why they are so slow but some of the LinuxBIOS folks think that they don't do that and that the code is so complex and has so much legacy that it does a bunch of extra crap that it doesn't need to.

      That code does enough to turn on memory, it may do some checking now, when I looked at it last there wasn't a ton of integrity checking code. Light up a few other components, like VGA. Then copy a kernel from flash in to memory (think of it as a slightly tweaked bzImage) At that point you can pretty much jump to the start of the kernel and execute it. The kernel doesn't use BIOS for most device IO so it knows how to spin up drives and light up the rest of the hardware.

      Now how we did it and understood the goal of LinuxBIOS to be was we had an initrd that the kernel from flash would load and execute. Said initrd would look at the drives, look at some other variables, authenticate the system, possibly do a fsck on the disks if needed and then locate a kernel on the disk. After locating that kernel it would use kexec, now called fastboot, and replace the kernel in memory. The idea was that we could upgrade kernels on disks without changing flash.

      It works very well and has been incredibly reliable. We can get in to kernel space in a few seconds. Subsequently, if it's a settop box type device, it could download a brain from cable or satellite. It could rebuild itself if needed. You could have diagnostic code in there for manufacturing, etc, whatever you want. Pretty much only limited by flash size and memory.

      I know that they now and do other things like boot windows and such, at which point LinuxBIOS is potentially a serious threat to Phoenix and company, the BIOS is an expensive piece of the computer.

      I've been toying around with some linuxbios type projects. Since disk space is so insanely cheap and disks are so big anymore, you could set aside a backup partition, easily do a really quick backup daily and then weekly do a backup of that to long term media from "BIOS land" regardless of the operating system. Or you could have something like snapshots of your system, maybe a clean install, a configured system, a backup, a different OS or something like that and then all from "BIOS Space" pick them at boot time and have it restore them. Something like that, I have always wanted backup support at the BIOS level.

  3. Motherboard support by Anonymous Coward · · Score: 5, Insightful


    Will this have any chance of being taken up by a motherboard manuafacturer by default or is this a aftermarket project ? in which case without being installed by a manufacturer no-one is going to even contemplate wiping their "working" bios for an unknown 3rd party of no significant benefit to them

  4. On the bright side by Anonymous Coward · · Score: 4, Insightful

    This might actually result in a higher quality BIOS in the next few years

  5. Clustering by Neo-Rio-101 · · Score: 4, Interesting

    The reason why Things like LinuxBIOS are important is because having a PC boot with the Linux kernel is not only a cool trick, but it saves people who build clusters a heck of a lot of money on Hard Drives and CD-ROM drives, when a cluster node only really needs a mainboard, CPU, and RAM.

    Maybe with faster, bootable USB on motherboards in future, and cheaper flash RAM, flashing the BIOS to run Linux will seem a little less necessary.

    Maybe there's some other use for Linux in the BIOS, but someone will have to teach me as to what that is.

    --
    READY.
    PRINT ""+-0
    1. Re:Clustering by Hiro+Antagonist · · Score: 4, Informative

      On top of that, it can make life easier for admins, because a LinuxBIOS could be configured to allow a serial console with full hardware control, just like a Sun box does.

      --

      --
      I Hit the Karma Cap, and All I Got Was This Lousy .sig.
    2. Re:Clustering by oob · · Score: 4, Insightful

      because a LinuxBIOS could be configured to allow a serial console with full hardware control, just like a Sun box does.

      Great point. This is functionality sorely missed in the vast majority of x86 systems for everyone that needs to run headless servers.

      The Remote Serial Console HOWTO is a superb document, but following it only provides you with a system administrable via serial console once the bootloader (LILO, Grub) has been initialised. This means that everything before the bootloader is not accessible via serial console.

      Having to install a video card and attach a monitor and keyboard to box in order to modify BIOS settings is major pain in the arse.

    3. Re:Clustering by DeathPenguin · · Score: 4, Informative

      >>I mean does LinuxBIOS initialize hardware and then load my kernel for regular operations?

      It initializes the necessary hardware and then loads any "payload." The payload can be anything--A kernel image if you have enough space on your flash part, a bootloader to boot from over a network or local disk, etc.

      Currently the Lightning cluster (Ranked at #6 @ top500.org) uses LinuxBIOS to load a bootloader (Etherboot or FILO, I forget which) which then loads a kernel and BProc. No spinning hard disk, no CD-ROM, just an added solid state flash device on the IDE bus containing a bproc-patched kernel with a driver for the interconnect and bpslave. The rest of the operating system for slave nodes, which is only a few kilobytes, is pulled down over the network (Not necessarily ethernet) and loaded into RAM.

      >> How are kernel updates done if it is the latter.

      Since all the hardware is same for a cluster like Lightning, a kernel update can be done pretty easily with the bpcp (BProc copy) command if you have a new kernel sitting on the master node. I haven't used it in a while, but I think the command goes something like: bpcp vmlinuz 0-N:/boot/vmlinuz, where N is the last node. The syntax is very similar to RSH/SSH, but you can specify as many nodes as you want so you don't need any shell scripts to count up for you. I guess you might also need to tell bpsh to mount a boot partition, depending on how you have it set up.

      If you have your kernel in the BIOS, then you have to rebuild and reflash. With the magic of BProc, you don't even need to put the BIOS flashing utility (See their flash_and_burn utility) on the slave node. Just run bpsh 0-N flash_rom newbios.rom. LinuxBIOS even provides fallback functionality so if something goes horribly wrong during this process or the new image doesn't work it can automatically load an old image that does work.

      These are just a few of many possible configurations, of course. There are no strict guidelines as to how a LinuxBIOS system must be used. It's extremely flexable, which is one of its main appeals.

  6. boot time of no benefit? by abscondment · · Score: 5, Insightful

    if it increased boot time significantly, it could be of great benefit--think of a webhosting company that guarantees less than a certain number of minutes of downtime each year. shaving off seconds on each reboot could save them $$$.

  7. Re:Obligatory by Brian+Dennehy · · Score: 4, Funny

    Only in Soviet Russia. (Think about it.)

  8. Grub by Trashman · · Score: 4, Interesting

    aside from grub being "just a boot loader", Wouldn't it make sense if grub was somehow moved into the bios?

    --
    Do not read this .sig
    1. Re:Grub by ciroknight · · Score: 5, Interesting

      Fuck grub, this is moving the whole kernel into flash-ram. This is to save the step of having to connect to the hard drive until when it's actually needed to run software, which can be done WHILE the system is booting the kernel, instead of before-hand. And as we know, in the computer world, multitasking is a good way of speeding up things.

      ;)

      --
      "Victory means exit strategy, and it's important for the President to explain to us what the exit strategy is." G.W.Bush
  9. It really is amazing... by ZuperDee · · Score: 5, Interesting

    I think it is really amazing how many people here on Slashdot are just so eager to post comments that they obviously don't even bother to read the actual article.

    If some of you people had read the article, for example, you'd notice some important points being made, such as, "From what we can see, the two factors in our success were competition and the creation of a market. Competition gave us a wide variety of choices as to motherboard, chipset and CPU. Once there was a reasonable market, vendors were concerned about being left out."

    I don't know about any of you, but I think the creation of an open source "market" is EXACTLY what has enabled the success of open source products like Linux in the first place.

    It was also what enabled the success of the Wintel architecture, if you think about it. At the time the original IBM PC was released, it was virtually a foreign idea to IBM--many people at the time were asking the question, "how on EARTH could IBM possibly release a machine based on open specifications and parts with a straight face?" Let us not forget that at the time, IBM desperately needed to get ANY kind of microcomputer on the market ASAP, for fear that Apple and others might get firmly entrenched. Once that thinking took hold, IBM practically had no choice but to hope and pray that their Big Name would keep them at the forefront. As we know, companies like Compaq came along and proved them wrong, and the rest is history.

    The point is, I wonder why things like chipsets are still so closely guarded secrets. Can you people imagine what the world would be like if Intel had made the x86 CPUs with a proprietary, closely-guarded SECRET ISA, that you could only program for if you signed an NDA? If Intel had done that, Linux probably wouldn't even exist!!

    I sometimes have this feeling Microsoft would do ANYTHING to go back in history and try to get all the laws of our country re-written and the market changed so this kind of all-secret world I speak of could exist.

    In the end, the markets for products, be it open OR closed, occur because someone created that market. I think it is high time someone created an "open source" chipset, myself. But that's just me. If you people want all things to be open, stop talking about it and complaining about closed-source, proprietary things, and DO SOMETHING about it.

  10. Heres a picture by sinkywinky · · Score: 5, Funny
    It sounds like a good idea but how does it work in practice? How about pictures?

    Heres a picture of linuxbios:
    0001001010001000000100101001001000100100100100101
    0010101001001000100100000100100101000100100100100
    1001000100100100010000001001000100010000100110010
    0101001001000100100100100101100100010000001010101
    1000100100000100100000100101010010010010001001001
  11. What is the bios for? by www.sorehands.com · · Score: 4, Insightful
    Are we looking for a bios to run straight to unix or a bios to load an operating system? Should we have a windows bios too?


    If we start pushing linux bios, would we be pushing linux as Microsloth pushes Windows?

  12. Does it allow console access via serial port? by whoever57 · · Score: 4, Insightful
    If so, this is very valuable to data centers:

    instead of hauling a monitor over to a machine that won't boot, they could remotely connect via a Portserver or similar. Much easier!

    --
    The real "Libtards" are the Libertarians!
  13. Finally, an admission... by BeBoxer · · Score: 5, Insightful

    Finally, an admission that the hardware vendors claim of secret interfaces is often just BS:


    One of the most common phrases we heard from chip vendors in the first few years was "we'll never tell you that." "That" being CPU information, chipset information, motherboard information or any combination of the three. The designs for these three systems constitute highly guarded secrets. It seems amazing, even now, that vendors are able to let us build a GPLed BIOS that by its nature exposes some of these secrets.

    How was it possible for us to get this type of information? Simple, businesses are not charities. If there is no business case for releasing this information to us, they do not do it. If, however, there is a business case, then it happens?sometimes with astonishing speed.

    Read that last paragraph again. The hardware vendors basically say "that's a secret" whether it really is or not. Unless you pay them, or show them that they are losing money, they won't even bother deciding if it's really something that has to be kept secret.

  14. A BIOS is for weens! by chris_sawtell · · Score: 4, Funny

    Real men load the boot loader using 16 switches and a press-button.

  15. Handy tips... by GoRK · · Score: 5, Informative

    I was recently doing some research to get started working with LinuxBIOS. The first thing I have done is to order a BIOS Savior.. This is a little gadget that runs about 15 bucks. It puts a switch on the outside of your case allowing you to switch to an alternate BIOS. With it, you can happily screw up your LinuxBIOS image all you want and still be able to boot your computer from the original BIOS.

    Some motherboards have a dual BIOS or similar arrangement; however, there is not always a foolproof way to switch to your backup if the primary BIOS is hosed..

    Keep these things in mind if you want to start playing with LinuxBIOS

  16. OpenFirmware by Quok · · Score: 5, Interesting

    I read this article a couple months ago when my issue of Linux Journal arrived. I had a couple questions about it then, guess this is a good time to ask them. :)

    As I see it, half the point of LinuxBIOS is to provide a fast, open-sourced BIOS for x86 machines. It gets extra cool points for being Linux.

    But I have to ask, why not just use OpenFirmware? Or at least, give LinuxBIOS some of the features of OpenFirmware. As far as I know, there is no such thing as OpenFirmware for the x86. It's got lots of neat benefits, like booting your machine off of another one on your network, or debugging a non-bootable machine remotely. Serial console, anyone? It has other benefits as well, that I can't remember; my brain is shot for the week.

    For those of you that haven't heard of OpenFirmware, it's basically the "BIOS" on Macs.

    1. Re:OpenFirmware by Laur · · Score: 4, Informative

      You are looking for OpenBIOS. It is still in the developement stages and is not ready for prime time yet. Incidently, the developers are planning on using LinuxBIOS code for the initial boot-up sequence. Also, OpenFirmware is not just the BIOS for Macs, it is an IEEE standard and alo used by other vendors such as Sun.

      --
      When you lose something irreplaceable, you don't mourn for the thing you lost, you mourn for yourself. - Harpo Marx
  17. Re:How can I flash my AwardBIos to run this? by cgenman · · Score: 4, Insightful

    Ok, first why should I switch from the current BIOS I have to this one, make the case.

    You shouldn't. Ok, that's unnecessarily harsh, but as it stands right now LinuxBIOS is primarily for people who are between very and highly technically inclined... Kind of like linux was shortly after it's release. That's why their website "SUCKS," because this isn't yet ready for the KDE crowd. You'd have to be comfortable finding the status of your motherboard, downloading and compiling the appropriate files, reflashing your onboard FlashROM, and other nasty, dirty things. I wouldn't consider myself qualified to get their best documented system up and running unless I was between jobs, and even then I consider it iffy.

    Linux BIOS as it stands is useful for a few specific things: Building clusters and building robots. Any embedded system running on linux on a traditional motherboard can be sped up significantly by using Linux BIOS. But it does require quite a bit of work and knowledge to get it running... If you want a computer pre-flashed with LinuxBIOS, you can purchase one off the shelf, but I would be hesitant to try and build one without a lot of time and / or skill.

    It isn't that the LinuxBIOS people don't want that kind of end-user friendliness, it's just that the project is still in the mode of getting things working at all, let alone in an easy fashion.

    Secondly, as you might have figured out, it is not a drop-in BIOS replacement. Your computer enters the boot phase and exists the other side with Linux running. You'll not get Windows to run directly on that, and I'd be surprised if it ran virtually (as the BIOS windows is expecting doesn't exist). If anyone here has experience running Windows on a LinuxBIOS, please let us know.

    None of this is to say that the goals of the project are bad. Imagine being able to boot to command line in 3 seconds! You could start an ssh session before your monitor was done de-gaussing. Attach a 4 line LED display to one of these motherboards, and you would have a great tool for debugging network problems. Or just speed things up significantly, and spend more time doing what you are supposed to be doing, with the added bonus of being able to shut down your computer when you are done (gasp!). It just needs a lot more work, and a lot of developer support. I'm glad to see it posted to Slashdot, as the exposure might net a few more eager helpers.

  18. LinuxBIOS to boot other OSs by jerel · · Score: 4, Interesting

    In my admittedly cursory review of the main LinuxBIOS site (here) and of the article I was unable to find anything about using it to boot other operating systems besides Linux. Can I buy a compatible mobo, put the LinuxBIOS on it, and then run Windows? I'm still running dual-boot for now and would need this.

    --
    Some days it's just not worth chewing through the restraints.
  19. This is a wonderful idea... yeah right. by rice_burners_suck · · Score: 5, Interesting
    I have an idea relating to LinuxBIOS that stems from a job I work sometimes involving industrial machines and their archaic control systems. Some of these computers require a technician to turn them on because of a complex procedure that must be carried out, including the typing in, by hand, of the first few assembly instructions to be executed, which tell the computer to read some software from some weird ROM, which then tells the computer to load the "real" operating software from something over RS-232. For this reason (among others), these machines are never turned off, except in a power outtage, which is a nightmare for machine shop owners. And it could all have been avoided by designing the computer a little differently, placing the OS itself in the ROM, and making the computer load it automatically on powerup.

    I see this exactly the way I see modern operating systems boot up. The BIOS goes to some place and reads 512 bytes. Those bytes load up a "real" bootloader. That bootloader loads up some darn thing, which loads up the kernel, which loads up a bunch of device drivers and other software, and after a minute of grinding the disk, you have a system waiting for input. Why all this fuss?

    My idea, then, is that instead of having an operating system kernel on your hard drive, it and its bootloader should reside in a really friggen powerful BIOS chip. By powerful I mean that there should be a LOT of flash space and the BIOS itself should be a relatively powerful microprocessor. The software is started immediately upon the powerup of the computer. The BIOS Flash then looks like the root partition; it is mounted just like the hard drives and other devices are. All device drivers are present in the kernel, anyway, and since the BIOS is designed for the computer (by the factory) or configured (by a hacker who puts together his own system), there is nothing to detect or load. Furthermore, all software that starts at startup has a complete image "frozen" in the BIOS Flash, and is copied directly into RAM during the initial stages of startup. Therefore, if you have X, and an entire desktop environment, the entire computer goes from OFF to running X and your desktop software, and whatever else you want for that matter, in almost no time at all. Your monitor would probably take longer to warm up then it would take for your desktop to be ready for input.

    This sounds a lot like un-suspending a computer that is in suspend mode, and yes, in effect, it's just like that. You have your system running the way you want it to start up, then you "freeze" it a la VMWare, put it in the BIOS Flash, and when you turn on the computer, the BIOS copies the image directly into RAM, with perhaps a few routines here and there that initialize hardware upon powerup, or set a few values throughout RAM, like time-sensitive things and whatnot... No matter how fast MS makes their OS load, it'll never come close to this kind of performance.

    Take it a step further, and each user could have almost an entire operating system setup, as if the computer has multiple personalities from the bootloader up. The BIOS has some routine that lets you log in, and accordingly, selects the image that will get loaded. In this respect, you could completely power down the computer, and come back a week later, turn it on, and immediately it will return to where it was.

    This will probably be the case in 10 years or so. (Hey, in the 90's we went from the 386 SX to the Pentium 3. Who knows what the hell will happen by 2015 or so.)

  20. Re:Using x86 PCI adapters in the Macintosh? by spacefrog · · Score: 4, Informative

    Actually in many cases, that works without even having to flash the card with the appropriate mac image, even in cases where the card was never designed to work in a mac, or even has a flashable firmware.

    A lot of PCI cards that do not have any firmware, work just fine on a ppc/linux setup to begin with, even when the cards do not have any support in MacOS or OSX.

    I have a realtek ethernet card and a generic AMD usb card in my oldworld 603e machine already.

    In addition, a lot of cards that do have firmware will work as long as you do not care about the device being available from boot. I have an older matrox card and an adaptac 2940UW in my machine.

    Both work just fine as long as I don't need them until the linux kernel takes over. With proper kernel parameters, the matrox card is even my console, I just don't see anything until the kernel is booting. Ditto, I boot and load kernel from a 250MB narrow-scsi drive on the machines onboard scsi. My root partition is on an UW drive on the adaptec card.

    Took a little bit of doing, but this 'grossly obsolete' machine is running just great after adding some 'somewhat obsolete' parts. With 256MB, a fast drive, and a card with decent X performance (the 10-year-old matrox)... It performs a heck of a lot better than it's 180Mhz would make you guess.

  21. Re:And now they are low quality? by Anonymous Coward · · Score: 4, Interesting

    They may not be low quality but there are several reasons why tradtional BIOS's suck. For a start there is the huge amount of legacy 16bit, real-mode x86 code that just isn't used by modern operating systems but is supported because of things like Windows ME. If you're running Linux or Windows NT on your computer, you just do not need it. Then there are the traditional limitations in x86 BIOS's. You can't run an x86 machine headless and access the BIOS setup, for example. With LinuxBIOS they enable the network interfaces and allow you to perform setup via. a telnet session, exactly as you would with more expensive server kit. Last but not least there are bugs in some BIOS, and some of them can be pretty bad. LinuxBIOS offers you the ability to patch or workaround those bugs yourself, instead of having to wait for the vendor to fix them for you.