Archive for the ‘GRUB 2’ Category

ATA bug fixes

Thursday, August 14th, 2008

Last week I have updated the ATA driver code in GRUB 2. Error handling was broken and delays were long until Colins TSC patch was applied. The current code is now quite resilient to errors. In the meanwhile I removed the ATAPI code. Instead, I have added a SCSI module. The SCSI modules allows other modules to register a SCSI command interface. The SCSI modules exports a disk device that is communicated with using SCSI commands over this SCSI command interface. The ATA driver was changes to uses scsi.mod.

I am working on USB support for Google Summer of Code. One of my goals is implementing USB Mass Storage Device support (USBMSD). USBMSD also uses SCSI commands. Thus this module will be shares between at least USBMSD and ATAPI. Hopefully someone will add SCSI drivers some day.

Google Summer of Code 2008

Friday, May 2nd, 2008

Last year I have implemented a Dirac (BBC) decoder for FFmpeg, as a Google Summer of Code project. This year I will be working on a Summer of Code project again, now for GNU GRUB. The goal is to implement a USB framework including some drivers for GRUB 2. When this is implemented, you can access USB HID and USB Mass Storage devices from GRUB, even when the firmware does not support this. You might want to use this when your BIOS does not support USB. More importantly, this increases the usability of GRUB 2 on top of Coreboot (formerly known as LinuxBIOS). Because of this (and other GRUB 2 features we are working on), Coreboot + GRUB 2 might serve as a good (and Free!) BIOS replacement.

The first thing I will do is reading some books about USB, namely “USB Complete” and “Universal Serial Bus System Architecture”. Although I have some doubts about the quality of the second book, it’s better than reading the USB specification from the screen (which I eventually will have to do). I have ordered both books and I am looking forwards to getting started.

Because I will read these books first and because I am busy with my studies, I will not start producing code from the start, you can expect the first code somewhere in June. The first thing I plan to look at is libusb, which makes it possible to play with USB without having a complete UHCI driver. It should be easy to integrate this into grub-emu, more on this later.

As for Dirac, it still isn’t finished (unfortunately!). When I have time to look at this, I will. But if someone is interested in working on this, please tell me. The remaining tasks are not hard.

Reading a bit…

Sunday, November 18th, 2007

Last week I started working on my graduation project. It’s a full-time job and at the moment my top priority. During the weekend I try not to spend too much time using the computer. For example, next weekend I will go to a concert of Sonata Arctica :-). Last weekend I have been keeping up with the emails on grub-devel so GRUB 2 will remain to be maintained.

Besides that, I am reading Operating Systems Design and Implementation by Andrew Tanenbaum. Although I know quite a lot on this subject already, I am reading it to refresh my memory on this subject and to prepare myself to read more papers on microkernel design. I have the silly idea to waste my precious time on writing my own microkernel some day. More importantly, I like reading and I do not want to spent too much time working on the computer. I am considering buying the book Modern Operating Systems, also by Andrew Tanenbaum. Can someone tell me if this is a good book and if it doesn’t have too much overlap with the book I am currently reading?

So I do not have much time at the moment. Still, I intend to finish the ATA driver and networking support for GRUB 2 somewhere in 2007. Also, I want to get the Dirac code for FFmpeg in shape so it can be committed soon. I am not sure if doing all this in 2007 is realistic though…

ATA/ATAPI driver for GRUB 2

Saturday, November 3rd, 2007

Last week I committed a patch to add support for ATA and ATAPI to GRUB 2. The ATA driver supports the CHS, ATA and ATA48 sector addressing methods. It should be capable of reading from and writing to every ATA harddisk. The ATAPI support is only capable of reading sectors from CDROM. I still have to add features like reading the sector count.

This driver will be especially useful forĀ  the LinuxBIOS port that has been recently committed. It can also be used to load something from CDROM when the BIOS doesn’t have CDROM support. Although I should further look into this, the only thing I have tested is loading files from CDROM.

There are several shortcomings in this driver. My driver and the one in the BIOS do not like each other. After my driver initializes, disk access from the BIOS might result in a crash. Therefore it disables biosdisk support. It also means that windows, for example, cannot be loaded using this driver because it later on accesses the disk via the BIOS interface. Perhaps this problem can be avoided by not resetting disks or storing the state somehow. I would appreciate it if someone can explain how I should do this properly so it will work on all systems.

Another shortcoming is its speed. For the moment it waits one tick, which is the shortest time GRUB can currently wait. One tick is 1/18th of a second, while it isn’t required to wait this long. Because of this, when the driver waits, it is wasting way too much time.

Booting from iso9660 images using GRUB 2

Wednesday, August 1st, 2007

In #grub one of the most asked questions is if GRUB can boot iso9660 images. Or better: how GRUB should do this, people don’t even think about if it would be possible or not. Of course this annoys many people and “GRUB can not boot CDROM images” is nowadays the most important line in the topic.

Actually, GRUB can read ISO9660(”iso”) images. It can for example loads the first few sectors and boot it. But most people do not realize is “what then?”. What would the loaded operating system do? It will most likely look for a CDROM, which it won’t find and fail.

A while ago I wrote a “loopback” command for GRUB 2. It makes it possible to load files from filesystem images. Think for example of a kernel and an initrd. But even this is not enough. The loaded kernel is not able to access the ISO9660 image just like that. The operating system needs support to deal with this. Somehow you need to pass the path of the ISO9660 image to the kernel and the kernel should loopback mount this image and use it.

So in order to use it I need an operating system that supports this. Sidux is one of those operating systems that do. The advantage of using GRUB 2 is that you do not need to extract the kernel+initrd manually, but can do this at boot time. So all you need is the ISO9660 image.

I managed to boot Sidux using GRUB 2 and the following commands (after renaming the .iso file):

loopback loop (hd0,7)/sidux.iso
linux (loop)/boot/vmlinuz boot=fll quiet vga=791 fromiso=/sidux.iso
initrd (loop)/boot/miniroot.gz
boot

This works perfectly and all you need is GRUB 2 and an the file
sidux-2007-02-200705281503-tartaros-kde-full.iso

I of course tried to do the same with Knoppix. It has a bootfrom option, but according to some forum post I found it doesn’t work when not booting from a CDROM. So I would have to wait until knoppix is fixed before this would work. I also hope Debian, Red Hat, etc will eventually make this possible.

What would be even better is that all CDROMs come with a multiboot bootloader as a file on the CDROM. For example /multiboot-IA32 for a PC CDROM (suggested by Robert Millan on #grub). This will make it possible to load some multiboot (multiboot2 perhaps?) kernel from the CDROM or CDROM image. That kernel (which can also be GRUB 2) will load a grub.cfg specific for the CDROM and boot it. To be able to load a ISO9660 image the multiboot-IA32 bootloader will need the path. The advantage of multiboot is that you can pass this path to the bootloader. If all distributions agree on this filename and agree on the argument to pass to the kernel to be “iso=”, it would be easy to boot such CDROMs without any legacy BIOS support, we can use ISO9660 images and perhaps even LinuxBIOS+GRUB2. Your firmware doesn’t even need CDROM support in the long term, GRUB2 just needs it and will get this support in the short term. And this can even be used on other architectures. Please let me know if this sounds like a good idea that will be supported. Perhaps we just need to create a new CDROM boot “standard” out of this :-).

(more…)

GRUB2 networking

Monday, July 30th, 2007

This is already my second post for this day. The previous post was getting too long already and I decided to split it up.

Besides my work on Summer of Code, which will be my main focus during the summer, I will try to work a bit on networking support for GRUB 2 in my spare time. I have some networking code that is not cleaned up and not full features and well designed on my harddisk already. Last week I sent in a patch to add Ethernet support to GRUB2. No drivers (actually, I am not interested in drivers), but mainly interface related code. This patches was not really cleaned up,it only was sent in to get some feedback on the interfaces. Although many people told me they were (even code wise) interested in networking support, no one replied to my post. This disappointed me a bit. Perhaps I should wait a bit longer, clean up the patch and resend it…

Related to GRUB, Robert Millan mentioned on the GRUB Development mailinglist that GRUB was used in a Marvel comic. Although this is unfortunately not GRUB 2, I find it amazing to see a project I greatly care about and work on mentioned in a comic!

My blog!

Thursday, July 12th, 2007

This is the first blog entry I wrote. I am not exactly sure what I will write on this blog and what I will add to this website. So you will have to see what happens!

The main topic of this blog during the summer will be my Summer of Code project. My project is adding a dirac decoder/encoder to ffmpeg. Development didn’t go as fast as I hoped before, but now I have all the time to work on this :-).

I will also use this blog to write about other projects I work on. For example GRUB 2, for which I am a maintainer. I also have some small pet projects I work on, I will also write about those

And of course I will write about myself, things I do, my opinion about certain things, etc