Table of Contents
Piotr Jaroszyński: Usermode debugging under Linux
Previous work [ Prior to 24 May 2010 ]
Unrelated work
Before I even started thinking about a proposal for my project I decided to do some pretty much random unrelated work to get a better feeling of gPXE in general. This resulted in a few trivial patches:
And then I decided to tackle something involving proper coding - adding base64 support to iSCSI. This resulted in not yet merged changes:
Related work
Even after doing some work on gPXE earlier I didn't know where to start the project I wanted to work on during summer. Josh helped me a lot with that.
Firstly I tried an efi build to see how the different ARCH
s and PLATFORM
s work. Unfortunately that resulted in some compilation as well as linking problems. I have managed to fix them:
With that behind me, I added a new linux
PLATFORM
, which involved the following:
- Remapping stdlib's symbols to avoid collisions with gPXE (see Kernel Interface)
- Adding linker scripts (for
i386
andx86_64
) just to handle tables (seeinclude/gpxe/tables.h
) - Adding an empty
linuxprefix
Having that base I implemented the very first linux subsytem: CONSOLE_LINUX
, which got usermode gPXE as far as:
$ bin-x86_64-linux/rtl8139.linux gPXE initialising devices... Segmentation fault
That work can be seen on linux branch (up to the “[linux] Add console” commit).
After that I decided to add a network driver based on tun/tap and all the subsystems necessary for that:
TIMER_LINUX
UACCESS_LINUX
UMALLOC_LINUX
NAP_LINUX
It's in an ugly state, but seems to be working:
$ ./bin-x86_64-linux/virtual.linux gPXE initialising devices... gPXE 1.0.0+ -- Open Source Boot Firmware -- http://etherboot.org Features: HTTP DNS TFTP net0: 52:54:00:12:34:56 on (open) [Link:up, TX:0 TXE:0 RX:0 RXE:0] DHCP (net0 52:54:00:12:34:56).... ok net0: 192.168.1.201/255.255.255.0 gw 192.168.1.1 Booting from filename "http://boot.kernel.org/bko/pxelinux.0" http://boot.kernel.org/bko/pxelinux.0. Not an executable image (0x2e008001) Could not boot from filename "http://boot.kernel.org/bko/pxelinux.0": Not an executable image (0x2e008001) No more network devices
The changes can be seen currently on the linux-ugly branch with just one monolithic commit.
During that work usermode gPXE helped me track down and fix two bugs: