https://xinu.cs.mu.edu/api.php?action=feedcontributions&user=Michael&feedformat=atomEmbedded Xinu - User contributions [en]2024-03-28T20:52:32ZUser contributionsMediaWiki 1.34.2https://xinu.cs.mu.edu/index.php?title=Raspberry_Pi&diff=3981Raspberry Pi2012-06-17T18:38:01Z<p>Michael: /* Booting */</p>
<hr />
<div>[[File:RaspberryPi.jpg|200px|right|thumb|A freshly unpacked Raspberry Pi with additional SDHC card.]]<br />
The [http://www.raspberrypi.org/ Raspberry Pi] (RPi) does exist, but while waiting for it to be delivered here are some notes to make it easier to begin porting Xinu to the platform. (Work in Progress)<br />
<br />
= Hardware =<br />
<br />
You will need the device itself. As of mid-March 2012, this can be ordered for ~$40 from [http://www.newark.com/ Newark/element14] or [http://www.rs-online.com/ RS Components] and only includes the board itself (no power supply, cables, or case).<br />
<br />
== Power Supply ==<br />
<br />
The RPi uses a fairly standard USB micro-B connector for power (only the power pins are physically present). It needs 700 mA at 5 V, so most computers or cell phone chargers should work. [http://elinux.org/RPi_Hardware_Basic_Setup#Power_Supply Embedded Linux source]<br />
<br />
== Serial Port ==<br />
<br />
The shipped RPi board doesn't come with a serial port attached (no surprise there). But it does have an expansion header that includes pin outs for a serial port (and more). The details can be found on the [http://elinux.org/Rpi_Low-level_peripherals Embedded Linux RPi] page. <strike>You will probably just want to solder on the full 2x13 pin header then deal with the outputs later incase you want to take advantage of the other pins.</strike> Turns out the board has the 2x13 header already soldered on (I guess it didn't add too much to the cost of production).<br />
<br />
The computer I used does not have a serial port on it, so I ended up getting a serial to USB converter from [https://www.sparkfun.com/products/718 Sparkfun], along with some [https://www.sparkfun.com/products/8430 jumper wires].<br />
<br />
{|<br />
|[[File:Raspi-before.jpg|thumb|400px|Raspberry Pi before connecting the serial port. The upper left corner is the 2x13 GPIO/serial/SPI header (the pins are 1 on the bottom and 2 on the top).]]<br />
|[[File:Raspi-after.jpg|thumb|400px|Raspberry Pi after connecting the serial port. Connections are to Raspi ground to serial ground, Raspi Tx to serial Rx, Raspi Rx to serial Tx.]]<br />
|}<br />
<br />
Once the serial transceiver board is wired up to the Raspberry Pi, connect a host system and use a terminal emulator (I used the [[Downloads|Xinu console tools]] `tty-connect`) with a baud rate of 115,200, 8 data bits, no parity, 1 stop bit. During the Raspberry Pi boot (of a Fedora kernel at least), you will be able to see kernel log messages emitted to the serial console. There isn't anything too exciting in the boot messages, but on my install the first few lines look like:<br />
<br />
<syntaxhighlight lang="text"><br />
[ 0.000000] Initializing cgroup subsys cpuset<br />
[ 0.000000] Initializing cgroup subsys cpu<br />
[ 0.000000] Linux version 3.1.9 (mockbuild@cdot-panda-5-4) (gcc version 4.5.1 20101112 (Red Hat 4.5.1-5) (GCC) ) #1 PREEMPT Sat Mar 3 21:58:00 UTC 2012<br />
[ 0.000000] CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cr=00c5387d<br />
[ 0.000000] CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache<br />
[ 0.000000] Machine: BCM2708<br />
[ 0.000000] Memory policy: ECC disabled, Data cache writeback<br />
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 48768<br />
[ 0.000000] Kernel command line: dma.dmachans=0x3c bcm2708_fb.fbwidth=720 bcm2708_fb.fbheight=480 bcm2708.boardrev=0x0<br />
bcm2708.serial=0x14be9109 smsc95xx.macaddr=B8:27:EB:BE:91:09 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200<br />
console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait<br />
</syntaxhighlight><br />
<br />
== SD Card ==<br />
<br />
You will want at least a Class 6 or above SD card (lower class cards have been known to have read failures). I (Michael) ordered two Kingston 8 GB Class 4 SDHC memory cards from Amazon. 8 GB is probably excessive, but they only cost ~$7 each, and if you intend to have a full Linux install available it might not be a bad idea to go for > 4 GB.<br />
<br />
= Software =<br />
<br />
Xinu is, of course, the target operating system for the RPi platform. However, there are some steps to take before we get there.<br />
<br />
== Booting ==<br />
<br />
Sadly the RPi does not come with a standard bootloader. Instead it simply boots off the SD card (and only the SD card) when power is applied, so a straight from the network boot is not an option. However, SD cards are low cost so you should be able to install a bootloader on the SD card that enables a network boot. It may "taint" the environment, but it shouldn't be horrible or worse than a typical boot loader.<br />
<br />
It looks like the grub bootloader should be able to support network booting [http://wiki.linuxmce.org/index.php/GRUB_PXE_network_boot Grub PXE network boot]. This is probably the most viable option, but other options may exist and work better for the RPi.<br />
<br />
The boot process seems to be as follows<ref name="rpiboot" />:<br />
<br />
* Power applied to the Raspberry Pi<br />
* Graphic Processor Unit (GPU) begins executing a stage 1 bootloader found in ROM on the chip<br />
* The stage 1 bootloader reads the SD card and loads stage 2 (<tt>/boot/bootcode.bin</tt>) into on-chip cache (L2)<br />
* GPU executes stage 2 bootloader which enables SDRAM and reads a stage 3 bootloader (<tt>/boot/loader.bin</tt>) into SDRAM<br />
* GPU executes stage 3 bootloader which understands how to read ELF files and reads the GPU firmware bootloader (<tt>/boot/start.elf</tt>)<br />
* <tt>/boot/start.elf</tt> reads <tt>/boot/config.txt</tt>, <tt>/boot/cmdline.txt</tt>, and <tt>/boot/kernel.img</tt><br />
* <tt>/boot/kernel.img</tt> is essentially the Linux zImage (i.e. ARM code), it contains some parameters in the first 32k but the rest is zImage proper<br />
<br />
The bootcode.bin, loader.bin, and start.elf files are all opaque to ARM programmers because they are GPU code files meaning we cannot change them. For Linux the <tt>kernel.img</tt> file is loaded starting at 0x00000000, which puts the start of Linux code (head.S) at 0x00008000<ref name="rpilinux" />. This file is built by the <tt>mkimage</tt><ref name="mkimage" /> tool associated with the Raspberry Pi distribution. It *should not* be needed for non-Linux code because it only attaches some special code that is used for Linux kernel parameter passing so the kernel doesn't need extra modifications<ref name="linux32k" />. As an example: [http://cgit.haiku-os.org/haiku/tree/src/system/boot/platform/raspberrypi_arm/entry.S HaikuOS] does not use the <tt>mkimage</tt> tool to get their kernel to boot.<br />
<br />
As mentioned above, to get a network boot working we should be able to make a new kernel.img file that enables serial port access and network access then copies and jumps to a known offset for execution. <strike>As a starting point [https://github.com/dwelch67/raspberrypi dwelch67] has something like this on github (though it seems to be very specific and not network oriented).</strike> It seems that [https://github.com/gonzoua/u-boot-pi/tree/rpi gonzoua] has added preliminary Raspberry Pi support for Das U-Boot, I have confirmed that it compiles and executes using my cross-compiler, moreover is can get an IP address and ping hosts. It should also be able to TFTP boot a kernel, but I haven't been able to confirm that yet (as my network configuration is a bit weird).<br />
<br />
To compile Das U-Boot, I ran two commands:<br />
<br />
<source lang="bash"><br />
$ make ARCH=arm CROSS_COMPILER=<cross-compiler location> raspberry_pi_config<br />
$ make ARCH=arm CROSS_COMPILER=<cross-compiler location><br />
</source><br />
<br />
Then copy the u-boot.bin file to the SD card as kernel.img, reboot and you should have serial access to U-Boot. Type `usb start` to bring up the USB subsystem (which includes the Ethernet adapter) and `dhcp` will acquire an IP address/tftp server (it might also attempt to download a boot image).<br />
<br />
= Command Line Information =<br />
<br />
== <tt>cat /proc/cpuinfo</tt> ==<br />
<br />
<syntaxhighlight lang="bash"><br />
Processor : ARMv6-compatible processor rev 7 (v6l)<br />
BogoMIPS : 697.95<br />
Features : swp half thumb fastmult vfp edsp java tls <br />
CPU implementer : 0x41<br />
CPU architecture: 7<br />
CPU variant : 0x0<br />
CPU part : 0xb76<br />
CPU revision : 7<br />
<br />
Hardware : BCM2708<br />
Revision : 0000<br />
Serial : 0000000014xxxxxx<br />
</syntaxhighlight><br />
<br />
== <tt>cat /proc/meminfo</tt> ==<br />
<br />
<syntaxhighlight lang="bash"><br />
MemTotal: 186540 kB<br />
MemFree: 130592 kB<br />
Buffers: 9552 kB<br />
Cached: 29360 kB<br />
SwapCached: 0 kB<br />
Active: 18404 kB<br />
Inactive: 29176 kB<br />
Active(anon): 9108 kB<br />
Inactive(anon): 4 kB<br />
Active(file): 9296 kB<br />
Inactive(file): 29172 kB<br />
Unevictable: 0 kB<br />
Mlocked: 0 kB<br />
HighTotal: 0 kB<br />
HighFree: 0 kB<br />
LowTotal: 186540 kB<br />
LowFree: 130592 kB<br />
SwapTotal: 0 kB<br />
SwapFree: 0 kB<br />
Dirty: 24 kB<br />
Writeback: 0 kB<br />
AnonPages: 8680 kB<br />
Mapped: 10476 kB<br />
Shmem: 448 kB<br />
Slab: 5648 kB<br />
SReclaimable: 2816 kB<br />
SUnreclaim: 2832 kB<br />
KernelStack: 568 kB<br />
PageTables: 688 kB<br />
NFS_Unstable: 0 kB<br />
Bounce: 0 kB<br />
WritebackTmp: 0 kB<br />
CommitLimit: 93268 kB<br />
Committed_AS: 94416 kB<br />
VmallocTotal: 188416 kB<br />
VmallocUsed: 896 kB<br />
VmallocChunk: 186708 kB<br />
</syntaxhighlight><br />
<br />
= Platform =<br />
<br />
* [http://www.broadcom.com/products/BCM2835 BCM2835] SoC<br />
** Contains ARM 1176JZF-S processor ([http://infocenter.arm.com/help/topic/com.arm.doc.ddi0301h/DDI0301H_arm1176jzfs_r0p7_trm.pdf technical reference manual]; implements [http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0419c/index.html ARMv6] instruction set, you'll need to register with ARM for the PDF.)<br />
** [[File:BCM2835-Peripherals.pdf|Peripheral guide]] should cover making the serial port work<br />
* [http://www.smsc.com/index.php?tid=300&pid=135 SMSC LAN9512] USB Hub and 10/100 Ethernet<br />
<br />
= References =<br />
<references><br />
<ref name="rpiboot">http://www.raspberrypi.org/phpBB3/viewtopic.php?t=6685&p=85140</ref><br />
<ref name="rpilinux">https://github.com/raspberrypi/linux/issues/16</ref><br />
<ref name="mkimage">https://github.com/raspberrypi/tools/tree/master/mkimage</ref><br />
<ref name="linux32k">https://github.com/raspberrypi/tools/issues/2</ref><br />
</references></div>Michaelhttps://xinu.cs.mu.edu/index.php?title=Raspberry_Pi&diff=3980Raspberry Pi2012-06-07T03:13:55Z<p>Michael: /* Serial Port */ Added details about my serial port setup</p>
<hr />
<div>[[File:RaspberryPi.jpg|200px|right|thumb|A freshly unpacked Raspberry Pi with additional SDHC card.]]<br />
The [http://www.raspberrypi.org/ Raspberry Pi] (RPi) does exist, but while waiting for it to be delivered here are some notes to make it easier to begin porting Xinu to the platform. (Work in Progress)<br />
<br />
= Hardware =<br />
<br />
You will need the device itself. As of mid-March 2012, this can be ordered for ~$40 from [http://www.newark.com/ Newark/element14] or [http://www.rs-online.com/ RS Components] and only includes the board itself (no power supply, cables, or case).<br />
<br />
== Power Supply ==<br />
<br />
The RPi uses a fairly standard USB micro-B connector for power (only the power pins are physically present). It needs 700 mA at 5 V, so most computers or cell phone chargers should work. [http://elinux.org/RPi_Hardware_Basic_Setup#Power_Supply Embedded Linux source]<br />
<br />
== Serial Port ==<br />
<br />
The shipped RPi board doesn't come with a serial port attached (no surprise there). But it does have an expansion header that includes pin outs for a serial port (and more). The details can be found on the [http://elinux.org/Rpi_Low-level_peripherals Embedded Linux RPi] page. <strike>You will probably just want to solder on the full 2x13 pin header then deal with the outputs later incase you want to take advantage of the other pins.</strike> Turns out the board has the 2x13 header already soldered on (I guess it didn't add too much to the cost of production).<br />
<br />
The computer I used does not have a serial port on it, so I ended up getting a serial to USB converter from [https://www.sparkfun.com/products/718 Sparkfun], along with some [https://www.sparkfun.com/products/8430 jumper wires].<br />
<br />
{|<br />
|[[File:Raspi-before.jpg|thumb|400px|Raspberry Pi before connecting the serial port. The upper left corner is the 2x13 GPIO/serial/SPI header (the pins are 1 on the bottom and 2 on the top).]]<br />
|[[File:Raspi-after.jpg|thumb|400px|Raspberry Pi after connecting the serial port. Connections are to Raspi ground to serial ground, Raspi Tx to serial Rx, Raspi Rx to serial Tx.]]<br />
|}<br />
<br />
Once the serial transceiver board is wired up to the Raspberry Pi, connect a host system and use a terminal emulator (I used the [[Downloads|Xinu console tools]] `tty-connect`) with a baud rate of 115,200, 8 data bits, no parity, 1 stop bit. During the Raspberry Pi boot (of a Fedora kernel at least), you will be able to see kernel log messages emitted to the serial console. There isn't anything too exciting in the boot messages, but on my install the first few lines look like:<br />
<br />
<syntaxhighlight lang="text"><br />
[ 0.000000] Initializing cgroup subsys cpuset<br />
[ 0.000000] Initializing cgroup subsys cpu<br />
[ 0.000000] Linux version 3.1.9 (mockbuild@cdot-panda-5-4) (gcc version 4.5.1 20101112 (Red Hat 4.5.1-5) (GCC) ) #1 PREEMPT Sat Mar 3 21:58:00 UTC 2012<br />
[ 0.000000] CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cr=00c5387d<br />
[ 0.000000] CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache<br />
[ 0.000000] Machine: BCM2708<br />
[ 0.000000] Memory policy: ECC disabled, Data cache writeback<br />
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 48768<br />
[ 0.000000] Kernel command line: dma.dmachans=0x3c bcm2708_fb.fbwidth=720 bcm2708_fb.fbheight=480 bcm2708.boardrev=0x0<br />
bcm2708.serial=0x14be9109 smsc95xx.macaddr=B8:27:EB:BE:91:09 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200<br />
console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait<br />
</syntaxhighlight><br />
<br />
== SD Card ==<br />
<br />
You will want at least a Class 6 or above SD card (lower class cards have been known to have read failures). I (Michael) ordered two Kingston 8 GB Class 4 SDHC memory cards from Amazon. 8 GB is probably excessive, but they only cost ~$7 each, and if you intend to have a full Linux install available it might not be a bad idea to go for > 4 GB.<br />
<br />
= Software =<br />
<br />
Xinu is, of course, the target operating system for the RPi platform. However, there are some steps to take before we get there.<br />
<br />
== Booting ==<br />
<br />
Sadly the RPi does not come with a standard bootloader. Instead it simply boots off the SD card (and only the SD card) when power is applied, so a straight from the network boot is not an option. However, SD cards are low cost so you should be able to install a bootloader on the SD card that enables a network boot. It may "taint" the environment, but it shouldn't be horrible or worse than a typical boot loader.<br />
<br />
It looks like the grub bootloader should be able to support network booting [http://wiki.linuxmce.org/index.php/GRUB_PXE_network_boot Grub PXE network boot]. This is probably the most viable option, but other options may exist and work better for the RPi.<br />
<br />
The boot process seems to be as follows<ref name="rpiboot" />:<br />
<br />
* Power applied to the Raspberry Pi<br />
* Graphic Processor Unit (GPU) begins executing a stage 1 bootloader found in ROM on the chip<br />
* The stage 1 bootloader reads the SD card and loads stage 2 (<tt>/boot/bootcode.bin</tt>) into on-chip cache (L2)<br />
* GPU executes stage 2 bootloader which enables SDRAM and reads a stage 3 bootloader (<tt>/boot/loader.bin</tt>) into SDRAM<br />
* GPU executes stage 3 bootloader which understands how to read ELF files and reads the GPU firmware bootloader (<tt>/boot/start.elf</tt>)<br />
* <tt>/boot/start.elf</tt> reads <tt>/boot/config.txt</tt>, <tt>/boot/cmdline.txt</tt>, and <tt>/boot/kernel.img</tt><br />
* <tt>/boot/kernel.img</tt> is essentially the Linux zImage (i.e. ARM code), it contains some parameters in the first 32k but the rest is zImage proper<br />
<br />
The bootcode.bin, loader.bin, and start.elf files are all opaque to ARM programmers because they are GPU code files meaning we cannot change them. For Linux the <tt>kernel.img</tt> file is loaded starting at 0x00000000, which puts the start of Linux code (head.S) at 0x00008000<ref name="rpilinux" />. This file is built by the <tt>mkimage</tt><ref name="mkimage" /> tool associated with the Raspberry Pi distribution. It *should not* be needed for non-Linux code because it only attaches some special code that is used for Linux kernel parameter passing so the kernel doesn't need extra modifications<ref name="linux32k" />. As an example: [http://cgit.haiku-os.org/haiku/tree/src/system/boot/platform/raspberrypi_arm/entry.S HaikuOS] does not use the <tt>mkimage</tt> tool to get their kernel to boot.<br />
<br />
As mentioned above, to get a network boot working we should be able to make a new kernel.img file that enables serial port access and network access then copies and jumps to a known offset for execution. As a starting point [https://github.com/dwelch67/raspberrypi dwelch67] has something like this on github (though it seems to be very specific and not network oriented).<br />
<br />
= Command Line Information =<br />
<br />
== <tt>cat /proc/cpuinfo</tt> ==<br />
<br />
<syntaxhighlight lang="bash"><br />
Processor : ARMv6-compatible processor rev 7 (v6l)<br />
BogoMIPS : 697.95<br />
Features : swp half thumb fastmult vfp edsp java tls <br />
CPU implementer : 0x41<br />
CPU architecture: 7<br />
CPU variant : 0x0<br />
CPU part : 0xb76<br />
CPU revision : 7<br />
<br />
Hardware : BCM2708<br />
Revision : 0000<br />
Serial : 0000000014xxxxxx<br />
</syntaxhighlight><br />
<br />
== <tt>cat /proc/meminfo</tt> ==<br />
<br />
<syntaxhighlight lang="bash"><br />
MemTotal: 186540 kB<br />
MemFree: 130592 kB<br />
Buffers: 9552 kB<br />
Cached: 29360 kB<br />
SwapCached: 0 kB<br />
Active: 18404 kB<br />
Inactive: 29176 kB<br />
Active(anon): 9108 kB<br />
Inactive(anon): 4 kB<br />
Active(file): 9296 kB<br />
Inactive(file): 29172 kB<br />
Unevictable: 0 kB<br />
Mlocked: 0 kB<br />
HighTotal: 0 kB<br />
HighFree: 0 kB<br />
LowTotal: 186540 kB<br />
LowFree: 130592 kB<br />
SwapTotal: 0 kB<br />
SwapFree: 0 kB<br />
Dirty: 24 kB<br />
Writeback: 0 kB<br />
AnonPages: 8680 kB<br />
Mapped: 10476 kB<br />
Shmem: 448 kB<br />
Slab: 5648 kB<br />
SReclaimable: 2816 kB<br />
SUnreclaim: 2832 kB<br />
KernelStack: 568 kB<br />
PageTables: 688 kB<br />
NFS_Unstable: 0 kB<br />
Bounce: 0 kB<br />
WritebackTmp: 0 kB<br />
CommitLimit: 93268 kB<br />
Committed_AS: 94416 kB<br />
VmallocTotal: 188416 kB<br />
VmallocUsed: 896 kB<br />
VmallocChunk: 186708 kB<br />
</syntaxhighlight><br />
<br />
= Platform =<br />
<br />
* [http://www.broadcom.com/products/BCM2835 BCM2835] SoC<br />
** Contains ARM 1176JZF-S processor ([http://infocenter.arm.com/help/topic/com.arm.doc.ddi0301h/DDI0301H_arm1176jzfs_r0p7_trm.pdf technical reference manual]; implements [http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0419c/index.html ARMv6] instruction set, you'll need to register with ARM for the PDF.)<br />
** [[File:BCM2835-Peripherals.pdf|Peripheral guide]] should cover making the serial port work<br />
* [http://www.smsc.com/index.php?tid=300&pid=135 SMSC LAN9512] USB Hub and 10/100 Ethernet<br />
<br />
= References =<br />
<references><br />
<ref name="rpiboot">http://www.raspberrypi.org/phpBB3/viewtopic.php?t=6685&p=85140</ref><br />
<ref name="rpilinux">https://github.com/raspberrypi/linux/issues/16</ref><br />
<ref name="mkimage">https://github.com/raspberrypi/tools/tree/master/mkimage</ref><br />
<ref name="linux32k">https://github.com/raspberrypi/tools/issues/2</ref><br />
</references></div>Michaelhttps://xinu.cs.mu.edu/index.php?title=File:Raspi-after.jpg&diff=3979File:Raspi-after.jpg2012-06-07T03:02:40Z<p>Michael: </p>
<hr />
<div></div>Michaelhttps://xinu.cs.mu.edu/index.php?title=File:Raspi-before.jpg&diff=3978File:Raspi-before.jpg2012-06-07T02:59:34Z<p>Michael: </p>
<hr />
<div></div>Michaelhttps://xinu.cs.mu.edu/index.php?title=Raspberry_Pi&diff=3970Raspberry Pi2012-05-31T23:10:03Z<p>Michael: References to the bottom</p>
<hr />
<div>[[File:RaspberryPi.jpg|200px|right|thumb|A freshly unpacked Raspberry Pi with additional SDHC card.]]<br />
The [http://www.raspberrypi.org/ Raspberry Pi] (RPi) does exist, but while waiting for it to be delivered here are some notes to make it easier to begin porting Xinu to the platform. (Work in Progress)<br />
<br />
= Hardware =<br />
<br />
You will need the device itself. As of mid-March 2012, this can be ordered for ~$40 from [http://www.newark.com/ Newark/element14] or [http://www.rs-online.com/ RS Components] and only includes the board itself (no power supply, cables, or case).<br />
<br />
== Power Supply ==<br />
<br />
The RPi uses a fairly standard USB micro-B connector for power (only the power pins are physically present). It needs 700 mA at 5 V, so most computers or cell phone chargers should work. [http://elinux.org/RPi_Hardware_Basic_Setup#Power_Supply Embedded Linux source]<br />
<br />
== Serial Port ==<br />
<br />
The shipped RPi board doesn't come with a serial port attached (no surprise there). But it does have an expansion header that includes pin outs for a serial port (and more). The details can be found on the [http://elinux.org/Rpi_Low-level_peripherals Embedded Linux RPi] page. You will probably just want to solder on the full 2x13 pin header then deal with the outputs later incase you want to take advantage of the other pins.<br />
<br />
== SD Card ==<br />
<br />
You will want at least a Class 6 or above SD card (lower class cards have been known to have read failures). I (Michael) ordered two Kingston 8 GB Class 4 SDHC memory cards from Amazon. 8 GB is probably excessive, but they only cost ~$7 each, and if you intend to have a full Linux install available it might not be a bad idea to go for > 4 GB.<br />
<br />
= Software =<br />
<br />
Xinu is, of course, the target operating system for the RPi platform. However, there are some steps to take before we get there.<br />
<br />
== Booting ==<br />
<br />
Sadly the RPi does not come with a standard bootloader. Instead it simply boots off the SD card (and only the SD card) when power is applied, so a straight from the network boot is not an option. However, SD cards are low cost so you should be able to install a bootloader on the SD card that enables a network boot. It may "taint" the environment, but it shouldn't be horrible or worse than a typical boot loader.<br />
<br />
It looks like the grub bootloader should be able to support network booting [http://wiki.linuxmce.org/index.php/GRUB_PXE_network_boot Grub PXE network boot]. This is probably the most viable option, but other options may exist and work better for the RPi.<br />
<br />
The boot process seems to be as follows<ref name="rpiboot" />:<br />
<br />
* Power applied to the Raspberry Pi<br />
* Graphic Processor Unit (GPU) begins executing a stage 1 bootloader found in ROM on the chip<br />
* The stage 1 bootloader reads the SD card and loads stage 2 (<tt>/boot/bootcode.bin</tt>) into on-chip cache (L2)<br />
* GPU executes stage 2 bootloader which enables SDRAM and reads a stage 3 bootloader (<tt>/boot/loader.bin</tt>) into SDRAM<br />
* GPU executes stage 3 bootloader which understands how to read ELF files and reads the GPU firmware bootloader (<tt>/boot/start.elf</tt>)<br />
* <tt>/boot/start.elf</tt> reads <tt>/boot/config.txt</tt>, <tt>/boot/cmdline.txt</tt>, and <tt>/boot/kernel.img</tt><br />
* <tt>/boot/kernel.img</tt> is essentially the Linux zImage (i.e. ARM code), it contains some parameters in the first 32k but the rest is zImage proper<br />
<br />
The bootcode.bin, loader.bin, and start.elf files are all opaque to ARM programmers because they are GPU code files meaning we cannot change them. For Linux the <tt>kernel.img</tt> file is loaded starting at 0x00000000, which puts the start of Linux code (head.S) at 0x00008000<ref name="rpilinux" />. This file is built by the <tt>mkimage</tt><ref name="mkimage" /> tool associated with the Raspberry Pi distribution. It *should not* be needed for non-Linux code because it only attaches some special code that is used for Linux kernel parameter passing so the kernel doesn't need extra modifications<ref name="linux32k" />. As an example: [http://cgit.haiku-os.org/haiku/tree/src/system/boot/platform/raspberrypi_arm/entry.S HaikuOS] does not use the <tt>mkimage</tt> tool to get their kernel to boot.<br />
<br />
As mentioned above, to get a network boot working we should be able to make a new kernel.img file that enables serial port access and network access then copies and jumps to a known offset for execution. As a starting point [https://github.com/dwelch67/raspberrypi dwelch67] has something like this on github (though it seems to be very specific and not network oriented).<br />
<br />
= Command Line Information =<br />
<br />
== <tt>cat /proc/cpuinfo</tt> ==<br />
<br />
<syntaxhighlight lang="bash"><br />
Processor : ARMv6-compatible processor rev 7 (v6l)<br />
BogoMIPS : 697.95<br />
Features : swp half thumb fastmult vfp edsp java tls <br />
CPU implementer : 0x41<br />
CPU architecture: 7<br />
CPU variant : 0x0<br />
CPU part : 0xb76<br />
CPU revision : 7<br />
<br />
Hardware : BCM2708<br />
Revision : 0000<br />
Serial : 0000000014xxxxxx<br />
</syntaxhighlight><br />
<br />
== <tt>cat /proc/meminfo</tt> ==<br />
<br />
<syntaxhighlight lang="bash"><br />
MemTotal: 186540 kB<br />
MemFree: 130592 kB<br />
Buffers: 9552 kB<br />
Cached: 29360 kB<br />
SwapCached: 0 kB<br />
Active: 18404 kB<br />
Inactive: 29176 kB<br />
Active(anon): 9108 kB<br />
Inactive(anon): 4 kB<br />
Active(file): 9296 kB<br />
Inactive(file): 29172 kB<br />
Unevictable: 0 kB<br />
Mlocked: 0 kB<br />
HighTotal: 0 kB<br />
HighFree: 0 kB<br />
LowTotal: 186540 kB<br />
LowFree: 130592 kB<br />
SwapTotal: 0 kB<br />
SwapFree: 0 kB<br />
Dirty: 24 kB<br />
Writeback: 0 kB<br />
AnonPages: 8680 kB<br />
Mapped: 10476 kB<br />
Shmem: 448 kB<br />
Slab: 5648 kB<br />
SReclaimable: 2816 kB<br />
SUnreclaim: 2832 kB<br />
KernelStack: 568 kB<br />
PageTables: 688 kB<br />
NFS_Unstable: 0 kB<br />
Bounce: 0 kB<br />
WritebackTmp: 0 kB<br />
CommitLimit: 93268 kB<br />
Committed_AS: 94416 kB<br />
VmallocTotal: 188416 kB<br />
VmallocUsed: 896 kB<br />
VmallocChunk: 186708 kB<br />
</syntaxhighlight><br />
<br />
= Platform =<br />
<br />
* [http://www.broadcom.com/products/BCM2835 BCM2835] SoC<br />
** Contains ARM 1176JZF-S processor ([http://infocenter.arm.com/help/topic/com.arm.doc.ddi0301h/DDI0301H_arm1176jzfs_r0p7_trm.pdf technical reference manual]; implements [http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0419c/index.html ARMv6] instruction set, you'll need to register with ARM for the PDF.)<br />
** [[File:BCM2835-Peripherals.pdf|Peripheral guide]] should cover making the serial port work<br />
* [http://www.smsc.com/index.php?tid=300&pid=135 SMSC LAN9512] USB Hub and 10/100 Ethernet<br />
<br />
= References =<br />
<references><br />
<ref name="rpiboot">http://www.raspberrypi.org/phpBB3/viewtopic.php?t=6685&p=85140</ref><br />
<ref name="rpilinux">https://github.com/raspberrypi/linux/issues/16</ref><br />
<ref name="mkimage">https://github.com/raspberrypi/tools/tree/master/mkimage</ref><br />
<ref name="linux32k">https://github.com/raspberrypi/tools/issues/2</ref><br />
</references></div>Michaelhttps://xinu.cs.mu.edu/index.php?title=Raspberry_Pi&diff=3969Raspberry Pi2012-05-31T23:09:13Z<p>Michael: /* Boot */ Added more boot time info.</p>
<hr />
<div>[[File:RaspberryPi.jpg|200px|right|thumb|A freshly unpacked Raspberry Pi with additional SDHC card.]]<br />
The [http://www.raspberrypi.org/ Raspberry Pi] (RPi) does exist, but while waiting for it to be delivered here are some notes to make it easier to begin porting Xinu to the platform. (Work in Progress)<br />
<br />
= Hardware =<br />
<br />
You will need the device itself. As of mid-March 2012, this can be ordered for ~$40 from [http://www.newark.com/ Newark/element14] or [http://www.rs-online.com/ RS Components] and only includes the board itself (no power supply, cables, or case).<br />
<br />
== Power Supply ==<br />
<br />
The RPi uses a fairly standard USB micro-B connector for power (only the power pins are physically present). It needs 700 mA at 5 V, so most computers or cell phone chargers should work. [http://elinux.org/RPi_Hardware_Basic_Setup#Power_Supply Embedded Linux source]<br />
<br />
== Serial Port ==<br />
<br />
The shipped RPi board doesn't come with a serial port attached (no surprise there). But it does have an expansion header that includes pin outs for a serial port (and more). The details can be found on the [http://elinux.org/Rpi_Low-level_peripherals Embedded Linux RPi] page. You will probably just want to solder on the full 2x13 pin header then deal with the outputs later incase you want to take advantage of the other pins.<br />
<br />
== SD Card ==<br />
<br />
You will want at least a Class 6 or above SD card (lower class cards have been known to have read failures). I (Michael) ordered two Kingston 8 GB Class 4 SDHC memory cards from Amazon. 8 GB is probably excessive, but they only cost ~$7 each, and if you intend to have a full Linux install available it might not be a bad idea to go for > 4 GB.<br />
<br />
= Software =<br />
<br />
Xinu is, of course, the target operating system for the RPi platform. However, there are some steps to take before we get there.<br />
<br />
== Booting ==<br />
<br />
Sadly the RPi does not come with a standard bootloader. Instead it simply boots off the SD card (and only the SD card) when power is applied, so a straight from the network boot is not an option. However, SD cards are low cost so you should be able to install a bootloader on the SD card that enables a network boot. It may "taint" the environment, but it shouldn't be horrible or worse than a typical boot loader.<br />
<br />
It looks like the grub bootloader should be able to support network booting [http://wiki.linuxmce.org/index.php/GRUB_PXE_network_boot Grub PXE network boot]. This is probably the most viable option, but other options may exist and work better for the RPi.<br />
<br />
The boot process seems to be as follows<ref name="rpiboot" />:<br />
<br />
* Power applied to the Raspberry Pi<br />
* Graphic Processor Unit (GPU) begins executing a stage 1 bootloader found in ROM on the chip<br />
* The stage 1 bootloader reads the SD card and loads stage 2 (<tt>/boot/bootcode.bin</tt>) into on-chip cache (L2)<br />
* GPU executes stage 2 bootloader which enables SDRAM and reads a stage 3 bootloader (<tt>/boot/loader.bin</tt>) into SDRAM<br />
* GPU executes stage 3 bootloader which understands how to read ELF files and reads the GPU firmware bootloader (<tt>/boot/start.elf</tt>)<br />
* <tt>/boot/start.elf</tt> reads <tt>/boot/config.txt</tt>, <tt>/boot/cmdline.txt</tt>, and <tt>/boot/kernel.img</tt><br />
* <tt>/boot/kernel.img</tt> is essentially the Linux zImage (i.e. ARM code), it contains some parameters in the first 32k but the rest is zImage proper<br />
<br />
The bootcode.bin, loader.bin, and start.elf files are all opaque to ARM programmers because they are GPU code files meaning we cannot change them. For Linux the <tt>kernel.img</tt> file is loaded starting at 0x00000000, which puts the start of Linux code (head.S) at 0x00008000<ref name="rpilinux" />. This file is built by the <tt>mkimage</tt><ref name="mkimage" /> tool associated with the Raspberry Pi distribution. It *should not* be needed for non-Linux code because it only attaches some special code that is used for Linux kernel parameter passing so the kernel doesn't need extra modifications<ref name="linux32k" />. As an example: [http://cgit.haiku-os.org/haiku/tree/src/system/boot/platform/raspberrypi_arm/entry.S HaikuOS] does not use the <tt>mkimage</tt> tool to get their kernel to boot.<br />
<br />
As mentioned above, to get a network boot working we should be able to make a new kernel.img file that enables serial port access and network access then copies and jumps to a known offset for execution. As a starting point [https://github.com/dwelch67/raspberrypi dwelch67] has something like this on github (though it seems to be very specific and not network oriented).<br />
<br />
<references><br />
<ref name="rpiboot">http://www.raspberrypi.org/phpBB3/viewtopic.php?t=6685&p=85140</ref><br />
<ref name="rpilinux">https://github.com/raspberrypi/linux/issues/16</ref><br />
<ref name="mkimage">https://github.com/raspberrypi/tools/tree/master/mkimage</ref><br />
<ref name="linux32k">https://github.com/raspberrypi/tools/issues/2</ref><br />
</references><br />
<br />
= Command Line Information =<br />
<br />
== <tt>cat /proc/cpuinfo</tt> ==<br />
<br />
<syntaxhighlight lang="bash"><br />
Processor : ARMv6-compatible processor rev 7 (v6l)<br />
BogoMIPS : 697.95<br />
Features : swp half thumb fastmult vfp edsp java tls <br />
CPU implementer : 0x41<br />
CPU architecture: 7<br />
CPU variant : 0x0<br />
CPU part : 0xb76<br />
CPU revision : 7<br />
<br />
Hardware : BCM2708<br />
Revision : 0000<br />
Serial : 0000000014xxxxxx<br />
</syntaxhighlight><br />
<br />
== <tt>cat /proc/meminfo</tt> ==<br />
<br />
<syntaxhighlight lang="bash"><br />
MemTotal: 186540 kB<br />
MemFree: 130592 kB<br />
Buffers: 9552 kB<br />
Cached: 29360 kB<br />
SwapCached: 0 kB<br />
Active: 18404 kB<br />
Inactive: 29176 kB<br />
Active(anon): 9108 kB<br />
Inactive(anon): 4 kB<br />
Active(file): 9296 kB<br />
Inactive(file): 29172 kB<br />
Unevictable: 0 kB<br />
Mlocked: 0 kB<br />
HighTotal: 0 kB<br />
HighFree: 0 kB<br />
LowTotal: 186540 kB<br />
LowFree: 130592 kB<br />
SwapTotal: 0 kB<br />
SwapFree: 0 kB<br />
Dirty: 24 kB<br />
Writeback: 0 kB<br />
AnonPages: 8680 kB<br />
Mapped: 10476 kB<br />
Shmem: 448 kB<br />
Slab: 5648 kB<br />
SReclaimable: 2816 kB<br />
SUnreclaim: 2832 kB<br />
KernelStack: 568 kB<br />
PageTables: 688 kB<br />
NFS_Unstable: 0 kB<br />
Bounce: 0 kB<br />
WritebackTmp: 0 kB<br />
CommitLimit: 93268 kB<br />
Committed_AS: 94416 kB<br />
VmallocTotal: 188416 kB<br />
VmallocUsed: 896 kB<br />
VmallocChunk: 186708 kB<br />
</syntaxhighlight><br />
<br />
= Platform =<br />
<br />
* [http://www.broadcom.com/products/BCM2835 BCM2835] SoC<br />
** Contains ARM 1176JZF-S processor ([http://infocenter.arm.com/help/topic/com.arm.doc.ddi0301h/DDI0301H_arm1176jzfs_r0p7_trm.pdf technical reference manual]; implements [http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0419c/index.html ARMv6] instruction set, you'll need to register with ARM for the PDF.)<br />
** [[File:BCM2835-Peripherals.pdf|Peripheral guide]] should cover making the serial port work<br />
* [http://www.smsc.com/index.php?tid=300&pid=135 SMSC LAN9512] USB Hub and 10/100 Ethernet</div>Michaelhttps://xinu.cs.mu.edu/index.php?title=Raspberry_Pi&diff=3968Raspberry Pi2012-05-30T02:52:55Z<p>Michael: Added some command line info from Linux</p>
<hr />
<div>[[File:RaspberryPi.jpg|200px|right|thumb|A freshly unpacked Raspberry Pi with additional SDHC card.]]<br />
The [http://www.raspberrypi.org/ Raspberry Pi] (RPi) does exist, but while waiting for it to be delivered here are some notes to make it easier to begin porting Xinu to the platform. (Work in Progress)<br />
<br />
= Hardware =<br />
<br />
You will need the device itself. As of mid-March 2012, this can be ordered for ~$40 from [http://www.newark.com/ Newark/element14] or [http://www.rs-online.com/ RS Components] and only includes the board itself (no power supply, cables, or case).<br />
<br />
== Power Supply ==<br />
<br />
The RPi uses a fairly standard USB micro-B connector for power (only the power pins are physically present). It needs 700 mA at 5 V, so most computers or cell phone chargers should work. [http://elinux.org/RPi_Hardware_Basic_Setup#Power_Supply Embedded Linux source]<br />
<br />
== Serial Port ==<br />
<br />
The shipped RPi board doesn't come with a serial port attached (no surprise there). But it does have an expansion header that includes pin outs for a serial port (and more). The details can be found on the [http://elinux.org/Rpi_Low-level_peripherals Embedded Linux RPi] page. You will probably just want to solder on the full 2x13 pin header then deal with the outputs later incase you want to take advantage of the other pins.<br />
<br />
== SD Card ==<br />
<br />
You will want at least a Class 6 or above SD card (lower class cards have been known to have read failures). I (Michael) ordered two Kingston 8 GB Class 4 SDHC memory cards from Amazon. 8 GB is probably excessive, but they only cost ~$7 each, and if you intend to have a full Linux install available it might not be a bad idea to go for > 4 GB.<br />
<br />
= Software =<br />
<br />
Xinu is, of course, the target operating system for the RPi platform. However, there are some steps to take before we get there.<br />
<br />
== Network Boot ==<br />
<br />
Sadly the RPi does not come with a standard bootloader. Instead it simply boots off the SD card (and only the SD card) when power is applied, so a straight from the network boot is not an option. However, SD cards are low cost so you should be able to install a bootloader on the SD card that enables a network boot. It may "taint" the environment, but it shouldn't be horrible or worse than a typical boot loader.<br />
<br />
It looks like the grub bootloader should be able to support network booting [http://wiki.linuxmce.org/index.php/GRUB_PXE_network_boot Grub PXE network boot]. This is probably the most viable option, but other options may exist and work better for the RPi.<br />
<br />
= Command Line Information =<br />
<br />
== <tt>cat /proc/cpuinfo</tt> ==<br />
<br />
<syntaxhighlight lang="bash"><br />
Processor : ARMv6-compatible processor rev 7 (v6l)<br />
BogoMIPS : 697.95<br />
Features : swp half thumb fastmult vfp edsp java tls <br />
CPU implementer : 0x41<br />
CPU architecture: 7<br />
CPU variant : 0x0<br />
CPU part : 0xb76<br />
CPU revision : 7<br />
<br />
Hardware : BCM2708<br />
Revision : 0000<br />
Serial : 0000000014xxxxxx<br />
</syntaxhighlight><br />
<br />
== <tt>cat /proc/meminfo</tt> ==<br />
<br />
<syntaxhighlight lang="bash"><br />
MemTotal: 186540 kB<br />
MemFree: 130592 kB<br />
Buffers: 9552 kB<br />
Cached: 29360 kB<br />
SwapCached: 0 kB<br />
Active: 18404 kB<br />
Inactive: 29176 kB<br />
Active(anon): 9108 kB<br />
Inactive(anon): 4 kB<br />
Active(file): 9296 kB<br />
Inactive(file): 29172 kB<br />
Unevictable: 0 kB<br />
Mlocked: 0 kB<br />
HighTotal: 0 kB<br />
HighFree: 0 kB<br />
LowTotal: 186540 kB<br />
LowFree: 130592 kB<br />
SwapTotal: 0 kB<br />
SwapFree: 0 kB<br />
Dirty: 24 kB<br />
Writeback: 0 kB<br />
AnonPages: 8680 kB<br />
Mapped: 10476 kB<br />
Shmem: 448 kB<br />
Slab: 5648 kB<br />
SReclaimable: 2816 kB<br />
SUnreclaim: 2832 kB<br />
KernelStack: 568 kB<br />
PageTables: 688 kB<br />
NFS_Unstable: 0 kB<br />
Bounce: 0 kB<br />
WritebackTmp: 0 kB<br />
CommitLimit: 93268 kB<br />
Committed_AS: 94416 kB<br />
VmallocTotal: 188416 kB<br />
VmallocUsed: 896 kB<br />
VmallocChunk: 186708 kB<br />
</syntaxhighlight><br />
<br />
= Platform =<br />
<br />
* [http://www.broadcom.com/products/BCM2835 BCM2835] SoC<br />
** Contains ARM 1176JZF-S processor ([http://infocenter.arm.com/help/topic/com.arm.doc.ddi0301h/DDI0301H_arm1176jzfs_r0p7_trm.pdf technical reference manual]; implements [http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0419c/index.html ARMv6] instruction set, you'll need to register with ARM for the PDF.)<br />
** [[File:BCM2835-Peripherals.pdf|Peripheral guide]] should cover making the serial port work<br />
* [http://www.smsc.com/index.php?tid=300&pid=135 SMSC LAN9512] USB Hub and 10/100 Ethernet</div>Michaelhttps://xinu.cs.mu.edu/index.php?title=Raspberry_Pi&diff=3967Raspberry Pi2012-05-29T23:05:25Z<p>Michael: Ooooh, picture of a RPi!</p>
<hr />
<div>[[File:RaspberryPi.jpg|200px|right|thumb|A freshly unpacked Raspberry Pi with additional SDHC card.]]<br />
The [http://www.raspberrypi.org/ Raspberry Pi] (RPi) does exist, but while waiting for it to be delivered here are some notes to make it easier to begin porting Xinu to the platform. (Work in Progress)<br />
<br />
= Hardware =<br />
<br />
You will need the device itself. As of mid-March 2012, this can be ordered for ~$40 from [http://www.newark.com/ Newark/element14] or [http://www.rs-online.com/ RS Components] and only includes the board itself (no power supply, cables, or case).<br />
<br />
== Power Supply ==<br />
<br />
The RPi uses a fairly standard USB micro-B connector for power (only the power pins are physically present). It needs 700 mA at 5 V, so most computers or cell phone chargers should work. [http://elinux.org/RPi_Hardware_Basic_Setup#Power_Supply Embedded Linux source]<br />
<br />
== Serial Port ==<br />
<br />
The shipped RPi board doesn't come with a serial port attached (no surprise there). But it does have an expansion header that includes pin outs for a serial port (and more). The details can be found on the [http://elinux.org/Rpi_Low-level_peripherals Embedded Linux RPi] page. You will probably just want to solder on the full 2x13 pin header then deal with the outputs later incase you want to take advantage of the other pins.<br />
<br />
== SD Card ==<br />
<br />
You will want at least a Class 6 or above SD card (lower class cards have been known to have read failures). I (Michael) ordered two Kingston 8 GB Class 4 SDHC memory cards from Amazon. 8 GB is probably excessive, but they only cost ~$7 each, and if you intend to have a full Linux install available it might not be a bad idea to go for > 4 GB.<br />
<br />
= Software =<br />
<br />
Xinu is, of course, the target operating system for the RPi platform. However, there are some steps to take before we get there.<br />
<br />
== Network Boot ==<br />
<br />
Sadly the RPi does not come with a standard bootloader. Instead it simply boots off the SD card (and only the SD card) when power is applied, so a straight from the network boot is not an option. However, SD cards are low cost so you should be able to install a bootloader on the SD card that enables a network boot. It may "taint" the environment, but it shouldn't be horrible or worse than a typical boot loader.<br />
<br />
It looks like the grub bootloader should be able to support network booting [http://wiki.linuxmce.org/index.php/GRUB_PXE_network_boot Grub PXE network boot]. This is probably the most viable option, but other options may exist and work better for the RPi.<br />
<br />
= Platform =<br />
<br />
* [http://www.broadcom.com/products/BCM2835 BCM2835] SoC<br />
** Contains ARM 1176JZF-S processor ([http://infocenter.arm.com/help/topic/com.arm.doc.ddi0301h/DDI0301H_arm1176jzfs_r0p7_trm.pdf technical reference manual]; implements [http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0419c/index.html ARMv6] instruction set, you'll need to register with ARM for the PDF.)<br />
** [[File:BCM2835-Peripherals.pdf|Peripheral guide]] should cover making the serial port work<br />
* [http://www.smsc.com/index.php?tid=300&pid=135 SMSC LAN9512] USB Hub and 10/100 Ethernet</div>Michaelhttps://xinu.cs.mu.edu/index.php?title=File:RaspberryPi.jpg&diff=3966File:RaspberryPi.jpg2012-05-29T23:01:32Z<p>Michael: </p>
<hr />
<div></div>Michaelhttps://xinu.cs.mu.edu/index.php?title=User:Michael/Sandbox&diff=3948User:Michael/Sandbox2012-03-16T18:48:55Z<p>Michael: Created page with "<math>\frac{5}{n}</math>"</p>
<hr />
<div><math>\frac{5}{n}</math></div>Michaelhttps://xinu.cs.mu.edu/index.php?title=Raspberry_Pi&diff=3944Raspberry Pi2012-03-15T23:33:03Z<p>Michael: /* Platform */</p>
<hr />
<div>The [http://www.raspberrypi.org/ Raspberry Pi] (RPi) does exist, but while waiting for it to be delivered here are some notes to make it easier to begin porting Xinu to the platform. (Work in Progress)<br />
<br />
= Hardware =<br />
<br />
You will need the device itself. As of mid-March 2012, this can be ordered for ~$40 from [http://www.newark.com/ Newark/element14] or [http://www.rs-online.com/ RS Components] and only includes the board itself (no power supply, cables, or case).<br />
<br />
== Power Supply ==<br />
<br />
The RPi uses a fairly standard USB micro-B connector for power (only the power pins are physically present). It needs 700 mA at 5 V, so most computers or cell phone chargers should work. [http://elinux.org/RPi_Hardware_Basic_Setup#Power_Supply Embedded Linux source]<br />
<br />
== Serial Port ==<br />
<br />
The shipped RPi board doesn't come with a serial port attached (no surprise there). But it does have an expansion header that includes pin outs for a serial port (and more). The details can be found on the [http://elinux.org/Rpi_Low-level_peripherals Embedded Linux RPi] page. You will probably just want to solder on the full 2x13 pin header then deal with the outputs later incase you want to take advantage of the other pins.<br />
<br />
== SD Card ==<br />
<br />
You will want at least a Class 6 or above SD card (lower class cards have been known to have read failures). I (Michael) ordered two Kingston 8 GB Class 4 SDHC memory cards from Amazon. 8 GB is probably excessive, but they only cost ~$7 each, and if you intend to have a full Linux install available it might not be a bad idea to go for > 4 GB.<br />
<br />
= Software =<br />
<br />
Xinu is, of course, the target operating system for the RPi platform. However, there are some steps to take before we get there.<br />
<br />
== Network Boot ==<br />
<br />
Sadly the RPi does not come with a standard bootloader. Instead it simply boots off the SD card (and only the SD card) when power is applied, so a straight from the network boot is not an option. However, SD cards are low cost so you should be able to install a bootloader on the SD card that enables a network boot. It may "taint" the environment, but it shouldn't be horrible or worse than a typical boot loader.<br />
<br />
It looks like the grub bootloader should be able to support network booting [http://wiki.linuxmce.org/index.php/GRUB_PXE_network_boot Grub PXE network boot]. This is probably the most viable option, but other options may exist and work better for the RPi.<br />
<br />
= Platform =<br />
<br />
* [http://www.broadcom.com/products/BCM2835 BCM2835] SoC<br />
** Contains ARM 1176JZF-S processor ([http://infocenter.arm.com/help/topic/com.arm.doc.ddi0301h/DDI0301H_arm1176jzfs_r0p7_trm.pdf technical reference manual]; implements [http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0419c/index.html ARMv6] instruction set, you'll need to register with ARM for the PDF.)<br />
** [[File:BCM2835-Peripherals.pdf|Peripheral guide]] should cover making the serial port work<br />
* [http://www.smsc.com/index.php?tid=300&pid=135 SMSC LAN9512] USB Hub and 10/100 Ethernet</div>Michaelhttps://xinu.cs.mu.edu/index.php?title=File:BCM2835-Peripherals.pdf&diff=3943File:BCM2835-Peripherals.pdf2012-03-15T23:16:46Z<p>Michael: </p>
<hr />
<div></div>Michaelhttps://xinu.cs.mu.edu/index.php?title=Raspberry_Pi&diff=3942Raspberry Pi2012-03-15T23:15:33Z<p>Michael: Initial Raspberry Pi page</p>
<hr />
<div>The [http://www.raspberrypi.org/ Raspberry Pi] (RPi) does exist, but while waiting for it to be delivered here are some notes to make it easier to begin porting Xinu to the platform. (Work in Progress)<br />
<br />
= Hardware =<br />
<br />
You will need the device itself. As of mid-March 2012, this can be ordered for ~$40 from [http://www.newark.com/ Newark/element14] or [http://www.rs-online.com/ RS Components] and only includes the board itself (no power supply, cables, or case).<br />
<br />
== Power Supply ==<br />
<br />
The RPi uses a fairly standard USB micro-B connector for power (only the power pins are physically present). It needs 700 mA at 5 V, so most computers or cell phone chargers should work. [http://elinux.org/RPi_Hardware_Basic_Setup#Power_Supply Embedded Linux source]<br />
<br />
== Serial Port ==<br />
<br />
The shipped RPi board doesn't come with a serial port attached (no surprise there). But it does have an expansion header that includes pin outs for a serial port (and more). The details can be found on the [http://elinux.org/Rpi_Low-level_peripherals Embedded Linux RPi] page. You will probably just want to solder on the full 2x13 pin header then deal with the outputs later incase you want to take advantage of the other pins.<br />
<br />
== SD Card ==<br />
<br />
You will want at least a Class 6 or above SD card (lower class cards have been known to have read failures). I (Michael) ordered two Kingston 8 GB Class 4 SDHC memory cards from Amazon. 8 GB is probably excessive, but they only cost ~$7 each, and if you intend to have a full Linux install available it might not be a bad idea to go for > 4 GB.<br />
<br />
= Software =<br />
<br />
Xinu is, of course, the target operating system for the RPi platform. However, there are some steps to take before we get there.<br />
<br />
== Network Boot ==<br />
<br />
Sadly the RPi does not come with a standard bootloader. Instead it simply boots off the SD card (and only the SD card) when power is applied, so a straight from the network boot is not an option. However, SD cards are low cost so you should be able to install a bootloader on the SD card that enables a network boot. It may "taint" the environment, but it shouldn't be horrible or worse than a typical boot loader.<br />
<br />
It looks like the grub bootloader should be able to support network booting [http://wiki.linuxmce.org/index.php/GRUB_PXE_network_boot Grub PXE network boot]. This is probably the most viable option, but other options may exist and work better for the RPi.<br />
<br />
= Platform =<br />
<br />
* [http://www.broadcom.com/products/BCM2835 BCM2835] SoC (Peripheral Guide)<br />
* [http://www.smsc.com/index.php?tid=300&pid=135 SMSC LAN9512] USB Hub and 10/100 Ethernet</div>Michaelhttps://xinu.cs.mu.edu/index.php?title=XMMS&diff=3925XMMS2011-09-28T22:35:46Z<p>Michael: </p>
<hr />
<div>[[Image:Mms_full_02.jpg|thumb|400px|left|A full M&M jug.]]<br />
[[Image:XMMS-02-13-2008b.jpg|thumb|400px|left|The M&M jug from a more dramatic angle.]]<br />
M&M's are small candy coated milk chocolate delights that come in a rainbow of colors and several variations. The XINU Lab maintains a supply of these colorful treats so that members of the lab can make it through the hard days and long nights of XINU development.<br />
<br />
[[Image:145ozmm.jpg|thumb|200px|center|Reference shot for 3-45 oz bags of M&Ms in the jug.]]<br />
[[Image:Mms_full_01.jpg|thumb|300px|center|Reference shot for 4.5-56 oz bags of M&Ms in the jug.]]<br />
<br />
== Number of M&Ms in the jug ==<br />
<br />
After filling the M&M jug about halfway full, I wondered about how many M&Ms it held. A little investigation and I developed this program to provide the number of M&Ms given <math>n</math> ounces.<br />
<br />
=== mm.c ===<br />
Perhaps someone should port this to work with the [[XINU]] code base.<br />
<br />
<source lang="c"><br />
#include <stdio.h><br />
#include <stdlib.h><br />
<br />
void usage(char *prog);<br />
<br />
int main(int argc, char **argv)<br />
{<br />
int oz, mm;<br />
<br />
if (argc != 2)<br />
{<br />
usage(argv[0]);<br />
}<br />
<br />
oz = atoi(argv[1]);<br />
<br />
/* empirical evidence shows 500 M&Ms per pound */<br />
mm = 500 * (oz / 16);<br />
<br />
/* catch the remaining oz */<br />
mm += (31 * (oz % 16));<br />
<br />
/* technically it is 31.25 M&Ms per ounce */<br />
/* so add 1 M&M for every 4 ounces */<br />
mm += ((oz % 16) / 4);<br />
<br />
printf("There are approximately %d M&Ms in %d ounces.\n", mm, oz);<br />
<br />
return 0;<br />
}<br />
<br />
void usage(char *prog)<br />
{<br />
fprintf(stderr, "Usage: %s oz\n", prog);<br />
fprintf(stderr, " Calculate the number of M&Ms in oz ounces.\n");<br />
exit(1);<br />
}<br />
</source></div>Michaelhttps://xinu.cs.mu.edu/index.php?title=XMMS&diff=3924XMMS2011-09-28T22:35:14Z<p>Michael: </p>
<hr />
<div>[[Image:Mms_full_02.jpg|thumb|400px|left|A full M&M jug.]]<br />
[[Image:XMMS-02-13-2008b.jpg|thumb|400px|left|The M&M jug from a more dramatic angle.]]<br />
M&M's are small candy coated milk chocolate delights that come in a rainbow of colors and several variations. The XINU Lab maintains a supply of these colorful treats so that members of the lab can make it through the hard days and long nights of XINU development.<br />
<br />
[[Image:145ozmm.jpg|thumb|200px|center|Reference shot for 3-45 oz bags of M&Ms in the jug.]]<br />
[[Image:Mms_full_01.jpg|thumb|300px|center|Reference shot for 4.5-56 oz bags of M&Ms in the jug.]]<br />
<br />
== Number of M&Ms in the jug ==<br />
<br />
After filling the M&M jug about halfway full, I wondered about how many M&Ms it held. A little investigation and I developed this program to provide the number of M&Ms given <math>n</math> ounces.<br />
<br />
=== mm.c ===<br />
Perhaps someone should port this to work with the [[XINU]] code base.<br />
<br />
<source lang="c"><br />
#include <stdio.h><br />
#include <stdlib.h><br />
<br />
void usage(char *prog);<br />
<br />
int main(int argc, char **argv)<br />
{<br />
int oz, mm;<br />
<br />
if (argc != 2)<br />
{<br />
usage(argv[0]);<br />
}<br />
<br />
oz = atoi(argv[1]);<br />
<br />
/* empirical evidence shows 500 M&Ms per pound */<br />
mm = 500 * (oz / 16);<br />
<br />
/* catch the remaining oz */<br />
mm += (31 * (oz % 16));<br />
<br />
/* technically it is 31.25 M&Ms per ounce */<br />
/* so add 1 M&M for every 4 ounces */<br />
mm += ((oz % 16) / 4);<br />
<br />
printf("There are approximately %d M&Ms in %d ounces.\n", mm, oz);<br />
<br />
return 0;<br />
}<br />
<br />
void usage(char *prog)<br />
{<br />
fprintf(stderr, "Usage: %s oz\n", prog);<br />
fprintf(stderr, " Calculate the number of M&Ms in oz ounces.\n");<br />
exit(1);<br />
}<br />
</source><br />
<br />
<!-- Not spam --></div>Michaelhttps://xinu.cs.mu.edu/index.php?title=Backgrounds&diff=3911Backgrounds2011-08-02T19:22:14Z<p>Michael: Created page with '{|border="0" cellpadding="5" cellspacing="0" |- !Preview !Comments |- |250px |Photo by Chris Patrick |- |250px |Generated using [http...'</p>
<hr />
<div>{|border="0" cellpadding="5" cellspacing="0"<br />
|-<br />
!Preview<br />
!Comments<br />
|-<br />
|[[File:Compile.jpg|250px]]<br />
|Photo by Chris Patrick<br />
|-<br />
|[[File:Xinu-cloud.png|250px]]<br />
|Generated using [http://www.alphaworks.ibm.com/tech/wordcloud IBM Word Cloud Generator] via<br /><br />
<source lang="bash">find . -name '*.[chS]' -exec cat {} \; |<br />
java -jar ibm-word-cloud.jar -c config.txt -w 3000 -h 2000 > xinu-cloud.png</source><br />
|}</div>Michaelhttps://xinu.cs.mu.edu/index.php?title=File:Xinu-cloud.png&diff=3910File:Xinu-cloud.png2011-08-02T19:13:23Z<p>Michael: </p>
<hr />
<div></div>Michaelhttps://xinu.cs.mu.edu/index.php?title=File:Compile.jpg&diff=3909File:Compile.jpg2011-08-02T19:05:38Z<p>Michael: </p>
<hr />
<div></div>Michaelhttps://xinu.cs.mu.edu/index.php?title=MediaWiki:Sidebar&diff=3908MediaWiki:Sidebar2011-08-02T16:31:18Z<p>Michael: Docs should link to index not main.html</p>
<hr />
<div>* navigation<br />
** Main Page | Main Page<br />
** Special:Recentchanges | Recent Changes<br />
** Downloads | Downloads<br />
** http://xinu.mscs.mu.edu/docs/| Documentation<br />
** https://xinu.mscs.mu.edu/trac/ | Trac<br />
* links<br />
** http://www.mscs.mu.edu/~brylow/xinu/ | Xinu @ Marquette<br />
** http://www.mscs.mu.edu/ | MSCS Department<br />
** http://acm.mscs.mu.edu/ | Student ACM<br />
** http://www.mu.edu/ | Marquette University</div>Michaelhttps://xinu.cs.mu.edu/index.php?title=Main_Page&diff=3807Main Page2011-05-23T17:20:14Z<p>Michael: Removed upgrade message</p>
<hr />
<div>Embedded Xinu is an ongoing research and implementation project in the area of Operating Systems and Embedded Systems. Its goal is to port the [[Xinu|Xinu Operating System]] to the embedded MIPS platform. The current release supports Linksys WRT54GL and WRT160NL routers, as well as the Qemu virtual machine. While this project is still in progress, our laboratory environment and curriculum materials are already in use for courses in Operating Systems, Hardware Systems, Embedded Systems, Networking and Compilers.<br />
<br />
The Embedded Xinu project was conceived and is supervised by [http://www.mscs.mu.edu/~brylow/ Dr. Dennis Brylow] and is being conducted by both graduate and undergraduate students in the [[Systems Laboratory]] in the [http://www.mscs.mu.edu/ Math, Statistics, & Computer Science] department of [http://www.mu.edu/ Marquette University] in Milwaukee, Wisconsin. The first major phase of work on Embedded Xinu began in the Summer of 2006.<br />
<br />
Our project partners include [http://www.cse.buffalo.edu/~bina/ Dr. Bina Ramamurthy] at University of Buffalo (with whom we shared an [http://www.nsf.gov/pubs/2009/nsf09529/nsf09529.html NSF CCLI] grant), [http://cs.olemiss.edu/~ruth/wiki/doku.php Dr. Paul Ruth] at University of Mississippi, and [http://www.cs.purdue.edu/people/comer Dr. Doug Comer] (father of Xinu) at Purdue University.<br />
<br />
== Teaching With Embedded Xinu ==<br />
<br />
* Join us for the [http://www.cs.olemiss.edu/acmse2010/pdf/xinu.pdf Teaching With Embedded Xinu Workshop] at [http://www.cs.olemiss.edu/acmse2010/Home.htm ACMSE 2010] in Oxford, Mississippi (Ole Miss campus) April 15. This workshop will share ready-made curriculum resources that have been used successfully to teach hardware systems, operating systems, realtime/embedded systems, networking, and compilers with the Embedded Xinu platform at several colleges/universities. Commodity wireless router hardware or equivalent virtual machines, combined with freely-available software and tools, make for a powerful and flexible learning platform without having to fake any components. Come see what Nexos has to offer for your program.<br />
<br />
* For curriculum guidance on adopting or adapting Embedded Xinu for undergraduate coursework, see [[Teaching With Xinu]].<br />
<br />
== Building an Embedded Xinu Laboratory ==<br />
<br />
In this section we are developing instructions so that other groups can benefit from the work we are doing. These guides can be followed more or less in order to create a relatively inexpensive platform for a custom operating system. As our work develops further, there will be more Xinu-specific information.<br />
<br />
# Obtain a [[List of supported platforms|supported platform]].<br />
# [[HOWTO:Modify the Linksys hardware|Modify the Linksys hardware]] or [[HOWTO:Modify the ASUS hardware|Modify the ASUS hardware]]<br />
# [[HOWTO:Connect to a modified router|Connect to a modified router]]<br />
# [[HOWTO:Build Xinu|Build Xinu]]<br />
# [[HOWTO:Deploy Xinu|Deploy Xinu]]<br />
# (Optional) [[HOWTO:Build Backend Pool|Build a pool of backends]]<br />
<br />
== Other Embedded Xinu Information ==<br />
<br />
* MIPS [[processor]]<br />
* Main [[memory]]<br />
* [[Exception and Interrupt Handling]]<br />
* [[UART driver]]<br />
* [[TTY driver]]<br />
* [[Switch driver]]<br />
* [[Flash memory]]<br />
* [[EJTAG|Enhanced Joint Test Action Group]] debugger<br />
* [[Standard library]]<br />
* [[XinuPhone]] Internet telephony<br />
<br />
----<br />
<br />
<small><small><small>The Xinu Lab is brought to you in part by [[XMMS|M&M's]].</small></small></small><br />
<!--<br />
-->__NOTOC__<!-- Disable "Contents" box from showing --><!--<br />
-->__NOEDITSECTION__<!-- Disable [edit] from appearing --><!--<br />
--></div>Michaelhttps://xinu.cs.mu.edu/index.php?title=Main_Page&diff=3800Main Page2011-05-23T14:40:24Z<p>Michael: Server upgrade notice</p>
<hr />
<div>{| class="messagebox" style="background-color:#ffb;width:75%;border:1px solid #a60;margin:0 auto;"<br />
|-<br />
| style="font-size:16px;color: #a60;font-weight: bold;" | Embedded Xinu Server Maintenance<br />
|-<br />
| A systems upgrade is scheduled to begin at 3pm CDT today (May 23) and will hopefully be complete by 5pm.<br/>This message will be removed once the upgrade is complete.<br />
|}<br />
<br />
Embedded Xinu is an ongoing research and implementation project in the area of Operating Systems and Embedded Systems. Its goal is to port the [[Xinu|Xinu Operating System]] to the embedded MIPS platform. The current release supports Linksys WRT54GL and WRT160NL routers, as well as the Qemu virtual machine. While this project is still in progress, our laboratory environment and curriculum materials are already in use for courses in Operating Systems, Hardware Systems, Embedded Systems, Networking and Compilers.<br />
<br />
The Embedded Xinu project was conceived and is supervised by [http://www.mscs.mu.edu/~brylow/ Dr. Dennis Brylow] and is being conducted by both graduate and undergraduate students in the [[Systems Laboratory]] in the [http://www.mscs.mu.edu/ Math, Statistics, & Computer Science] department of [http://www.mu.edu/ Marquette University] in Milwaukee, Wisconsin. The first major phase of work on Embedded Xinu began in the Summer of 2006.<br />
<br />
Our project partners include [http://www.cse.buffalo.edu/~bina/ Dr. Bina Ramamurthy] at University of Buffalo (with whom we shared an [http://www.nsf.gov/pubs/2009/nsf09529/nsf09529.html NSF CCLI] grant), [http://cs.olemiss.edu/~ruth/wiki/doku.php Dr. Paul Ruth] at University of Mississippi, and [http://www.cs.purdue.edu/people/comer Dr. Doug Comer] (father of Xinu) at Purdue University.<br />
<br />
== Teaching With Embedded Xinu ==<br />
<br />
* Join us for the [http://www.cs.olemiss.edu/acmse2010/pdf/xinu.pdf Teaching With Embedded Xinu Workshop] at [http://www.cs.olemiss.edu/acmse2010/Home.htm ACMSE 2010] in Oxford, Mississippi (Ole Miss campus) April 15. This workshop will share ready-made curriculum resources that have been used successfully to teach hardware systems, operating systems, realtime/embedded systems, networking, and compilers with the Embedded Xinu platform at several colleges/universities. Commodity wireless router hardware or equivalent virtual machines, combined with freely-available software and tools, make for a powerful and flexible learning platform without having to fake any components. Come see what Nexos has to offer for your program.<br />
<br />
* For curriculum guidance on adopting or adapting Embedded Xinu for undergraduate coursework, see [[Teaching With Xinu]].<br />
<br />
== Building an Embedded Xinu Laboratory ==<br />
<br />
In this section we are developing instructions so that other groups can benefit from the work we are doing. These guides can be followed more or less in order to create a relatively inexpensive platform for a custom operating system. As our work develops further, there will be more Xinu-specific information.<br />
<br />
# Obtain a [[List of supported platforms|supported platform]].<br />
# [[HOWTO:Modify the Linksys hardware|Modify the Linksys hardware]] or [[HOWTO:Modify the ASUS hardware|Modify the ASUS hardware]]<br />
# [[HOWTO:Connect to a modified router|Connect to a modified router]]<br />
# [[HOWTO:Build Xinu|Build Xinu]]<br />
# [[HOWTO:Deploy Xinu|Deploy Xinu]]<br />
# (Optional) [[HOWTO:Build Backend Pool|Build a pool of backends]]<br />
<br />
== Other Embedded Xinu Information ==<br />
<br />
* MIPS [[processor]]<br />
* Main [[memory]]<br />
* [[Exception and Interrupt Handling]]<br />
* [[UART driver]]<br />
* [[TTY driver]]<br />
* [[Switch driver]]<br />
* [[Flash memory]]<br />
* [[EJTAG|Enhanced Joint Test Action Group]] debugger<br />
* [[Standard library]]<br />
* [[XinuPhone]] Internet telephony<br />
<br />
----<br />
<br />
<small><small><small>The Xinu Lab is brought to you in part by [[XMMS|M&M's]].</small></small></small><br />
<!--<br />
-->__NOTOC__<!-- Disable "Contents" box from showing --><!--<br />
-->__NOEDITSECTION__<!-- Disable [edit] from appearing --><!--<br />
--></div>Michaelhttps://xinu.cs.mu.edu/index.php?title=Main_Page&diff=3547Main Page2009-11-16T16:17:40Z<p>Michael: Rollback of badness</p>
<hr />
<div>Embedded Xinu is an ongoing research and implementation project in the area of Operating Systems and Embedded Systems. Its goal is to port the [[Xinu|Xinu Operating System]] to the MIPS platform by specifically targeting Linksys WRT54GL routers. While this project is still in progress, our prototype laboratory environment is already being used as the platform for courses<br />
in Operating Systems, Hardware Systems, Embedded Systems, and Compilers. We're also working on support for Networking and Internetworking classes.<br />
<br />
The Embedded Xinu project was conceived and is supervised by [http://www.mscs.mu.edu/~brylow/ Dr. Dennis Brylow] and is being conducted by both graduate and undergraduate students in the [http://www.mscs.mu.edu/ Math, Statistics, & Computer Science] department of [http://www.mu.edu/ Marquette University] in Milwaukee, Wisconsin. The first major phase of work on Embedded Xinu began in the Summer of 2006.<br />
<br />
== Building an Embedded Xinu Laboratory ==<br />
<br />
In this section we are developing instructions so that other groups can benefit from the work we are doing. These guides can be followed more or less in order to create a relatively inexpensive platform for a custom operating system. As our work develops further, there will be more Xinu-specific information.<br />
<br />
# Obtain a [[List of supported platforms|supported platform]].<br />
# [[HOWTO:Modify the Linksys hardware|Modify the Linksys hardware]]<br />
# [[HOWTO:Connect to a modified router|Connect to a modified router]]<br />
# [[HOWTO:Build Xinu|Build Xinu]]<br />
# [[HOWTO:Deploy Xinu|Deploy Xinu]]<br />
# (Optional) [[HOWTO:Build Backend Pool|Build a pool of backends]]<br />
<br />
== Other Embedded Xinu Information ==<br />
<br />
* MIPS [[processor]]<br />
* Main [[memory]]<br />
* [[Exception and Interrupt Handling]]<br />
* [[UART driver]]<br />
* [[TTY driver]]<br />
* [[Switch driver]]<br />
* [[Flash memory]]<br />
* [[EJTAG|Enhanced Joint Test Action Group]] debugger<br />
* [[Standard library]]<br />
<br />
----<br />
<br />
<small><small><small>The Xinu Lab is brought to you in part by [[XMMS|M&M's]].</small></small></small><br />
<!--<br />
-->__NOTOC__<!-- Disable "Contents" box from showing --><!--<br />
-->__NOEDITSECTION__<!-- Disable [edit] from appearing --><!--<br />
--></div>Michaelhttps://xinu.cs.mu.edu/index.php?title=Main_Page&diff=3546Main Page2009-11-16T16:15:41Z<p>Michael: </p>
<hr />
<div></div>Michaelhttps://xinu.cs.mu.edu/index.php?title=Main_Page&diff=3545Main Page2009-11-16T16:14:50Z<p>Michael: </p>
<hr />
<div></div>Michaelhttps://xinu.cs.mu.edu/index.php?title=Main_Page&diff=3544Main Page2009-11-16T16:10:57Z<p>Michael: </p>
<hr />
<div></div>Michaelhttps://xinu.cs.mu.edu/index.php?title=Downloads&diff=3504Downloads2009-08-13T18:04:40Z<p>Michael: /* Embedded XINU */ Now /* Embedded Xinu */!</p>
<hr />
<div>== Embedded Xinu ==<br />
<br />
The venerable [[Xinu|Xinu operating system]] has been used in classrooms, research labs, and commercial development firms for nearly a quarter of a century. Reimplemented in ANSI standard C, targeted to a modern RISC architecture, and optimized for resource-scarce embedded systems, Embedded Xinu is rested, relaxed, and ready to go for the next quarter century.<br />
<br />
The current version includes (1.5 features in '''bold'''):<br />
* Process management primitives<br />
* Preemptive multitasking<br />
* Priority-based scheduling<br />
* Semaphore synchronization<br />
* Message-passing interprocess communication<br />
* Sleep and wake<br />
* Dynamic memory allocation<br />
* Synchronous and asynchronous serial drivers<br />
* Buffered I/O<br />
* Device-independent I/O layer <br />
* Embedded MIPS32 loader<br />
* Interactive shell with basic commands<br />
* '''Wired network driver'''<br />
* '''Programmable network switch (Using [[w:IEEE 802.1Q|IEEE 802.1Q]])'''<br />
<br />
=== Downloads ===<br />
<br />
{|cellpadding="2"<br />
! Version<br />
! Download Link<br />
! Checksum (SHA1)<br />
|-style="background-color: #efefef"<br />
| rowspan="2" | Embedded Xinu 1.5 (latest)<br />
| style="text-align:center" | [http://www.mscs.mu.edu/~brylow/xinu/xinu_mips-latest.tar.gz gzip]<br />
| f9cb6020367352afde13c8cfa81eead0105bab04<br />
|-style="background-color: #efefef"<br />
| style="text-align:center" | [http://www.mscs.mu.edu/~brylow/xinu/xinu_mips-latest.tar.bz2 bzip2]<br />
| d98102ada671aab7dbc98035466ee309f7416c60<br />
|-style="background-color: #fdfdfd"<br />
| rowspan="2" | Embedded Xinu 1.0.2<br />
| style="text-align:center" | [http://www.mscs.mu.edu/~brylow/xinu/xinu_mips-1.0.2.tar.gz gzip]<br />
| cec8a3ce0ca444b65a81342f38c636edf31ec6f0<br />
|-style="background-color: #fdfdfd"<br />
| style="text-align:center" | [http://www.mscs.mu.edu/~brylow/xinu/xinu_mips-1.0.2.tar.bz2 bzip2]<br />
| 145c96f7ed8a9a9095b357e8c5e40b2645e33f7a<br />
|}<br />
<br />
== Xinu Console Tools ==<br />
<br />
The XINU Console Daemon and various associated utilities provide network clients with connectivity to backend consoles that are really only connected directly to the console host. The xinu-console software package is now freely available for UNIX console hosts and front end clients.<br />
<br />
(''Note: Information about the Windows version of the console tools can be found on the [[WinXINU]] page.'')<br />
<br />
=== Downloads ===<br />
<br />
{|<br />
! Version<br />
! Download Link<br />
|-<br />
| Xinu Console Tools 2.06 (Linux/Unix version)<br />
| [http://www.mscs.mu.edu/~brylow/xinu/xinu-console-latest.tar.gz gz] [http://www.mscs.mu.edu/~brylow/xinu/xinu-console-latest.src.rpm RPM]<br />
|-<br />
| Xinu Console Tools (Windows)<br />
| [[WinXINU/Installation|Installation]]<br />
|}</div>Michaelhttps://xinu.cs.mu.edu/index.php?title=Main_Page&diff=3502Main Page2009-08-13T17:58:45Z<p>Michael: Changed protection level for "Main Page" ([edit=autoconfirmed] (indefinite) [move=autoconfirmed] (indefinite))</p>
<hr />
<div>Embedded Xinu is an ongoing research and implementation project in the area of Operating Systems and Embedded Systems. Its goal is to port the [[Xinu|Xinu Operating System]] to the MIPS platform by specifically targeting Linksys WRT54GL routers. While this project is still in progress, our prototype laboratory environment is already being used as the platform for courses<br />
in Operating Systems, Hardware Systems, Embedded Systems, and Compilers. We're also working on support for Networking and Internetworking classes.<br />
<br />
The Embedded Xinu project was conceived and is supervised by [http://www.mscs.mu.edu/~brylow/ Dr. Dennis Brylow] and is being conducted by both graduate and undergraduate students in the [http://www.mscs.mu.edu/ Math, Statistics, & Computer Science] department of [http://www.mu.edu/ Marquette University] in Milwaukee, Wisconsin. The first major phase of work on Embedded Xinu began in the Summer of 2006.<br />
<br />
== Building an Embedded Xinu Laboratory ==<br />
<br />
In this section we are developing instructions so that other groups can benefit from the work we are doing. These guides can be followed more or less in order to create a relatively inexpensive platform for a custom operating system. As our work develops further, there will be more Xinu-specific information.<br />
<br />
# Obtain a [[List of supported platforms|supported platform]].<br />
# [[HOWTO:Modify the Linksys hardware|Modify the Linksys hardware]]<br />
# [[HOWTO:Connect to a modified router|Connect to a modified router]]<br />
# [[HOWTO:Build Xinu|Build Xinu]]<br />
# [[HOWTO:Deploy Xinu|Deploy Xinu]]<br />
# (Optional) [[HOWTO:Build Backend Pool|Build a pool of backends]]<br />
<br />
== Other Embedded Xinu Information ==<br />
<br />
* MIPS [[processor]]<br />
* Main [[memory]]<br />
* [[Exception and Interrupt Handling]]<br />
* [[UART driver]]<br />
* [[TTY driver]]<br />
* [[Flash memory]]<br />
* [[EJTAG|Enhanced Joint Test Action Group]] debugger<br />
* [[Standard library]]<br />
<br />
----<br />
<br />
<small><small><small>The Xinu Lab is brought to you in part by [[XMMS|M&M's]].</small></small></small><br />
<!--<br />
-->__NOTOC__<!-- Disable "Contents" box from showing --><!--<br />
-->__NOEDITSECTION__<!-- Disable [edit] from appearing --><!--<br />
--></div>Michaelhttps://xinu.cs.mu.edu/index.php?title=Quotes&diff=3495Quotes2009-08-03T23:33:05Z<p>Michael: /* Summer 2009 */ It seemed amusing at the time.</p>
<hr />
<div>== Summer 2009 ==<br />
<br />
* DB: "Why is this not working?" / MS: "Morbius is not promiscuous enough."<br />
* AM: "Isn't holy water hard to come by?"<br />
* DB: [Speaking about AM's meeting with CS] "We also don't recognize [Struble] as a valid commitment."<br />
* RB: "Don't just sit there and gloat at me."<br />
* RB: "Jokes don't really work right now. Sorry."<br />
* AM: "Ruining my body with one substance is enough."<br />
* AM: "I need someone to hold my hand when I go get a haircut."<br />
* AM: "Everyone sounds lame when they post on girls' walls."<br />
* AM: "I'm in Cudahy. I work here and live here."<br />
* DB: "Adam counts as -1." / AG: "Only one?"<br />
* ZL: "It sounds like crap but it corresponds."<br />
* DB: "I will be the supportive advisor this evening." / MS: [Sarcastically] "What a change."<br />
* AM: "In dangerous situations, that's when it's best to drink<br />
* AG: "Yeah. We played Wii bowling. And I learned how to play Magic." / DB: "Ohh noo. It's like supervoc being taking over by the mad man. Once SV7 is gone its all downhill."<br />
* DM: "Iran. Iraq. IRAW."<br />
* AG: "You can only flash something once." / ZL: "Clearly, because you get arrested after that."<br />
* AM: "I was rushing because I needed to be here by 3pm today."<br />
* MS: "He just put a hack on top of a hack on top of a hack." / AG: "You don't have a network stack, you have a network hack." / ZL: "You have a network pile."<br />
* AK: "Someone wrote on our table." / Anonymous: "Kill them."<br />
* DB: [Talking about hair] "That's not a matter of personal preference; that's correct."<br />
* AM: "There would be so many good quotes if we allowed f-words."<br />
* MS: [Speaking to DB's friends] "You might want to bring your own videos."<br />
* RB: "Oh no. It works consistently. It gets my hopes up only to shatter them."<br />
* ZL: "It's good. But.." / AG: "But, It looks like I cheated. ... You got to cheat sometimes."<br />
* DH: "Why would I doubt you, you are a student whose life depends on following the rules, I am only Director of a program which is supposed to enforce the rules."<br />
* AK: "Yeah. I'm pretty much done. I'm wasted."<br />
* AG: "I fear ugliness."<br />
* AM: "Chicks dig werewolves."<br />
* AM: "Computers should never take this long to do something unless its awesome." / GV: "Did you press the turbo button?"<br />
* RB: [To AM] "You're going to make some freaky girl very happy someday."<br />
* AG: "It looked like you were conducting an orchestra." / MS: "Well, I was composing an email."<br />
* RB: "I feel like I am using beta every time I log into Windows."<br />
<br />
== Spring 2009 ==<br />
<br />
* AM: "Do you really want me in charge of something that affects another human being?"<br />
* TB: "Sleep sounds amazing right now." / AM: "Oh my god...does it ever!"<br />
* ZL: "I'm all about making fun of people while they're in the room."<br />
* DB: "The Internet is a vast wasteland of sewage."<br />
* DB: "I won't say it's fixed, but I have now intervened on your behalf."<br />
* Zachary's Girlfriend: "Darn. I am taking on Brylow traits."<br />
* DB: "You can think of them as ornaments hung on a syntax tree."<br />
* AK: "purged Tim from nvram"<br />
* AK: "If you want some sort of base for how sick I still feel just insert a burst of coughing after each sentence while reading this email."<br />
* DB: "The rat gets nothing!"<br />
* AG: "My brain operates at 10,000 Gemberflops per second."<br />
* AG: "I'm not saying it's my opinion. I'm just saying its Adolph's opinion."<br />
* DB: "He's celebrating the month of feasting."<br />
* DB: "There's a special travel dispensation for pretzels."<br />
* CS: "I'm not very quotable."<br />
* AM: "Oh, it's travelling up in my butt."<br />
* AK: "I shut off Slayer while we are gone." / MS: "I'm sure Mawdryn will turn itself off, too."<br />
* AM: "My room mate never plays with me."<br />
* MS: "I just made a mess on the seat."<br />
* TB: "I don't need a haircut - I am representing myself at this conference."<br />
* AM: [Referring to high performance gum] "It is just like high performance computing: it's really really good for a really really short period of time."<br />
* AK: [Speaking to Brylow] "We just got out of Cracker Barrel and you are already eating pretzels."<br />
* AM: "Oh my God - Dinosaur World. We are skipping SIGCSE."<br />
* TB: "Yeah, my life is a joke sometimes."<br />
* TB: "One of these days I'll get English right."<br />
* Presenter at SIGCSE 2009: "I mean, it's kind of fun to trash your operating system."<br />
* TB: "I like to let my hair air-dry. It poofs better."<br />
* ZL: "I would not want Tim on my team for a game of telephone."<br />
* DB: "They're not pretzel rods, they're fuel rods."<br />
* DB: "But that's non-linear board usage. I never do that."<br />
* AK: "There's a lot more TODOs where those came from."<br />
* DB: [Said to an almost empty lab] "Aren't I paying a bunch of students to work for me?"<br />
* AM: "Aww we all got laser pointers! This is gonna rule!"<br />
* TB: "I thought I fixed everything doing nothing. It happens so many times."<br />
* [A discussion on going to the bar in a lab of all guys] / AG: "We're probably not as good looking as Victoria." / AM: "Yeah, and she has a boyfriend...but none of you have boyfriends."<br />
* DB: "Just for funsies."<br />
* TB: [As AM points a laser pointer at TB] "I feel like I'm being snipped."<br />
* Ryan Feil: [Speaking in the lab of an operating systems assignment] "Shouldn't there be more people here scrambling to get this done."<br />
* MS: [As DB writes "IP Stack" on the board] "Ha ha. He pees stack. IP urine."<br />
* ZL: "Really all we have right now are questions."<br />
* MS: [On a sheet of paper hidden among AM's homework] "#6. Thm: Adam sucks! Ha ha. / Pf: trivial."<br />
* ZL: "I should just source control my...everything."<br />
* DB: "English is not sufficient for teaching compilers."<br />
* TB: "That's it. It's 100 percent done."<br />
* TB: "We were 100 percent done. We just need to get more speed-up."<br />
* AG: "So, Tim, when you are 30, will you say your life is 100 percent done?"<br />
* AG: "make tim: now compiling nonsense.c"<br />
* DB: "Oh, here we go: proof by rant. That's a new one."<br />
* AM: "Do you really want me representing this school." / DB: [Out of context] "No."<br />
* AG: "If I leave the lab, I feel like I'm leaving civilization behind."<br />
* AG: [Browsing through Mike's wedding gift registry] "Xinu only has 50 threads. The sheets Mike wants have 410, but they don't have memory protection."<br />
* AK: "Oh good Brylow left. Now I can leave."<br />
* AK: [First commit message] "modified some ifthenelse stuff to look a little more like class" / [Second commit message] "removed the code I added to ifthenelse, it made no sense and didn't compile"<br />
* DB: [To a prospective student touring the System's Lab] "Ignore the rat."<br />
* MS: [Discussing DB's tests] "Why would you study for his test? You are either screwed or not screwed...it's fairly binary."<br />
* MS: [Left a message for AG] "I hax0rd your boxor!"<br />
* AM: "Oh look. She dumped me on Facebook. Awesome!"<br />
* DB: "Don't stroke the yeast colony."<br />
* MS: [Speaking of his yeast colony] "It's free!" / DB: "Don't release it!"<br />
* MS: "If I just get really offensive and harsh with what I say then I won't get quoted any more."<br />
* DB: "Alright, I'm going home. See you in the morning." / ZL: "The morning. Really?" / DB: "Well no."<br />
* MS: [Anticipating DB's response to new advisees] "You want to be my advisee. Kiss the clock."<br />
* MS: "It is much more important to see me being reamed up the ass."<br />
* JA: [Discussing potential names of Dan Mahoney's future son] "Name him your last name backwards so he can be a palindrome."<br />
* AK: "Big setup no follow through." / AG: "I'm all about that." / MS: "That's what she said."<br />
* DB: "That's not an algorithm; that's a sweatshop."<br />
* Lyndsie: "High school cheer leading is even on ESPN." / MS: "That is really sweet!"<br />
* AM: "I always assume that everyone in the world is just listening to me to talk. I also assume that people just follow me around just to listen to me."<br />
* AM: "Every time Tim opens his mouth to say something about the poster, you just close your eyes and pray."<br />
* DB: "This will all work out right? Induction through hand-waving."<br />
* DB: "Except it's like fake adoption, where it turns out the child is actually yours."<br />
* "If you're concerned about that you're probably in the wrong major, because we're going to build skynet."<br />
* DB: "So we are selling you to indentured servitude now?" / AM: "I hope so, then I get free passage to the new world."<br />
* DB: "Why do you work here?"<br />
* AM: "I have three desks worth of space just taken up with garbage and shit."<br />
* Anonymous: "You know, pretty soon that relationship will be 100% done."<br />
<br />
== Fall 2008 ==<br />
<br />
* MN: [Talking about the large rubber rat] "I don't get paid enough to have this thing look at me."<br />
* AK: "Now that grading's done, I deserve a pretzel."<br />
* AG: "I haven't even started, and I already feel defeated." / MS: "Welcome to graduate school."<br />
* ''RFC 793: Transmission Control Protocol'': "When the original SYN (pun intended) finally arrives at line 6, the synchronization proceeds normally."<br />
* AM: "If I think more than 30 seconds into my own future I start to panic."<br />
* AM: "Once again, I've solved the problem, but the computer has failed to see my genius."<br />
* DB: "It takes many years of sucky teaching to learn how to teach well. You have to start sucking somewhere."<br />
* TB: "When you get the packet it is all going to be out of order."<br />
* MS: "I was going to ask you what they stood for, but I knew the answer was: 'Get the hell out of my office Mike.'"<br />
* DB: "You have the plague now too?"<br />
* AK: "It was like Tim's brain on a piece of paper."<br />
* AK: "His abstract was words in a paint can and all he did was throw it on a poster."<br />
* TB: "Yeah, how did we get sidetracked." / AM: "I started talking."<br />
* DB: "Now US-41 through Terre Haute, that's the corridor of hell."<br />
* Zachary's Sister: [Upon visiting the Systems Lab] "It's like having six zacs."<br />
<br />
== Summer 2008 ==<br />
* linux-2.6.25.9/lib/iomap.c: Ugly macros are a way of life.<br />
* ../net/tcp/tcpTimer.c:101: error: ‘rum’ undeclared (first use in this function)<br />
* BH: "Vim has a learning curve." / MS: "No, it's a line."<br />
* MS: "[re: Firefox Plushie] Wow, that look more like a raccoon to me. And wouldn't that just make people position Linux Tux and Firefox Fux is various explicit positions? Or is that just me?" / DB: "Yes, Michael. It is just you. And I don't think the Firefox mascot's proper name is 'Fux.'"<br />
* JP: "I'm laughing because my nose itches."<br />
* JP: "I'm not going to start my own business. For a business to work, the owner has to care."<br />
* MS: "''Broken Beyond Syntax'', that's going to be the title of my autobiography."<br />
<br />
== Spring 2008 ==<br />
* JP: "I'm not saying it's my opinion, I'm just saying it's an opinion."<br />
* JP: "Yeah, that's just fool complicated."<br />
* AG: "Even Tim's pictures have bugs in them."<br />
* AK: "Warnings mean you are smarter than the compiler!"<br />
* AG: "Do you use text messaging?" / JP: "What's that?"<br />
* AG: "I feel like doing something. What should I do?" / PH: "Go home."<br />
* DB: "Any questions? What else have I forgotten to tell you?" (email to lab) / Response: "The XINU lab notes that you forgot to tell us that you love us."<br />
* DB: "Traditionally, graduate students get a bed to themselves in this situation."<br />
* PH: "I'm really going to enjoy watching the commits to this branch."<br />
* ZL: "Voc and Supervoc joined at the UART"<br />
* George Corliss: "Verbose. Minus 5."<br />
* Steve Merrill: "Publish! Publish! Publish!" (walking down the hall past junior faculty offices)<br />
* JP: "I am just participating cause I'm standing here."<br />
* JP: "New commands are silly."<br />
* JP: "I've solved all kinds of problems in my life that no one's ever solved before."<br />
* AG: "You know scheme. I know scheme. We all scheme for ice cream."<br />
* DB: "I like StarTrek, but that would be less a hobby and more an investment."<br />
* MS: "Subtract two." / MN: "Why?" / MS: "...because I said so." / MN: "...alright..." / MS: "...and then when that doesn't work subtract four. But two should work." / MN: "Two didn't work." / MS: "Damnit! Subtract four." (Conversation continues in a similar fashion until Matt ends up subtracting eight.)<br />
* DB: "So they basically made a hammer and went after everything that could be a nail."<br />
* JP: "This is so unfair to us petty criminals."<br />
* DB: "We'll all be getting eye transplants soon."<br />
* DB: "''I'' am somehow derived from C." (on the ubiquity of the C programming language)<br />
* JP: "First you have to get the $3,000 license for the whizbang that does all the work."<br />
* DB: "I don't remember what the silly window is, but it must be important."<br />
* AK: "[UML is] just a bunch of boxes on paper."<br />
* DB: "Java has corrupted you all."<br />
* KJ: "There are some fonts that ''really'' spread out a paper." (discussing parameters for COSC 198 term paper)<br />
* DB: "You're telling me to put in less work. I'm not going to argue with you."<br />
* ''See MIPS Run, 2nd Ed.'': "When we finally make contact with aliens, their wheelbarrows will have round wheels and their computers will probably use fixed-size pages."<br />
* ''RFC 826: An Ethernet Address Resolution Protocol'': "The world is a jungle in general, and the networking game contributes many animals."<br />
<br />
== XINU Pith ==<br />
* XINU Cometh.<br />
* XINU Returneth.<br />
* XINU Calls.<br />
* XINU Returns.<br />
* XINU Creates.<br />
* XINU Reschedules.<br />
* XINU Saves and Restores.<br />
* XINU Preempts.<br />
* XINU Comes Not to JUDGE, But to EXECUTE...<br />
* XINU Knows Your Inmost Firmware.<br />
* XINU Brings New Life to Old Hardware.<br />
* XINU Waits.<br />
* XINU Allocates.<br />
* XINU Deallocates Away.<br />
* XINU Tastes Great.<br />
* XINU Has Less Filling.<br />
* XINU Runs FOREVER.<br />
* XINU Eschews Obfuscation.<br />
* XINU Does Not Do Windows.<br />
* XINU Brings ORDER out of CHAOS.<br />
* XINU Brings CHAOS from ORDER.<br />
* He Whoever Believes in XINU Shall Have Eternal Processing.<br />
* XINU Shall Run Again.<br />
* XINU Is Not UNIX.<br />
* XINU. It's What's For Dinner.<br />
* No XINU and No Mips Make Homer Something Something...<br />
* See XINU. See XINU Run. Run XINU Run.<br />
* XINU Allocateth, XINU Deallocateth Away.<br />
<br />
== Abbreviations ==<br />
{|<br />
|-<br />
! Abbreviation || Name<br />
|-<br />
| AG || Aaron Gember<br />
|-<br />
| AK || Adam Koehler<br />
|-<br />
| AM || Adam Mallen<br />
|-<br />
| BH || Brandon Hahn<br />
|-<br />
| CS || Craig Struble<br />
|-<br />
| DB || Dennis (or Dr.) Brylow<br />
|-<br />
| DH || Doug Harris<br />
|-<br />
| DM || Dan Mahoney<br />
|-<br />
| GV || Gabe Van Eyck<br />
|-<br />
| JP || Justin Picotte<br />
|-<br />
| JA || Joe Pintozee<br />
|-<br />
| KJ || Kyle Jackson<br />
|-<br />
| MN || Matt Netkow<br />
|-<br />
| MS || Michael Schultz<br />
|-<br />
| PH || Paul Hinze<br />
|-<br />
| TB || Tim Blattner<br />
|-<br />
| ZL || Zachary Lund<br />
|-<br />
|}</div>Michaelhttps://xinu.cs.mu.edu/index.php?title=User:Michael&diff=3494User:Michael2009-07-31T00:49:39Z<p>Michael: /* Week of July 27 */ Merged safemem into trunk-2.0</p>
<hr />
<div>{| align="right" style="padding:0 5px;"<br />
| __TOC__<br />
|}<br />
<br />
Currently I am a in-between graduate student working at Marquette University. I have completed my thesis ([http://www.mscs.mu.edu/~mschul/files/thesis-2009.pdf Using Software Transactional Memory in Interrupt-Driven Systems]), but it was about one week late &mdash; so my graduation was pushed back to August 2009. At the end of the summer I will move to St. Louis and begin working on a Ph.D. in Computer Science at [http://www.wustl.edu Washington University].<br />
<br />
However, until then I am a research assistant for [http://www.mscs.mu.edu/~brylow/ Dr. Dennis Brylow]. At present I am continuing my research with software transactional memory and operating systems. In my spare geek time, I plan on fleshing out or starting up various parts of the Embedded Xinu O/S, as well as doing various administrative lab tasks.<br />
<br />
If you want more detailed information about me and my academic career you can visit the website of [http://www.mscs.mu.edu/~mschul/ Michael J. Schultz]!<br />
<br />
== Weekly Log (Summer 2009) ==<br />
<br />
=== Week of May 11 ===<br />
<br />
* Completed marriage transaction!<br />
* Generated user accounts for new Team Xinu members.<br />
* Reviewed a few papers, notably:<br />
** Liedtke, J. 1995. ''On <math>\mu</math>-kernel construction.'' SIGOPS Operating Systems Review 29, 5 (Dec. 1995), 237-250. DOI=http://doi.acm.org/10.1145/224057.224075 <br />
** Wentzlaff, D. and Agarwal, A. 2009. ''Factored operating systems (fos): the case for a scalable operating system for multicores.'' SIGOPS Operating Systems Review 43, 2 (Apr. 2009), 76-85. DOI=http://doi.acm.org/10.1145/1531793.1531805<br />
** Miller, F. W. ''Simple Memory Protection for Embedded Operating System Kernels.'' 2002 FREENIX Track Technical Program. URL=http://www.usenix.org/events/usenix02/tech/freenix/miller.html<br />
* Created [http://acm.mscs.mu.edu/wiki-reu/ Research Experiences for Undergraduates] wiki for MSCS REU students (and installed necessary extensions).<br />
* Updated all wikis to user MediaWiki 1.14.0 ([http://acm.mscs.mu.edu/wiki-adam/ Adam's Wiki], [http://acm.mscs.mu.edu/wiki-scifi/ BadSciFi Wiki], [http://acm.mscs.mu.edu/wiki-reu/ MSCS REU Wiki], [http://acm.mscs.mu.edu/ Student ACM Wiki], [http://xinu.mscs.mu.edu/ Embedded Xinu Wiki])<br />
* Updated the all important [http://www.mscs.mu.edu/~mschul/rpms/fortune/ fortune-sys-lab] package to 1.0.1-1 to include [[quotes]] through Spring 2009.<br />
* Began tinkering with KVM on Fedora 10 using [http://www.howtoforge.com/virtualization-with-kvm-on-a-fedora-10-server HowtoForge] (TODO: peruse [http://www.techotopia.com/index.php/Installing_and_Configuring_Fedora_KVM_Virtualization Techotopia] manuals, [http://fedoraproject.org/wiki/Virtualization_Quick_Start Fedora-Getting started with virtualization])<br />
<br />
=== Week of May 18 ===<br />
<br />
* Discussed [http://acm.mscs.mu.edu/wiki-reu/ REU Wiki] with REU students.<br />
* Wrote [[trac:Flash|Flash memory]] and [[trac:SafeMemory|memory protection]] pages to the trac wiki with deadlines and some information.<br />
* Worked on KVM a bit more (no success yet) -- it seems to fail to create the graphics properly which halts the installation process.<br />
* Created SVN account and branch for wireless driver developer.<br />
* Began some preliminary work on memory protection (moving to region based memory)<br />
<br />
=== Week of May 25 ===<br />
* Enjoyed some relaxation time in [[w:Galena,_Illinois|Galena]].<br />
<br />
=== Week of June 1 ===<br />
* Moved some essentials of life back to Milwaukee.<br />
* Updated/rebooted mawdryn (arg).<br />
* Discussed network stack with members of Team Xinu.<br />
* Reread and reviewed -- Wentzlaff, D. and Agarwal, A. 2009. ''Factored operating systems (fos): the case for a scalable operating system for multicores.'' SIGOPS Operating Systems Review 43, 2 (Apr. 2009), 76-85. DOI=http://doi.acm.org/10.1145/1531793.1531805.<br />
* Updated and submitted my [http://www.mscs.mu.edu/~mschul/files/thesis-2009.pdf thesis].<br />
* Looking for potential conference/journal matches to submit a paper to ([http://www.usenix.org/events/byname/ USENIX], [http://www.ieee.org/web/publications/journmag/index.html IEEE], [http://www.acm.org/publications/journals ACM Journals], and [http://portal.acm.org/browse_dl.cfm?linked=1&part=series&coll=ACM&dl=ACM ACM Conferences]).<br />
** Format: ''Full Conference Name'' (Abbr., deadline, page limit) -- [http://citeseer.ist.psu.edu/impact.html est. impact]<br />
** ''[http://www.plosworkshop.org/2009/ Workshop on Programming Languages and Operating Systems]'' (PLOS, 2009 Jun 19, 5 pages) -- unknown.<br />
** ''[http://www.usenix.org/events/hotos09/ Workshop on Hot Topics in Operating Systems]'' (HotOS, 2010 Jan, 5 pages) -- 34.<br />
** ''[http://eurosys2010.sigops-france.fr/calls.html European Conference on Computer Systems]'' (EuroSys, 2009 Oct 19, 12 pages) -- unknown.<br />
** ''[http://www.usenix.org/events/usenix09/ USENIX Annual Technical Conference]'' (USENIX, 2010 Jan, 14 pages long form, 6 pages short form) -- 7.<br />
** ''[http://www.embedded.rwth-aachen.de/tacas2009/ Tools and Algorithms for the Construction and Analysis of Systems]'' (TACAS, 2009 October, 15 pages) -- ~175.<br />
** ''[http://www.oopsla.org/oopsla2009/ Object-Oriented Programming Systems, Languages and Applications]'' (OOPSLA, 2010 Mar, 18 pages) -- 28.<br />
** <strike>''[http://www.sigplan.org/lctes.htm Languages, Compilers, and Tools for Embedded Systems]'' (LCTES, 2010 Feb, 10 pages) -- 404</strike>.<br />
** <strike>''[http://www.emsoft.org/ International Conference on Embedded Software]'' (EMSOFT, 2010 May, 10 pages) -- 390</strike>.<br />
** <strike>''[http://www.usenix.org/events/osdi08/cfp/ Operating Systems Design and Implementation]'' (OSDI, 2010 May, 14 pages) -- 1</strike>.<br />
** <strike>''[http://tocs.acm.org/ Transactions on Computer Systems]'' (TOCS, rolling?, $100/page?) -- 8</strike>.<br />
** <strike>''[http://www2.computer.org/portal/web/tc/ IEEE Transactions on Computers]'' (TC, look for special issue, 14 regular/8 brief pages) -- 361</strike>.<br />
** <strike>''[http://www2.computer.org/portal/web/tse/ IEEE Transactions on Software Engineering]'' (TSE, look for special issue, 14 regular/8 short pages) -- unknown</strike>.<br />
** <strike>''[http://www3.interscience.wiley.com/journal/1752/home Software: Practice and Experience]'' (SP&E, rolling?, 40 pages) -- 558</strike>.<br />
* Updated and assigned tasks on the [[trac:Flash|Flash]] page, now has Samsung specification and instructions for storing a Flash image to morbius.<br />
<br />
=== Week of June 8 ===<br />
* Got rejected.<br />
* Reduced conferences to look at for paper submissions.<br />
* Finished work on region based memory allocator. ([[tracsrc:mips/branches/safemem|source]])<br />
** Xinu now (inefficiently) allocates page sized memory when requests are made.<br />
* Read paper<br />
** Stitt, G., Chaudhari, G., and Coole, J. 2008. ''Traversal caches: a first step towards FPGA acceleration of pointer-based data structures''. In Proceedings of the 6th IEEE/ACM/IFIP international Conference on Hardware/Software Codesign and System Synthesis (Atlanta, GA, USA, October 19 - 24, 2008). CODES/ISSS '08. ACM, New York, NY, 61-66. DOI=http://doi.acm.org/10.1145/1450135.1450150 <br />
* Built page mapping/unmapping functionality into Xinu for virtual memory<br />
** TODOs now include:<br />
*** Hacking together TLB initialization and modification code.<br />
*** Correctly use TLB during context switch.<br />
*** Build system call interface and associated system call functions.<br />
*** Make distinction between user-/kernel-level threads and/or processes.<br />
<br />
=== Week of June 15 ===<br />
* Reviewed papers<br />
** Ryzhyk, L., Chubb, P., Kuz, I., and Heiser, G. 2009. ''Dingo: taming device drivers.'' In Proceedings of the Fourth ACM European Conference on Computer Systems (Nuremberg, Germany, April 01 - 03, 2009). EuroSys '09. DOI=http://doi.acm.org/10.1145/1519065.1519095.<br />
** Fuad Tabba, Mark Moir, James R. Goodman, Andrew W. Hay, and Cong Wang. ''NZTM: Nonblocking Zero-indirection Transactional Memory.'' In Proceedings of the 2009 Symposium on Parallelism in Algorithms and Architectures (Calgary, Alberta, Canada, August 11 - 13, 2009). SPAA '09. URI=http://www.virtutech.com/files/academics/spaa091-tabba.pdf.<br />
* System Administration<br />
** Upgraded to [http://lists.wikimedia.org/pipermail/mediawiki-announce/2009-June/000086.html MediaWiki 1.15.0] on [http://acm.mscs.mu.edu/wiki-adam/ Adam's Wiki], [http://acm.mscs.mu.edu/wiki-scifi/ BadSciFi Wiki], [http://acm.mscs.mu.edu/wiki-reu/ MSCS REU Wiki], [http://acm.mscs.mu.edu/ Student ACM Wiki], and [http://xinu.mscs.mu.edu/ Embedded Xinu Wiki].<br />
** Then proceeded to upgrade all the wikis to use a "continuous integration" process like [http://www.wikipedia.org/ Wikipedia] does, so now all the wikis should use the latest trunk version of MediaWiki.<br />
** Modified some settings for the SMI repository.<br />
** <strike>Began writing a</strike> Completed a draft document discussing what administration tasks there are with mulug (available in <code>/var/mulug/README</code>).<br />
* Memory Protection<br />
** Began looking into system call interface. I've decided Xinu was never meant to have user mode -> kernel mode syscalls (see 20.5 of ''Operating System Design''). Implying that the ancient SYSCALL type is a bit of a misnomer. Though the interface is possible (and fairly easy), it would require special wrapper functions around every call deemed to be a system call.<br />
<br />
=== Week of June 22 ===<br />
* Reviewed Paper<br />
** Maeda, S., Asano, S., Shimada, T., Awazu, K., and Tago, H. 2005. ''A Real-Time Software Platform for the Cell Processor''. IEEE Micro 25, 5 (Sep. 2005), 20-29. DOI=http://dx.doi.org/10.1109/MM.2005.79<br />
* Memory Protection<br />
** Filling out TLB EntryHi and EntryLo[0,1] fields with data from processes page table. Doesn't work. Getting Bus error exception with both fast (assembly) and slow (C) handlers.<br />
** Building a version of [http://www.openwrt.org/ OpenWRT] to (hopefully) dump and look at values in TLB.<br />
** Fixed above problem (right shift PFN 6 bits), I thought they were 'reserved' bits---I was wrong, it works now<br />
** Fixed a few other bugs to get TLB working consistently in mapped memory space<br />
** Began working on syscall interface, still needs testing.<br />
* Got some benchmarks to run with nepsim and told [http://acm.mscs.mu.edu/wiki-reu/index.php/User:Rberg Ryan] how to build nepsim on 64-bit machines (and execute without a segfault).<br />
* Helped with some computational sciences for high school teachers activities<br />
<br />
=== Week of June 29 ===<br />
* Reviewed paper<br />
** Klassner, F. and Continanza, C. 2007. ''Mindstorms without robotics: an alternative to simulations in systems courses.'' In Proceedings of the 38th SIGCSE Technical Symposium on Computer Science Education (Covington, Kentucky, USA, March 07 - 11, 2007). SIGCSE '07. ACM, New York, NY, 175-179. DOI=http://doi.acm.org/10.1145/1227310.1227372<br />
* Added syscall interface to safemem branch, now some cleanup work is necessary and a re-review of the files added. (+ commenting functions)<br />
* Tinkered with KVM on Fedora 11 (it seems to work well).<br />
* Helped find/fix various bugs in network stack.<br />
<br />
=== Week of July 6 ===<br />
* Began working on cleanup/documentation/confirmation of all memory related subsystems (region allocator, paging, tlb, syscall interface)<br />
** Stuck thinking about how to allocate the allocators. (Region based, byte based, malloc/memget, ...)<br />
* Read<br />
** Yang, X., Cooprider, N., and Regehr, J. 2009. ''Eliminating the call stack to save RAM.'' In Proceedings of the 2009 ACM SIGPLAN/SIGBED Conference on Languages, Compilers, and Tools For Embedded Systems (Dublin, Ireland, June 19 - 20, 2009). LCTES '09. ACM, New York, NY, 60-69. DOI=http://doi.acm.org/10.1145/1542452.1542461.<br />
* Adapted to Fedora 11 on mawdryn<br />
** Installed "morbius" virtual machine on mawdryn (doesn't have a MAC address in the database, so none of the standard configuration script ran.)<br />
* Went to Door County on Friday (sorry).<br />
<br />
=== Week of July 13 ===<br />
* Worked on memory allocator<br />
** Pages are allocated to a process (but not recovered until process is killed).<br />
** memget tries to allocate from the freelist of the current process, if enough memory doesn't exist it fetches another page (or pages) and allocates it to the process' freelist.<br />
** memfree simply returns a pointer with nbytes of memory to the process' freelist.<br />
** working on some bugs with memRegionReclaim when a process is killed.<br />
** corrected bug in reclaim<br />
** completed kernel/user allocators (still needs some testing)<br />
** memRegionTransfer should also move the memlist from process to process<br />
* Read paper<br />
** Takacs, G., Chandrasekhar, V., Gelfand, N., Xiong, Y., Chen, W., Bismpigiannis, T., Grzeszczuk, R., Pulli, K., and Girod, B. 2008. ''Outdoors augmented reality on mobile phone using loxel-based visual feature organization.'' In Proceeding of the 1st ACM international Conference on Multimedia information Retrieval (Vancouver, British Columbia, Canada, October 30 - 31, 2008). MIR '08. ACM, New York, NY, 427-434. DOI=http://doi.acm.org/10.1145/1460096.1460165.<br />
* Most importantly, I updated the Xinu banner for release of 2.0.<br />
____ ___.__ <br />
\ \/ /|__| ____ __ __ <br />
\ / | |/ \| | \ <br />
/ \ | | | \ | / <br />
/___/\ \|__|___| /____/ <br />
\_/ \/ v2.0 <br />
* Helped various people in the lab.<br />
<br />
=== Week of July 20 ===<br />
* Read paper for Tuesday<br />
** Quach, B., Balakrishnan, M., Benhaddou, D., and Yuan, X. 2009. ''Implementation of integrated wireless health monitoring network''. In Proceedings of the 1st ACM international Workshop on Medical-Grade Wireless Networks (New Orleans, Louisiana, USA, May 18 - 18, 2009). WiMD '09. ACM, New York, NY, 63-68. DOI=http://doi.acm.org/10.1145/1540373.1540390<br />
* Re-implemented safemem slightly<br />
** Now has a separate user heap (using malloc/free calls) and kernel heap (using memget/memfree)<br />
** User heap is of size #define UHEAP_SIZE (currently set to 8MB) in xinu.conf<br />
*** If UHEAP_SIZE is not defined, there is no user heap and malloc always returns NULL<br />
** Only user heap memory is mapped into page table<br />
** Since Embedded Xinu uses only memory protection, we use a single global page table holding the page table entry and address space identifier (thread id)<br />
** When a TLB exception occurs, the system attempts to load the page table entry<br />
*** If the entry is null or the current thread id is not the ASID for the entry, the thread is killed and outputs "Memory protection violation" to stderr<br />
** The entire kernel is mapped as read-only, global memory so any thread can read kernel memory, but not write to it.<br />
** The TLB can be enabled/disabled by defining/undefining the USE_TLB #define in xinu.conf<br />
** Entire user memory subsystem is in the mem/ folder with only four calls in the kernel (each protected with #ifdef UHEAP_SIZE)<br />
*** system/kill.c attempts to memRegionReclaim when the thread is killed.<br />
*** system/initialize.c acquires UHEAP_SIZE using memget, then attempts to initialize the memory subsystem with memInit (setup the user heap), safeInit (setup memory protection), and safeKmapInit (insert kernel mappings).<br />
** TLB initialized with one call in system/initialize.c protected by #ifdef USE_TLB with all TLB code residing in mem/ as well.<br />
* Helped various people in the lab.<br />
* Relaxed in Northern Wisconsin Thursday and Friday<br />
** Read paper for Tuesday<br />
*** Mankin, J., Kaeli, D., and Ardini, J. 2009. ''Software transactional memory for multicore embedded systems''. In Proceedings of the 2009 ACM SIGPLAN/SIGBED Conference on Languages, Compilers, and Tools For Embedded Systems (Dublin, Ireland, June 19 - 20, 2009). LCTES '09. ACM, New York, NY, 90-98. DOI=http://doi.acm.org/10.1145/1542452.1542465<br />
<br />
=== Week of July 27 ===<br />
* Wrote catalogue of activities from last week.<br />
* Began looking at some network code<br />
** Began getting sad.<br />
* Corrected bug in tlbMissHandler that would effectively disable interrupts<br />
** Originally when a memory violation occurred the handler would kill(thrcurrent), exlset(), and resched().<br />
*** Obviously this is incorrect. kill(thrcurrent) has a call to resched() in it and exlset doesn't allow exceptions to occur.<br />
** Now when a memory violation occurs the handler will exlreset() and kill(thrcurrent).<br />
* Moved around code in malloc and memRegionAlloc to more logically separate thread based memory and region based memory.<br />
** memRegionAlloc will allocate the region and return the region allocated to the caller.<br />
** malloc tries to allocate memory from thread->memlist, then tries a memRegionAlloc and inserts remaining memory in thread->memlist<br />
* Expanded the Embedded Xinu [[memory]] page by 30%!<br />
** Fleshed out the [[flash memory]], [[TRX header]], [[flash driver]], and [[memory management]] pages.<br />
* Placed the PlayStation 3 in the rack and connected it.<br />
** Installed (pre-built) powerpc cross compiler on mawdryn, it seems to build correct binaries.<br />
* Attempted to merge the safemem branch into trunk-2.0. Failed.<br />
** Corrected mis-allocation (skip accounting info) bug in malloc<br />
** Corrected unbalanced disable/restore bug in malloc<br />
** Wrapped memRegionFree into free(), since it does not deal with memory regions, just thread->memlist<br />
** '''Succeeded'''. [[tracsrc:mips/branches/safemem|safemem]] is now integrated in [[tracsrc:mips/branches/trunk-2.0|trunk-2.0]]<br />
*** if any bugs arise, they should be reported on trac, and disabling safe mem is fairly simple<br />
**** <code>compile/xinu.conf</code>: comment out the UHEAP_SIZE and USE_TLB #defines<br />
**** <code>compile/Makefile</code>: remove the "mem" component<br />
**** <code>lib/libxc/Makefile</code>: uncomment "CFILES += malloc.c free.c" (line 29)<br />
**** Now you should have the more "traditional" memory system ;)<br />
<br />
=== Week of August 3 ===</div>Michaelhttps://xinu.cs.mu.edu/index.php?title=User:Michael&diff=3493User:Michael2009-07-30T21:05:39Z<p>Michael: /* Week of July 27 */ Merging and bugfixes</p>
<hr />
<div>{| align="right" style="padding:0 5px;"<br />
| __TOC__<br />
|}<br />
<br />
Currently I am a in-between graduate student working at Marquette University. I have completed my thesis ([http://www.mscs.mu.edu/~mschul/files/thesis-2009.pdf Using Software Transactional Memory in Interrupt-Driven Systems]), but it was about one week late &mdash; so my graduation was pushed back to August 2009. At the end of the summer I will move to St. Louis and begin working on a Ph.D. in Computer Science at [http://www.wustl.edu Washington University].<br />
<br />
However, until then I am a research assistant for [http://www.mscs.mu.edu/~brylow/ Dr. Dennis Brylow]. At present I am continuing my research with software transactional memory and operating systems. In my spare geek time, I plan on fleshing out or starting up various parts of the Embedded Xinu O/S, as well as doing various administrative lab tasks.<br />
<br />
If you want more detailed information about me and my academic career you can visit the website of [http://www.mscs.mu.edu/~mschul/ Michael J. Schultz]!<br />
<br />
== Weekly Log (Summer 2009) ==<br />
<br />
=== Week of May 11 ===<br />
<br />
* Completed marriage transaction!<br />
* Generated user accounts for new Team Xinu members.<br />
* Reviewed a few papers, notably:<br />
** Liedtke, J. 1995. ''On <math>\mu</math>-kernel construction.'' SIGOPS Operating Systems Review 29, 5 (Dec. 1995), 237-250. DOI=http://doi.acm.org/10.1145/224057.224075 <br />
** Wentzlaff, D. and Agarwal, A. 2009. ''Factored operating systems (fos): the case for a scalable operating system for multicores.'' SIGOPS Operating Systems Review 43, 2 (Apr. 2009), 76-85. DOI=http://doi.acm.org/10.1145/1531793.1531805<br />
** Miller, F. W. ''Simple Memory Protection for Embedded Operating System Kernels.'' 2002 FREENIX Track Technical Program. URL=http://www.usenix.org/events/usenix02/tech/freenix/miller.html<br />
* Created [http://acm.mscs.mu.edu/wiki-reu/ Research Experiences for Undergraduates] wiki for MSCS REU students (and installed necessary extensions).<br />
* Updated all wikis to user MediaWiki 1.14.0 ([http://acm.mscs.mu.edu/wiki-adam/ Adam's Wiki], [http://acm.mscs.mu.edu/wiki-scifi/ BadSciFi Wiki], [http://acm.mscs.mu.edu/wiki-reu/ MSCS REU Wiki], [http://acm.mscs.mu.edu/ Student ACM Wiki], [http://xinu.mscs.mu.edu/ Embedded Xinu Wiki])<br />
* Updated the all important [http://www.mscs.mu.edu/~mschul/rpms/fortune/ fortune-sys-lab] package to 1.0.1-1 to include [[quotes]] through Spring 2009.<br />
* Began tinkering with KVM on Fedora 10 using [http://www.howtoforge.com/virtualization-with-kvm-on-a-fedora-10-server HowtoForge] (TODO: peruse [http://www.techotopia.com/index.php/Installing_and_Configuring_Fedora_KVM_Virtualization Techotopia] manuals, [http://fedoraproject.org/wiki/Virtualization_Quick_Start Fedora-Getting started with virtualization])<br />
<br />
=== Week of May 18 ===<br />
<br />
* Discussed [http://acm.mscs.mu.edu/wiki-reu/ REU Wiki] with REU students.<br />
* Wrote [[trac:Flash|Flash memory]] and [[trac:SafeMemory|memory protection]] pages to the trac wiki with deadlines and some information.<br />
* Worked on KVM a bit more (no success yet) -- it seems to fail to create the graphics properly which halts the installation process.<br />
* Created SVN account and branch for wireless driver developer.<br />
* Began some preliminary work on memory protection (moving to region based memory)<br />
<br />
=== Week of May 25 ===<br />
* Enjoyed some relaxation time in [[w:Galena,_Illinois|Galena]].<br />
<br />
=== Week of June 1 ===<br />
* Moved some essentials of life back to Milwaukee.<br />
* Updated/rebooted mawdryn (arg).<br />
* Discussed network stack with members of Team Xinu.<br />
* Reread and reviewed -- Wentzlaff, D. and Agarwal, A. 2009. ''Factored operating systems (fos): the case for a scalable operating system for multicores.'' SIGOPS Operating Systems Review 43, 2 (Apr. 2009), 76-85. DOI=http://doi.acm.org/10.1145/1531793.1531805.<br />
* Updated and submitted my [http://www.mscs.mu.edu/~mschul/files/thesis-2009.pdf thesis].<br />
* Looking for potential conference/journal matches to submit a paper to ([http://www.usenix.org/events/byname/ USENIX], [http://www.ieee.org/web/publications/journmag/index.html IEEE], [http://www.acm.org/publications/journals ACM Journals], and [http://portal.acm.org/browse_dl.cfm?linked=1&part=series&coll=ACM&dl=ACM ACM Conferences]).<br />
** Format: ''Full Conference Name'' (Abbr., deadline, page limit) -- [http://citeseer.ist.psu.edu/impact.html est. impact]<br />
** ''[http://www.plosworkshop.org/2009/ Workshop on Programming Languages and Operating Systems]'' (PLOS, 2009 Jun 19, 5 pages) -- unknown.<br />
** ''[http://www.usenix.org/events/hotos09/ Workshop on Hot Topics in Operating Systems]'' (HotOS, 2010 Jan, 5 pages) -- 34.<br />
** ''[http://eurosys2010.sigops-france.fr/calls.html European Conference on Computer Systems]'' (EuroSys, 2009 Oct 19, 12 pages) -- unknown.<br />
** ''[http://www.usenix.org/events/usenix09/ USENIX Annual Technical Conference]'' (USENIX, 2010 Jan, 14 pages long form, 6 pages short form) -- 7.<br />
** ''[http://www.embedded.rwth-aachen.de/tacas2009/ Tools and Algorithms for the Construction and Analysis of Systems]'' (TACAS, 2009 October, 15 pages) -- ~175.<br />
** ''[http://www.oopsla.org/oopsla2009/ Object-Oriented Programming Systems, Languages and Applications]'' (OOPSLA, 2010 Mar, 18 pages) -- 28.<br />
** <strike>''[http://www.sigplan.org/lctes.htm Languages, Compilers, and Tools for Embedded Systems]'' (LCTES, 2010 Feb, 10 pages) -- 404</strike>.<br />
** <strike>''[http://www.emsoft.org/ International Conference on Embedded Software]'' (EMSOFT, 2010 May, 10 pages) -- 390</strike>.<br />
** <strike>''[http://www.usenix.org/events/osdi08/cfp/ Operating Systems Design and Implementation]'' (OSDI, 2010 May, 14 pages) -- 1</strike>.<br />
** <strike>''[http://tocs.acm.org/ Transactions on Computer Systems]'' (TOCS, rolling?, $100/page?) -- 8</strike>.<br />
** <strike>''[http://www2.computer.org/portal/web/tc/ IEEE Transactions on Computers]'' (TC, look for special issue, 14 regular/8 brief pages) -- 361</strike>.<br />
** <strike>''[http://www2.computer.org/portal/web/tse/ IEEE Transactions on Software Engineering]'' (TSE, look for special issue, 14 regular/8 short pages) -- unknown</strike>.<br />
** <strike>''[http://www3.interscience.wiley.com/journal/1752/home Software: Practice and Experience]'' (SP&E, rolling?, 40 pages) -- 558</strike>.<br />
* Updated and assigned tasks on the [[trac:Flash|Flash]] page, now has Samsung specification and instructions for storing a Flash image to morbius.<br />
<br />
=== Week of June 8 ===<br />
* Got rejected.<br />
* Reduced conferences to look at for paper submissions.<br />
* Finished work on region based memory allocator. ([[tracsrc:mips/branches/safemem|source]])<br />
** Xinu now (inefficiently) allocates page sized memory when requests are made.<br />
* Read paper<br />
** Stitt, G., Chaudhari, G., and Coole, J. 2008. ''Traversal caches: a first step towards FPGA acceleration of pointer-based data structures''. In Proceedings of the 6th IEEE/ACM/IFIP international Conference on Hardware/Software Codesign and System Synthesis (Atlanta, GA, USA, October 19 - 24, 2008). CODES/ISSS '08. ACM, New York, NY, 61-66. DOI=http://doi.acm.org/10.1145/1450135.1450150 <br />
* Built page mapping/unmapping functionality into Xinu for virtual memory<br />
** TODOs now include:<br />
*** Hacking together TLB initialization and modification code.<br />
*** Correctly use TLB during context switch.<br />
*** Build system call interface and associated system call functions.<br />
*** Make distinction between user-/kernel-level threads and/or processes.<br />
<br />
=== Week of June 15 ===<br />
* Reviewed papers<br />
** Ryzhyk, L., Chubb, P., Kuz, I., and Heiser, G. 2009. ''Dingo: taming device drivers.'' In Proceedings of the Fourth ACM European Conference on Computer Systems (Nuremberg, Germany, April 01 - 03, 2009). EuroSys '09. DOI=http://doi.acm.org/10.1145/1519065.1519095.<br />
** Fuad Tabba, Mark Moir, James R. Goodman, Andrew W. Hay, and Cong Wang. ''NZTM: Nonblocking Zero-indirection Transactional Memory.'' In Proceedings of the 2009 Symposium on Parallelism in Algorithms and Architectures (Calgary, Alberta, Canada, August 11 - 13, 2009). SPAA '09. URI=http://www.virtutech.com/files/academics/spaa091-tabba.pdf.<br />
* System Administration<br />
** Upgraded to [http://lists.wikimedia.org/pipermail/mediawiki-announce/2009-June/000086.html MediaWiki 1.15.0] on [http://acm.mscs.mu.edu/wiki-adam/ Adam's Wiki], [http://acm.mscs.mu.edu/wiki-scifi/ BadSciFi Wiki], [http://acm.mscs.mu.edu/wiki-reu/ MSCS REU Wiki], [http://acm.mscs.mu.edu/ Student ACM Wiki], and [http://xinu.mscs.mu.edu/ Embedded Xinu Wiki].<br />
** Then proceeded to upgrade all the wikis to use a "continuous integration" process like [http://www.wikipedia.org/ Wikipedia] does, so now all the wikis should use the latest trunk version of MediaWiki.<br />
** Modified some settings for the SMI repository.<br />
** <strike>Began writing a</strike> Completed a draft document discussing what administration tasks there are with mulug (available in <code>/var/mulug/README</code>).<br />
* Memory Protection<br />
** Began looking into system call interface. I've decided Xinu was never meant to have user mode -> kernel mode syscalls (see 20.5 of ''Operating System Design''). Implying that the ancient SYSCALL type is a bit of a misnomer. Though the interface is possible (and fairly easy), it would require special wrapper functions around every call deemed to be a system call.<br />
<br />
=== Week of June 22 ===<br />
* Reviewed Paper<br />
** Maeda, S., Asano, S., Shimada, T., Awazu, K., and Tago, H. 2005. ''A Real-Time Software Platform for the Cell Processor''. IEEE Micro 25, 5 (Sep. 2005), 20-29. DOI=http://dx.doi.org/10.1109/MM.2005.79<br />
* Memory Protection<br />
** Filling out TLB EntryHi and EntryLo[0,1] fields with data from processes page table. Doesn't work. Getting Bus error exception with both fast (assembly) and slow (C) handlers.<br />
** Building a version of [http://www.openwrt.org/ OpenWRT] to (hopefully) dump and look at values in TLB.<br />
** Fixed above problem (right shift PFN 6 bits), I thought they were 'reserved' bits---I was wrong, it works now<br />
** Fixed a few other bugs to get TLB working consistently in mapped memory space<br />
** Began working on syscall interface, still needs testing.<br />
* Got some benchmarks to run with nepsim and told [http://acm.mscs.mu.edu/wiki-reu/index.php/User:Rberg Ryan] how to build nepsim on 64-bit machines (and execute without a segfault).<br />
* Helped with some computational sciences for high school teachers activities<br />
<br />
=== Week of June 29 ===<br />
* Reviewed paper<br />
** Klassner, F. and Continanza, C. 2007. ''Mindstorms without robotics: an alternative to simulations in systems courses.'' In Proceedings of the 38th SIGCSE Technical Symposium on Computer Science Education (Covington, Kentucky, USA, March 07 - 11, 2007). SIGCSE '07. ACM, New York, NY, 175-179. DOI=http://doi.acm.org/10.1145/1227310.1227372<br />
* Added syscall interface to safemem branch, now some cleanup work is necessary and a re-review of the files added. (+ commenting functions)<br />
* Tinkered with KVM on Fedora 11 (it seems to work well).<br />
* Helped find/fix various bugs in network stack.<br />
<br />
=== Week of July 6 ===<br />
* Began working on cleanup/documentation/confirmation of all memory related subsystems (region allocator, paging, tlb, syscall interface)<br />
** Stuck thinking about how to allocate the allocators. (Region based, byte based, malloc/memget, ...)<br />
* Read<br />
** Yang, X., Cooprider, N., and Regehr, J. 2009. ''Eliminating the call stack to save RAM.'' In Proceedings of the 2009 ACM SIGPLAN/SIGBED Conference on Languages, Compilers, and Tools For Embedded Systems (Dublin, Ireland, June 19 - 20, 2009). LCTES '09. ACM, New York, NY, 60-69. DOI=http://doi.acm.org/10.1145/1542452.1542461.<br />
* Adapted to Fedora 11 on mawdryn<br />
** Installed "morbius" virtual machine on mawdryn (doesn't have a MAC address in the database, so none of the standard configuration script ran.)<br />
* Went to Door County on Friday (sorry).<br />
<br />
=== Week of July 13 ===<br />
* Worked on memory allocator<br />
** Pages are allocated to a process (but not recovered until process is killed).<br />
** memget tries to allocate from the freelist of the current process, if enough memory doesn't exist it fetches another page (or pages) and allocates it to the process' freelist.<br />
** memfree simply returns a pointer with nbytes of memory to the process' freelist.<br />
** working on some bugs with memRegionReclaim when a process is killed.<br />
** corrected bug in reclaim<br />
** completed kernel/user allocators (still needs some testing)<br />
** memRegionTransfer should also move the memlist from process to process<br />
* Read paper<br />
** Takacs, G., Chandrasekhar, V., Gelfand, N., Xiong, Y., Chen, W., Bismpigiannis, T., Grzeszczuk, R., Pulli, K., and Girod, B. 2008. ''Outdoors augmented reality on mobile phone using loxel-based visual feature organization.'' In Proceeding of the 1st ACM international Conference on Multimedia information Retrieval (Vancouver, British Columbia, Canada, October 30 - 31, 2008). MIR '08. ACM, New York, NY, 427-434. DOI=http://doi.acm.org/10.1145/1460096.1460165.<br />
* Most importantly, I updated the Xinu banner for release of 2.0.<br />
____ ___.__ <br />
\ \/ /|__| ____ __ __ <br />
\ / | |/ \| | \ <br />
/ \ | | | \ | / <br />
/___/\ \|__|___| /____/ <br />
\_/ \/ v2.0 <br />
* Helped various people in the lab.<br />
<br />
=== Week of July 20 ===<br />
* Read paper for Tuesday<br />
** Quach, B., Balakrishnan, M., Benhaddou, D., and Yuan, X. 2009. ''Implementation of integrated wireless health monitoring network''. In Proceedings of the 1st ACM international Workshop on Medical-Grade Wireless Networks (New Orleans, Louisiana, USA, May 18 - 18, 2009). WiMD '09. ACM, New York, NY, 63-68. DOI=http://doi.acm.org/10.1145/1540373.1540390<br />
* Re-implemented safemem slightly<br />
** Now has a separate user heap (using malloc/free calls) and kernel heap (using memget/memfree)<br />
** User heap is of size #define UHEAP_SIZE (currently set to 8MB) in xinu.conf<br />
*** If UHEAP_SIZE is not defined, there is no user heap and malloc always returns NULL<br />
** Only user heap memory is mapped into page table<br />
** Since Embedded Xinu uses only memory protection, we use a single global page table holding the page table entry and address space identifier (thread id)<br />
** When a TLB exception occurs, the system attempts to load the page table entry<br />
*** If the entry is null or the current thread id is not the ASID for the entry, the thread is killed and outputs "Memory protection violation" to stderr<br />
** The entire kernel is mapped as read-only, global memory so any thread can read kernel memory, but not write to it.<br />
** The TLB can be enabled/disabled by defining/undefining the USE_TLB #define in xinu.conf<br />
** Entire user memory subsystem is in the mem/ folder with only four calls in the kernel (each protected with #ifdef UHEAP_SIZE)<br />
*** system/kill.c attempts to memRegionReclaim when the thread is killed.<br />
*** system/initialize.c acquires UHEAP_SIZE using memget, then attempts to initialize the memory subsystem with memInit (setup the user heap), safeInit (setup memory protection), and safeKmapInit (insert kernel mappings).<br />
** TLB initialized with one call in system/initialize.c protected by #ifdef USE_TLB with all TLB code residing in mem/ as well.<br />
* Helped various people in the lab.<br />
* Relaxed in Northern Wisconsin Thursday and Friday<br />
** Read paper for Tuesday<br />
*** Mankin, J., Kaeli, D., and Ardini, J. 2009. ''Software transactional memory for multicore embedded systems''. In Proceedings of the 2009 ACM SIGPLAN/SIGBED Conference on Languages, Compilers, and Tools For Embedded Systems (Dublin, Ireland, June 19 - 20, 2009). LCTES '09. ACM, New York, NY, 90-98. DOI=http://doi.acm.org/10.1145/1542452.1542465<br />
<br />
=== Week of July 27 ===<br />
* Wrote catalogue of activities from last week.<br />
* Began looking at some network code<br />
** Began getting sad.<br />
* Corrected bug in tlbMissHandler that would effectively disable interrupts<br />
** Originally when a memory violation occurred the handler would kill(thrcurrent), exlset(), and resched().<br />
*** Obviously this is incorrect. kill(thrcurrent) has a call to resched() in it and exlset doesn't allow exceptions to occur.<br />
** Now when a memory violation occurs the handler will exlreset() and kill(thrcurrent).<br />
* Moved around code in malloc and memRegionAlloc to more logically separate thread based memory and region based memory.<br />
** memRegionAlloc will allocate the region and return the region allocated to the caller.<br />
** malloc tries to allocate memory from thread->memlist, then tries a memRegionAlloc and inserts remaining memory in thread->memlist<br />
* Expanded the Embedded Xinu [[memory]] page by 30%!<br />
** Fleshed out the [[flash memory]], [[TRX header]], [[flash driver]], and [[memory management]] pages.<br />
* Placed the PlayStation 3 in the rack and connected it.<br />
** Installed (pre-built) powerpc cross compiler on mawdryn, it seems to build correct binaries.<br />
* Attempted to merge the safemem branch into trunk-2.0. Failed.<br />
** Corrected mis-allocation (skip accounting info) bug in malloc<br />
** Corrected unbalanced disable/restore bug in malloc<br />
** Wrapped memRegionFree into free(), since it does not deal with memory regions, just thread->memlist<br />
<br />
=== Week of August 3 ===</div>Michaelhttps://xinu.cs.mu.edu/index.php?title=User:Michael&diff=3492User:Michael2009-07-29T23:08:07Z<p>Michael: /* Week of July 27 */</p>
<hr />
<div>{| align="right" style="padding:0 5px;"<br />
| __TOC__<br />
|}<br />
<br />
Currently I am a in-between graduate student working at Marquette University. I have completed my thesis ([http://www.mscs.mu.edu/~mschul/files/thesis-2009.pdf Using Software Transactional Memory in Interrupt-Driven Systems]), but it was about one week late &mdash; so my graduation was pushed back to August 2009. At the end of the summer I will move to St. Louis and begin working on a Ph.D. in Computer Science at [http://www.wustl.edu Washington University].<br />
<br />
However, until then I am a research assistant for [http://www.mscs.mu.edu/~brylow/ Dr. Dennis Brylow]. At present I am continuing my research with software transactional memory and operating systems. In my spare geek time, I plan on fleshing out or starting up various parts of the Embedded Xinu O/S, as well as doing various administrative lab tasks.<br />
<br />
If you want more detailed information about me and my academic career you can visit the website of [http://www.mscs.mu.edu/~mschul/ Michael J. Schultz]!<br />
<br />
== Weekly Log (Summer 2009) ==<br />
<br />
=== Week of May 11 ===<br />
<br />
* Completed marriage transaction!<br />
* Generated user accounts for new Team Xinu members.<br />
* Reviewed a few papers, notably:<br />
** Liedtke, J. 1995. ''On <math>\mu</math>-kernel construction.'' SIGOPS Operating Systems Review 29, 5 (Dec. 1995), 237-250. DOI=http://doi.acm.org/10.1145/224057.224075 <br />
** Wentzlaff, D. and Agarwal, A. 2009. ''Factored operating systems (fos): the case for a scalable operating system for multicores.'' SIGOPS Operating Systems Review 43, 2 (Apr. 2009), 76-85. DOI=http://doi.acm.org/10.1145/1531793.1531805<br />
** Miller, F. W. ''Simple Memory Protection for Embedded Operating System Kernels.'' 2002 FREENIX Track Technical Program. URL=http://www.usenix.org/events/usenix02/tech/freenix/miller.html<br />
* Created [http://acm.mscs.mu.edu/wiki-reu/ Research Experiences for Undergraduates] wiki for MSCS REU students (and installed necessary extensions).<br />
* Updated all wikis to user MediaWiki 1.14.0 ([http://acm.mscs.mu.edu/wiki-adam/ Adam's Wiki], [http://acm.mscs.mu.edu/wiki-scifi/ BadSciFi Wiki], [http://acm.mscs.mu.edu/wiki-reu/ MSCS REU Wiki], [http://acm.mscs.mu.edu/ Student ACM Wiki], [http://xinu.mscs.mu.edu/ Embedded Xinu Wiki])<br />
* Updated the all important [http://www.mscs.mu.edu/~mschul/rpms/fortune/ fortune-sys-lab] package to 1.0.1-1 to include [[quotes]] through Spring 2009.<br />
* Began tinkering with KVM on Fedora 10 using [http://www.howtoforge.com/virtualization-with-kvm-on-a-fedora-10-server HowtoForge] (TODO: peruse [http://www.techotopia.com/index.php/Installing_and_Configuring_Fedora_KVM_Virtualization Techotopia] manuals, [http://fedoraproject.org/wiki/Virtualization_Quick_Start Fedora-Getting started with virtualization])<br />
<br />
=== Week of May 18 ===<br />
<br />
* Discussed [http://acm.mscs.mu.edu/wiki-reu/ REU Wiki] with REU students.<br />
* Wrote [[trac:Flash|Flash memory]] and [[trac:SafeMemory|memory protection]] pages to the trac wiki with deadlines and some information.<br />
* Worked on KVM a bit more (no success yet) -- it seems to fail to create the graphics properly which halts the installation process.<br />
* Created SVN account and branch for wireless driver developer.<br />
* Began some preliminary work on memory protection (moving to region based memory)<br />
<br />
=== Week of May 25 ===<br />
* Enjoyed some relaxation time in [[w:Galena,_Illinois|Galena]].<br />
<br />
=== Week of June 1 ===<br />
* Moved some essentials of life back to Milwaukee.<br />
* Updated/rebooted mawdryn (arg).<br />
* Discussed network stack with members of Team Xinu.<br />
* Reread and reviewed -- Wentzlaff, D. and Agarwal, A. 2009. ''Factored operating systems (fos): the case for a scalable operating system for multicores.'' SIGOPS Operating Systems Review 43, 2 (Apr. 2009), 76-85. DOI=http://doi.acm.org/10.1145/1531793.1531805.<br />
* Updated and submitted my [http://www.mscs.mu.edu/~mschul/files/thesis-2009.pdf thesis].<br />
* Looking for potential conference/journal matches to submit a paper to ([http://www.usenix.org/events/byname/ USENIX], [http://www.ieee.org/web/publications/journmag/index.html IEEE], [http://www.acm.org/publications/journals ACM Journals], and [http://portal.acm.org/browse_dl.cfm?linked=1&part=series&coll=ACM&dl=ACM ACM Conferences]).<br />
** Format: ''Full Conference Name'' (Abbr., deadline, page limit) -- [http://citeseer.ist.psu.edu/impact.html est. impact]<br />
** ''[http://www.plosworkshop.org/2009/ Workshop on Programming Languages and Operating Systems]'' (PLOS, 2009 Jun 19, 5 pages) -- unknown.<br />
** ''[http://www.usenix.org/events/hotos09/ Workshop on Hot Topics in Operating Systems]'' (HotOS, 2010 Jan, 5 pages) -- 34.<br />
** ''[http://eurosys2010.sigops-france.fr/calls.html European Conference on Computer Systems]'' (EuroSys, 2009 Oct 19, 12 pages) -- unknown.<br />
** ''[http://www.usenix.org/events/usenix09/ USENIX Annual Technical Conference]'' (USENIX, 2010 Jan, 14 pages long form, 6 pages short form) -- 7.<br />
** ''[http://www.embedded.rwth-aachen.de/tacas2009/ Tools and Algorithms for the Construction and Analysis of Systems]'' (TACAS, 2009 October, 15 pages) -- ~175.<br />
** ''[http://www.oopsla.org/oopsla2009/ Object-Oriented Programming Systems, Languages and Applications]'' (OOPSLA, 2010 Mar, 18 pages) -- 28.<br />
** <strike>''[http://www.sigplan.org/lctes.htm Languages, Compilers, and Tools for Embedded Systems]'' (LCTES, 2010 Feb, 10 pages) -- 404</strike>.<br />
** <strike>''[http://www.emsoft.org/ International Conference on Embedded Software]'' (EMSOFT, 2010 May, 10 pages) -- 390</strike>.<br />
** <strike>''[http://www.usenix.org/events/osdi08/cfp/ Operating Systems Design and Implementation]'' (OSDI, 2010 May, 14 pages) -- 1</strike>.<br />
** <strike>''[http://tocs.acm.org/ Transactions on Computer Systems]'' (TOCS, rolling?, $100/page?) -- 8</strike>.<br />
** <strike>''[http://www2.computer.org/portal/web/tc/ IEEE Transactions on Computers]'' (TC, look for special issue, 14 regular/8 brief pages) -- 361</strike>.<br />
** <strike>''[http://www2.computer.org/portal/web/tse/ IEEE Transactions on Software Engineering]'' (TSE, look for special issue, 14 regular/8 short pages) -- unknown</strike>.<br />
** <strike>''[http://www3.interscience.wiley.com/journal/1752/home Software: Practice and Experience]'' (SP&E, rolling?, 40 pages) -- 558</strike>.<br />
* Updated and assigned tasks on the [[trac:Flash|Flash]] page, now has Samsung specification and instructions for storing a Flash image to morbius.<br />
<br />
=== Week of June 8 ===<br />
* Got rejected.<br />
* Reduced conferences to look at for paper submissions.<br />
* Finished work on region based memory allocator. ([[tracsrc:mips/branches/safemem|source]])<br />
** Xinu now (inefficiently) allocates page sized memory when requests are made.<br />
* Read paper<br />
** Stitt, G., Chaudhari, G., and Coole, J. 2008. ''Traversal caches: a first step towards FPGA acceleration of pointer-based data structures''. In Proceedings of the 6th IEEE/ACM/IFIP international Conference on Hardware/Software Codesign and System Synthesis (Atlanta, GA, USA, October 19 - 24, 2008). CODES/ISSS '08. ACM, New York, NY, 61-66. DOI=http://doi.acm.org/10.1145/1450135.1450150 <br />
* Built page mapping/unmapping functionality into Xinu for virtual memory<br />
** TODOs now include:<br />
*** Hacking together TLB initialization and modification code.<br />
*** Correctly use TLB during context switch.<br />
*** Build system call interface and associated system call functions.<br />
*** Make distinction between user-/kernel-level threads and/or processes.<br />
<br />
=== Week of June 15 ===<br />
* Reviewed papers<br />
** Ryzhyk, L., Chubb, P., Kuz, I., and Heiser, G. 2009. ''Dingo: taming device drivers.'' In Proceedings of the Fourth ACM European Conference on Computer Systems (Nuremberg, Germany, April 01 - 03, 2009). EuroSys '09. DOI=http://doi.acm.org/10.1145/1519065.1519095.<br />
** Fuad Tabba, Mark Moir, James R. Goodman, Andrew W. Hay, and Cong Wang. ''NZTM: Nonblocking Zero-indirection Transactional Memory.'' In Proceedings of the 2009 Symposium on Parallelism in Algorithms and Architectures (Calgary, Alberta, Canada, August 11 - 13, 2009). SPAA '09. URI=http://www.virtutech.com/files/academics/spaa091-tabba.pdf.<br />
* System Administration<br />
** Upgraded to [http://lists.wikimedia.org/pipermail/mediawiki-announce/2009-June/000086.html MediaWiki 1.15.0] on [http://acm.mscs.mu.edu/wiki-adam/ Adam's Wiki], [http://acm.mscs.mu.edu/wiki-scifi/ BadSciFi Wiki], [http://acm.mscs.mu.edu/wiki-reu/ MSCS REU Wiki], [http://acm.mscs.mu.edu/ Student ACM Wiki], and [http://xinu.mscs.mu.edu/ Embedded Xinu Wiki].<br />
** Then proceeded to upgrade all the wikis to use a "continuous integration" process like [http://www.wikipedia.org/ Wikipedia] does, so now all the wikis should use the latest trunk version of MediaWiki.<br />
** Modified some settings for the SMI repository.<br />
** <strike>Began writing a</strike> Completed a draft document discussing what administration tasks there are with mulug (available in <code>/var/mulug/README</code>).<br />
* Memory Protection<br />
** Began looking into system call interface. I've decided Xinu was never meant to have user mode -> kernel mode syscalls (see 20.5 of ''Operating System Design''). Implying that the ancient SYSCALL type is a bit of a misnomer. Though the interface is possible (and fairly easy), it would require special wrapper functions around every call deemed to be a system call.<br />
<br />
=== Week of June 22 ===<br />
* Reviewed Paper<br />
** Maeda, S., Asano, S., Shimada, T., Awazu, K., and Tago, H. 2005. ''A Real-Time Software Platform for the Cell Processor''. IEEE Micro 25, 5 (Sep. 2005), 20-29. DOI=http://dx.doi.org/10.1109/MM.2005.79<br />
* Memory Protection<br />
** Filling out TLB EntryHi and EntryLo[0,1] fields with data from processes page table. Doesn't work. Getting Bus error exception with both fast (assembly) and slow (C) handlers.<br />
** Building a version of [http://www.openwrt.org/ OpenWRT] to (hopefully) dump and look at values in TLB.<br />
** Fixed above problem (right shift PFN 6 bits), I thought they were 'reserved' bits---I was wrong, it works now<br />
** Fixed a few other bugs to get TLB working consistently in mapped memory space<br />
** Began working on syscall interface, still needs testing.<br />
* Got some benchmarks to run with nepsim and told [http://acm.mscs.mu.edu/wiki-reu/index.php/User:Rberg Ryan] how to build nepsim on 64-bit machines (and execute without a segfault).<br />
* Helped with some computational sciences for high school teachers activities<br />
<br />
=== Week of June 29 ===<br />
* Reviewed paper<br />
** Klassner, F. and Continanza, C. 2007. ''Mindstorms without robotics: an alternative to simulations in systems courses.'' In Proceedings of the 38th SIGCSE Technical Symposium on Computer Science Education (Covington, Kentucky, USA, March 07 - 11, 2007). SIGCSE '07. ACM, New York, NY, 175-179. DOI=http://doi.acm.org/10.1145/1227310.1227372<br />
* Added syscall interface to safemem branch, now some cleanup work is necessary and a re-review of the files added. (+ commenting functions)<br />
* Tinkered with KVM on Fedora 11 (it seems to work well).<br />
* Helped find/fix various bugs in network stack.<br />
<br />
=== Week of July 6 ===<br />
* Began working on cleanup/documentation/confirmation of all memory related subsystems (region allocator, paging, tlb, syscall interface)<br />
** Stuck thinking about how to allocate the allocators. (Region based, byte based, malloc/memget, ...)<br />
* Read<br />
** Yang, X., Cooprider, N., and Regehr, J. 2009. ''Eliminating the call stack to save RAM.'' In Proceedings of the 2009 ACM SIGPLAN/SIGBED Conference on Languages, Compilers, and Tools For Embedded Systems (Dublin, Ireland, June 19 - 20, 2009). LCTES '09. ACM, New York, NY, 60-69. DOI=http://doi.acm.org/10.1145/1542452.1542461.<br />
* Adapted to Fedora 11 on mawdryn<br />
** Installed "morbius" virtual machine on mawdryn (doesn't have a MAC address in the database, so none of the standard configuration script ran.)<br />
* Went to Door County on Friday (sorry).<br />
<br />
=== Week of July 13 ===<br />
* Worked on memory allocator<br />
** Pages are allocated to a process (but not recovered until process is killed).<br />
** memget tries to allocate from the freelist of the current process, if enough memory doesn't exist it fetches another page (or pages) and allocates it to the process' freelist.<br />
** memfree simply returns a pointer with nbytes of memory to the process' freelist.<br />
** working on some bugs with memRegionReclaim when a process is killed.<br />
** corrected bug in reclaim<br />
** completed kernel/user allocators (still needs some testing)<br />
** memRegionTransfer should also move the memlist from process to process<br />
* Read paper<br />
** Takacs, G., Chandrasekhar, V., Gelfand, N., Xiong, Y., Chen, W., Bismpigiannis, T., Grzeszczuk, R., Pulli, K., and Girod, B. 2008. ''Outdoors augmented reality on mobile phone using loxel-based visual feature organization.'' In Proceeding of the 1st ACM international Conference on Multimedia information Retrieval (Vancouver, British Columbia, Canada, October 30 - 31, 2008). MIR '08. ACM, New York, NY, 427-434. DOI=http://doi.acm.org/10.1145/1460096.1460165.<br />
* Most importantly, I updated the Xinu banner for release of 2.0.<br />
____ ___.__ <br />
\ \/ /|__| ____ __ __ <br />
\ / | |/ \| | \ <br />
/ \ | | | \ | / <br />
/___/\ \|__|___| /____/ <br />
\_/ \/ v2.0 <br />
* Helped various people in the lab.<br />
<br />
=== Week of July 20 ===<br />
* Read paper for Tuesday<br />
** Quach, B., Balakrishnan, M., Benhaddou, D., and Yuan, X. 2009. ''Implementation of integrated wireless health monitoring network''. In Proceedings of the 1st ACM international Workshop on Medical-Grade Wireless Networks (New Orleans, Louisiana, USA, May 18 - 18, 2009). WiMD '09. ACM, New York, NY, 63-68. DOI=http://doi.acm.org/10.1145/1540373.1540390<br />
* Re-implemented safemem slightly<br />
** Now has a separate user heap (using malloc/free calls) and kernel heap (using memget/memfree)<br />
** User heap is of size #define UHEAP_SIZE (currently set to 8MB) in xinu.conf<br />
*** If UHEAP_SIZE is not defined, there is no user heap and malloc always returns NULL<br />
** Only user heap memory is mapped into page table<br />
** Since Embedded Xinu uses only memory protection, we use a single global page table holding the page table entry and address space identifier (thread id)<br />
** When a TLB exception occurs, the system attempts to load the page table entry<br />
*** If the entry is null or the current thread id is not the ASID for the entry, the thread is killed and outputs "Memory protection violation" to stderr<br />
** The entire kernel is mapped as read-only, global memory so any thread can read kernel memory, but not write to it.<br />
** The TLB can be enabled/disabled by defining/undefining the USE_TLB #define in xinu.conf<br />
** Entire user memory subsystem is in the mem/ folder with only four calls in the kernel (each protected with #ifdef UHEAP_SIZE)<br />
*** system/kill.c attempts to memRegionReclaim when the thread is killed.<br />
*** system/initialize.c acquires UHEAP_SIZE using memget, then attempts to initialize the memory subsystem with memInit (setup the user heap), safeInit (setup memory protection), and safeKmapInit (insert kernel mappings).<br />
** TLB initialized with one call in system/initialize.c protected by #ifdef USE_TLB with all TLB code residing in mem/ as well.<br />
* Helped various people in the lab.<br />
* Relaxed in Northern Wisconsin Thursday and Friday<br />
** Read paper for Tuesday<br />
*** Mankin, J., Kaeli, D., and Ardini, J. 2009. ''Software transactional memory for multicore embedded systems''. In Proceedings of the 2009 ACM SIGPLAN/SIGBED Conference on Languages, Compilers, and Tools For Embedded Systems (Dublin, Ireland, June 19 - 20, 2009). LCTES '09. ACM, New York, NY, 90-98. DOI=http://doi.acm.org/10.1145/1542452.1542465<br />
<br />
=== Week of July 27 ===<br />
* Wrote catalogue of activities from last week.<br />
* Began looking at some network code<br />
** Began getting sad.<br />
* Corrected bug in tlbMissHandler that would effectively disable interrupts<br />
** Originally when a memory violation occurred the handler would kill(thrcurrent), exlset(), and resched().<br />
*** Obviously this is incorrect. kill(thrcurrent) has a call to resched() in it and exlset doesn't allow exceptions to occur.<br />
** Now when a memory violation occurs the handler will exlreset() and kill(thrcurrent).<br />
* Moved around code in malloc and memRegionAlloc to more logically separate thread based memory and region based memory.<br />
** memRegionAlloc will allocate the region and return the region allocated to the caller.<br />
** malloc tries to allocate memory from thread->memlist, then tries a memRegionAlloc and inserts remaining memory in thread->memlist<br />
* Expanded the Embedded Xinu [[memory]] page by 30%!<br />
** Fleshed out the [[flash memory]], [[TRX header]], [[flash driver]], and [[memory management]] pages.<br />
<br />
=== Week of August 3 ===</div>Michaelhttps://xinu.cs.mu.edu/index.php?title=User:Michael&diff=3491User:Michael2009-07-29T22:38:31Z<p>Michael: /* Week of July 27 */ Fleshed out memory management</p>
<hr />
<div>{| align="right" style="padding:0 5px;"<br />
| __TOC__<br />
|}<br />
<br />
Currently I am a in-between graduate student working at Marquette University. I have completed my thesis ([http://www.mscs.mu.edu/~mschul/files/thesis-2009.pdf Using Software Transactional Memory in Interrupt-Driven Systems]), but it was about one week late &mdash; so my graduation was pushed back to August 2009. At the end of the summer I will move to St. Louis and begin working on a Ph.D. in Computer Science at [http://www.wustl.edu Washington University].<br />
<br />
However, until then I am a research assistant for [http://www.mscs.mu.edu/~brylow/ Dr. Dennis Brylow]. At present I am continuing my research with software transactional memory and operating systems. In my spare geek time, I plan on fleshing out or starting up various parts of the Embedded Xinu O/S, as well as doing various administrative lab tasks.<br />
<br />
If you want more detailed information about me and my academic career you can visit the website of [http://www.mscs.mu.edu/~mschul/ Michael J. Schultz]!<br />
<br />
== Weekly Log (Summer 2009) ==<br />
<br />
=== Week of May 11 ===<br />
<br />
* Completed marriage transaction!<br />
* Generated user accounts for new Team Xinu members.<br />
* Reviewed a few papers, notably:<br />
** Liedtke, J. 1995. ''On <math>\mu</math>-kernel construction.'' SIGOPS Operating Systems Review 29, 5 (Dec. 1995), 237-250. DOI=http://doi.acm.org/10.1145/224057.224075 <br />
** Wentzlaff, D. and Agarwal, A. 2009. ''Factored operating systems (fos): the case for a scalable operating system for multicores.'' SIGOPS Operating Systems Review 43, 2 (Apr. 2009), 76-85. DOI=http://doi.acm.org/10.1145/1531793.1531805<br />
** Miller, F. W. ''Simple Memory Protection for Embedded Operating System Kernels.'' 2002 FREENIX Track Technical Program. URL=http://www.usenix.org/events/usenix02/tech/freenix/miller.html<br />
* Created [http://acm.mscs.mu.edu/wiki-reu/ Research Experiences for Undergraduates] wiki for MSCS REU students (and installed necessary extensions).<br />
* Updated all wikis to user MediaWiki 1.14.0 ([http://acm.mscs.mu.edu/wiki-adam/ Adam's Wiki], [http://acm.mscs.mu.edu/wiki-scifi/ BadSciFi Wiki], [http://acm.mscs.mu.edu/wiki-reu/ MSCS REU Wiki], [http://acm.mscs.mu.edu/ Student ACM Wiki], [http://xinu.mscs.mu.edu/ Embedded Xinu Wiki])<br />
* Updated the all important [http://www.mscs.mu.edu/~mschul/rpms/fortune/ fortune-sys-lab] package to 1.0.1-1 to include [[quotes]] through Spring 2009.<br />
* Began tinkering with KVM on Fedora 10 using [http://www.howtoforge.com/virtualization-with-kvm-on-a-fedora-10-server HowtoForge] (TODO: peruse [http://www.techotopia.com/index.php/Installing_and_Configuring_Fedora_KVM_Virtualization Techotopia] manuals, [http://fedoraproject.org/wiki/Virtualization_Quick_Start Fedora-Getting started with virtualization])<br />
<br />
=== Week of May 18 ===<br />
<br />
* Discussed [http://acm.mscs.mu.edu/wiki-reu/ REU Wiki] with REU students.<br />
* Wrote [[trac:Flash|Flash memory]] and [[trac:SafeMemory|memory protection]] pages to the trac wiki with deadlines and some information.<br />
* Worked on KVM a bit more (no success yet) -- it seems to fail to create the graphics properly which halts the installation process.<br />
* Created SVN account and branch for wireless driver developer.<br />
* Began some preliminary work on memory protection (moving to region based memory)<br />
<br />
=== Week of May 25 ===<br />
* Enjoyed some relaxation time in [[w:Galena,_Illinois|Galena]].<br />
<br />
=== Week of June 1 ===<br />
* Moved some essentials of life back to Milwaukee.<br />
* Updated/rebooted mawdryn (arg).<br />
* Discussed network stack with members of Team Xinu.<br />
* Reread and reviewed -- Wentzlaff, D. and Agarwal, A. 2009. ''Factored operating systems (fos): the case for a scalable operating system for multicores.'' SIGOPS Operating Systems Review 43, 2 (Apr. 2009), 76-85. DOI=http://doi.acm.org/10.1145/1531793.1531805.<br />
* Updated and submitted my [http://www.mscs.mu.edu/~mschul/files/thesis-2009.pdf thesis].<br />
* Looking for potential conference/journal matches to submit a paper to ([http://www.usenix.org/events/byname/ USENIX], [http://www.ieee.org/web/publications/journmag/index.html IEEE], [http://www.acm.org/publications/journals ACM Journals], and [http://portal.acm.org/browse_dl.cfm?linked=1&part=series&coll=ACM&dl=ACM ACM Conferences]).<br />
** Format: ''Full Conference Name'' (Abbr., deadline, page limit) -- [http://citeseer.ist.psu.edu/impact.html est. impact]<br />
** ''[http://www.plosworkshop.org/2009/ Workshop on Programming Languages and Operating Systems]'' (PLOS, 2009 Jun 19, 5 pages) -- unknown.<br />
** ''[http://www.usenix.org/events/hotos09/ Workshop on Hot Topics in Operating Systems]'' (HotOS, 2010 Jan, 5 pages) -- 34.<br />
** ''[http://eurosys2010.sigops-france.fr/calls.html European Conference on Computer Systems]'' (EuroSys, 2009 Oct 19, 12 pages) -- unknown.<br />
** ''[http://www.usenix.org/events/usenix09/ USENIX Annual Technical Conference]'' (USENIX, 2010 Jan, 14 pages long form, 6 pages short form) -- 7.<br />
** ''[http://www.embedded.rwth-aachen.de/tacas2009/ Tools and Algorithms for the Construction and Analysis of Systems]'' (TACAS, 2009 October, 15 pages) -- ~175.<br />
** ''[http://www.oopsla.org/oopsla2009/ Object-Oriented Programming Systems, Languages and Applications]'' (OOPSLA, 2010 Mar, 18 pages) -- 28.<br />
** <strike>''[http://www.sigplan.org/lctes.htm Languages, Compilers, and Tools for Embedded Systems]'' (LCTES, 2010 Feb, 10 pages) -- 404</strike>.<br />
** <strike>''[http://www.emsoft.org/ International Conference on Embedded Software]'' (EMSOFT, 2010 May, 10 pages) -- 390</strike>.<br />
** <strike>''[http://www.usenix.org/events/osdi08/cfp/ Operating Systems Design and Implementation]'' (OSDI, 2010 May, 14 pages) -- 1</strike>.<br />
** <strike>''[http://tocs.acm.org/ Transactions on Computer Systems]'' (TOCS, rolling?, $100/page?) -- 8</strike>.<br />
** <strike>''[http://www2.computer.org/portal/web/tc/ IEEE Transactions on Computers]'' (TC, look for special issue, 14 regular/8 brief pages) -- 361</strike>.<br />
** <strike>''[http://www2.computer.org/portal/web/tse/ IEEE Transactions on Software Engineering]'' (TSE, look for special issue, 14 regular/8 short pages) -- unknown</strike>.<br />
** <strike>''[http://www3.interscience.wiley.com/journal/1752/home Software: Practice and Experience]'' (SP&E, rolling?, 40 pages) -- 558</strike>.<br />
* Updated and assigned tasks on the [[trac:Flash|Flash]] page, now has Samsung specification and instructions for storing a Flash image to morbius.<br />
<br />
=== Week of June 8 ===<br />
* Got rejected.<br />
* Reduced conferences to look at for paper submissions.<br />
* Finished work on region based memory allocator. ([[tracsrc:mips/branches/safemem|source]])<br />
** Xinu now (inefficiently) allocates page sized memory when requests are made.<br />
* Read paper<br />
** Stitt, G., Chaudhari, G., and Coole, J. 2008. ''Traversal caches: a first step towards FPGA acceleration of pointer-based data structures''. In Proceedings of the 6th IEEE/ACM/IFIP international Conference on Hardware/Software Codesign and System Synthesis (Atlanta, GA, USA, October 19 - 24, 2008). CODES/ISSS '08. ACM, New York, NY, 61-66. DOI=http://doi.acm.org/10.1145/1450135.1450150 <br />
* Built page mapping/unmapping functionality into Xinu for virtual memory<br />
** TODOs now include:<br />
*** Hacking together TLB initialization and modification code.<br />
*** Correctly use TLB during context switch.<br />
*** Build system call interface and associated system call functions.<br />
*** Make distinction between user-/kernel-level threads and/or processes.<br />
<br />
=== Week of June 15 ===<br />
* Reviewed papers<br />
** Ryzhyk, L., Chubb, P., Kuz, I., and Heiser, G. 2009. ''Dingo: taming device drivers.'' In Proceedings of the Fourth ACM European Conference on Computer Systems (Nuremberg, Germany, April 01 - 03, 2009). EuroSys '09. DOI=http://doi.acm.org/10.1145/1519065.1519095.<br />
** Fuad Tabba, Mark Moir, James R. Goodman, Andrew W. Hay, and Cong Wang. ''NZTM: Nonblocking Zero-indirection Transactional Memory.'' In Proceedings of the 2009 Symposium on Parallelism in Algorithms and Architectures (Calgary, Alberta, Canada, August 11 - 13, 2009). SPAA '09. URI=http://www.virtutech.com/files/academics/spaa091-tabba.pdf.<br />
* System Administration<br />
** Upgraded to [http://lists.wikimedia.org/pipermail/mediawiki-announce/2009-June/000086.html MediaWiki 1.15.0] on [http://acm.mscs.mu.edu/wiki-adam/ Adam's Wiki], [http://acm.mscs.mu.edu/wiki-scifi/ BadSciFi Wiki], [http://acm.mscs.mu.edu/wiki-reu/ MSCS REU Wiki], [http://acm.mscs.mu.edu/ Student ACM Wiki], and [http://xinu.mscs.mu.edu/ Embedded Xinu Wiki].<br />
** Then proceeded to upgrade all the wikis to use a "continuous integration" process like [http://www.wikipedia.org/ Wikipedia] does, so now all the wikis should use the latest trunk version of MediaWiki.<br />
** Modified some settings for the SMI repository.<br />
** <strike>Began writing a</strike> Completed a draft document discussing what administration tasks there are with mulug (available in <code>/var/mulug/README</code>).<br />
* Memory Protection<br />
** Began looking into system call interface. I've decided Xinu was never meant to have user mode -> kernel mode syscalls (see 20.5 of ''Operating System Design''). Implying that the ancient SYSCALL type is a bit of a misnomer. Though the interface is possible (and fairly easy), it would require special wrapper functions around every call deemed to be a system call.<br />
<br />
=== Week of June 22 ===<br />
* Reviewed Paper<br />
** Maeda, S., Asano, S., Shimada, T., Awazu, K., and Tago, H. 2005. ''A Real-Time Software Platform for the Cell Processor''. IEEE Micro 25, 5 (Sep. 2005), 20-29. DOI=http://dx.doi.org/10.1109/MM.2005.79<br />
* Memory Protection<br />
** Filling out TLB EntryHi and EntryLo[0,1] fields with data from processes page table. Doesn't work. Getting Bus error exception with both fast (assembly) and slow (C) handlers.<br />
** Building a version of [http://www.openwrt.org/ OpenWRT] to (hopefully) dump and look at values in TLB.<br />
** Fixed above problem (right shift PFN 6 bits), I thought they were 'reserved' bits---I was wrong, it works now<br />
** Fixed a few other bugs to get TLB working consistently in mapped memory space<br />
** Began working on syscall interface, still needs testing.<br />
* Got some benchmarks to run with nepsim and told [http://acm.mscs.mu.edu/wiki-reu/index.php/User:Rberg Ryan] how to build nepsim on 64-bit machines (and execute without a segfault).<br />
* Helped with some computational sciences for high school teachers activities<br />
<br />
=== Week of June 29 ===<br />
* Reviewed paper<br />
** Klassner, F. and Continanza, C. 2007. ''Mindstorms without robotics: an alternative to simulations in systems courses.'' In Proceedings of the 38th SIGCSE Technical Symposium on Computer Science Education (Covington, Kentucky, USA, March 07 - 11, 2007). SIGCSE '07. ACM, New York, NY, 175-179. DOI=http://doi.acm.org/10.1145/1227310.1227372<br />
* Added syscall interface to safemem branch, now some cleanup work is necessary and a re-review of the files added. (+ commenting functions)<br />
* Tinkered with KVM on Fedora 11 (it seems to work well).<br />
* Helped find/fix various bugs in network stack.<br />
<br />
=== Week of July 6 ===<br />
* Began working on cleanup/documentation/confirmation of all memory related subsystems (region allocator, paging, tlb, syscall interface)<br />
** Stuck thinking about how to allocate the allocators. (Region based, byte based, malloc/memget, ...)<br />
* Read<br />
** Yang, X., Cooprider, N., and Regehr, J. 2009. ''Eliminating the call stack to save RAM.'' In Proceedings of the 2009 ACM SIGPLAN/SIGBED Conference on Languages, Compilers, and Tools For Embedded Systems (Dublin, Ireland, June 19 - 20, 2009). LCTES '09. ACM, New York, NY, 60-69. DOI=http://doi.acm.org/10.1145/1542452.1542461.<br />
* Adapted to Fedora 11 on mawdryn<br />
** Installed "morbius" virtual machine on mawdryn (doesn't have a MAC address in the database, so none of the standard configuration script ran.)<br />
* Went to Door County on Friday (sorry).<br />
<br />
=== Week of July 13 ===<br />
* Worked on memory allocator<br />
** Pages are allocated to a process (but not recovered until process is killed).<br />
** memget tries to allocate from the freelist of the current process, if enough memory doesn't exist it fetches another page (or pages) and allocates it to the process' freelist.<br />
** memfree simply returns a pointer with nbytes of memory to the process' freelist.<br />
** working on some bugs with memRegionReclaim when a process is killed.<br />
** corrected bug in reclaim<br />
** completed kernel/user allocators (still needs some testing)<br />
** memRegionTransfer should also move the memlist from process to process<br />
* Read paper<br />
** Takacs, G., Chandrasekhar, V., Gelfand, N., Xiong, Y., Chen, W., Bismpigiannis, T., Grzeszczuk, R., Pulli, K., and Girod, B. 2008. ''Outdoors augmented reality on mobile phone using loxel-based visual feature organization.'' In Proceeding of the 1st ACM international Conference on Multimedia information Retrieval (Vancouver, British Columbia, Canada, October 30 - 31, 2008). MIR '08. ACM, New York, NY, 427-434. DOI=http://doi.acm.org/10.1145/1460096.1460165.<br />
* Most importantly, I updated the Xinu banner for release of 2.0.<br />
____ ___.__ <br />
\ \/ /|__| ____ __ __ <br />
\ / | |/ \| | \ <br />
/ \ | | | \ | / <br />
/___/\ \|__|___| /____/ <br />
\_/ \/ v2.0 <br />
* Helped various people in the lab.<br />
<br />
=== Week of July 20 ===<br />
* Read paper for Tuesday<br />
** Quach, B., Balakrishnan, M., Benhaddou, D., and Yuan, X. 2009. ''Implementation of integrated wireless health monitoring network''. In Proceedings of the 1st ACM international Workshop on Medical-Grade Wireless Networks (New Orleans, Louisiana, USA, May 18 - 18, 2009). WiMD '09. ACM, New York, NY, 63-68. DOI=http://doi.acm.org/10.1145/1540373.1540390<br />
* Re-implemented safemem slightly<br />
** Now has a separate user heap (using malloc/free calls) and kernel heap (using memget/memfree)<br />
** User heap is of size #define UHEAP_SIZE (currently set to 8MB) in xinu.conf<br />
*** If UHEAP_SIZE is not defined, there is no user heap and malloc always returns NULL<br />
** Only user heap memory is mapped into page table<br />
** Since Embedded Xinu uses only memory protection, we use a single global page table holding the page table entry and address space identifier (thread id)<br />
** When a TLB exception occurs, the system attempts to load the page table entry<br />
*** If the entry is null or the current thread id is not the ASID for the entry, the thread is killed and outputs "Memory protection violation" to stderr<br />
** The entire kernel is mapped as read-only, global memory so any thread can read kernel memory, but not write to it.<br />
** The TLB can be enabled/disabled by defining/undefining the USE_TLB #define in xinu.conf<br />
** Entire user memory subsystem is in the mem/ folder with only four calls in the kernel (each protected with #ifdef UHEAP_SIZE)<br />
*** system/kill.c attempts to memRegionReclaim when the thread is killed.<br />
*** system/initialize.c acquires UHEAP_SIZE using memget, then attempts to initialize the memory subsystem with memInit (setup the user heap), safeInit (setup memory protection), and safeKmapInit (insert kernel mappings).<br />
** TLB initialized with one call in system/initialize.c protected by #ifdef USE_TLB with all TLB code residing in mem/ as well.<br />
* Helped various people in the lab.<br />
* Relaxed in Northern Wisconsin Thursday and Friday<br />
** Read paper for Tuesday<br />
*** Mankin, J., Kaeli, D., and Ardini, J. 2009. ''Software transactional memory for multicore embedded systems''. In Proceedings of the 2009 ACM SIGPLAN/SIGBED Conference on Languages, Compilers, and Tools For Embedded Systems (Dublin, Ireland, June 19 - 20, 2009). LCTES '09. ACM, New York, NY, 90-98. DOI=http://doi.acm.org/10.1145/1542452.1542465<br />
<br />
=== Week of July 27 ===<br />
* Wrote catalogue of activities from last week.<br />
* Began looking at some network code<br />
** Began getting sad.<br />
* Corrected bug in tlbMissHandler that would effectively disable interrupts<br />
** Originally when a memory violation occurred the handler would kill(thrcurrent), exlset(), and resched().<br />
*** Obviously this is incorrect. kill(thrcurrent) has a call to resched() in it and exlset doesn't allow exceptions to occur.<br />
** Now when a memory violation occurs the handler will exlreset() and kill(thrcurrent).<br />
* Moved around code in malloc and memRegionAlloc to more logically separate thread based memory and region based memory.<br />
** memRegionAlloc will allocate the region and return the region allocated to the caller.<br />
** malloc tries to allocate memory from thread->memlist, then tries a memRegionAlloc and inserts remaining memory in thread->memlist<br />
* Expanded the Embedded Xinu [[memory]] page by 30%! Added links to [[flash memory]] and [[memory management]].<br />
** Fleshed out the [[flash memory]], [[TRX header]], [[flash driver]], and [[memory management]] pages.<br />
<br />
=== Week of August 3 ===</div>Michaelhttps://xinu.cs.mu.edu/index.php?title=Memory_management&diff=3490Memory management2009-07-29T22:37:47Z<p>Michael: /* Memory Protection */ Fleshed out memory protection</p>
<hr />
<div>Memory management is an important aspect of any operating system, as such [[Embedded Xinu]] makes use of some aspects of the underlying hardware to build up a simple to understand memory management system.<br />
<br />
== Memory Allocators ==<br />
<br />
Embedded Xinu maintains two memory allocators that work in tandem to provide dynamic memory to both kernel and user software. The first allocator is the kernel allocator which allocates small chunks of memory from the global memory heap as needed by the kernel. The second allocator is a user allocator, that allocates memory from a pre-thread memory heap as needed by user processes.<br />
<br />
=== Kernel Allocator ===<br />
<br />
The most basic memory allocator in the system is the kernel allocator which uses the <code>memget</code> and <code>memfree</code> functions. This operates on the global kernel heap that uses the <code>memlist</code> global variable. In this allocator the kernel developer is trusted to keep track of the accounting information for memory blocks. This makes a rather straightforward API.<br />
<br />
<source lang="c"><br />
void *memptr = memget(nbytes);<br />
memfree(memptr, nbytes);<br />
</source><br />
<br />
As can be seen in the above API, the allocation function takes a single parameter (<code>nbytes</code>) which is the number of bytes requested. The deallocation function takes two parameters (<code>memptr</code> and <code>nbytes</code>), where <code>memptr</code> is the memory address allocated via the <code>memget</code> function and <code>nbytes</code> is the number of bytes requested with the original call.<br />
<br />
=== User Allocator ===<br />
<br />
Unlike the kernel allocator, the user allocator does not trust the programmer to remember the amount of memory requested and instead stores the accounting information immediately before the allocated memory. To the programmer the API for user memory is simply:<br />
<br />
<source lang="c"><br />
void *memptr = malloc(nbytes);<br />
free(memptr);<br />
</source><br />
<br />
This allocator works on a per-thread memory list of free memory, this allows memory to be owned by the calling thread and prevents other threads from having access to the memory. This forms the basis of memory protection.<br />
<br />
When a request for memory comes in to the allocator, it attempts to satisfy the request with free memory that has already been allocated to thread. If that fails, the allocator will then attempt to acquire memory from the region allocator (described below). Since the region allocator works at page granularity, any excess memory is inserted into the thread's free memory list for future requests. When a block of memory is free'd, the memory is returned to the thread's free memory list.<br />
<br />
It is not until the thread is killed that the memory is removed from the thread's protection domain and made available to the region allocator.<br />
<br />
==== Region Allocator ====<br />
<br />
The region allocator works beneath the user allocator and is initialized during the boot process. During system boot Embedded Xinu uses <code>UHEAP_SIZE</code> as defined in <code>xinu.conf</code> to allocate memory for the user heap. This memory is allocated via the kernel <code>memget()</code> function and is then passed to the <code>memRegionInit()</code> function. Once the region allocator is initialized, the only user level interface to the region allocator is hidden behind the <code>malloc</code> and <code>free</code> routines.<br />
<br />
== Memory Protection ==<br />
<br />
Since Embedded Xinu has limited resources to work with it does not provide a virtual memory system. It does take advantage of separate address spaces for each user thread running in the system, which provides simple memory protection for low overhead costs. As such, when allocating pages to the thread via the user allocator those pages will be mapped to the protection domain of the currently running thread. These protection domains are inserted into a single global page table, that hold all the page table entries and the address space identifier of the protected page.<br />
<br />
In the memory protection subsystem, the default behaviour is to map all the kernel pages (i.e. pages that are not in the user heap), to every thread in the system as read only. This allows all threads to read from kernel data, but prevents overwriting of that data.<br />
<br />
=== Translation Lookaside Buffer ===<br />
<br />
To facilitate memory protection, Embedded Xinu uses the translation lookaside buffer (TLB) built into the MIPS processors of the [[WRT54GL]] series of routers. When a piece of software attempts to access memory in the [[Memory#User Segment|user segment]], a TLB load or store exception will occur. When this occurs the processor jumps to a specific exception handler which allows the kernel to look up the page table entry, check if the faulting thread is in the same memory space as the entry, and load the entry into the TLB. If there is no mapping or the thread is not in the same address space, a memory protection violation occurs and the thread is killed.</div>Michaelhttps://xinu.cs.mu.edu/index.php?title=Memory_management&diff=3489Memory management2009-07-29T22:00:53Z<p>Michael: /* Memory Allocators */ Defined the memory allocators</p>
<hr />
<div>Memory management is an important aspect of any operating system, as such [[Embedded Xinu]] makes use of some aspects of the underlying hardware to build up a simple to understand memory management system.<br />
<br />
== Memory Allocators ==<br />
<br />
Embedded Xinu maintains two memory allocators that work in tandem to provide dynamic memory to both kernel and user software. The first allocator is the kernel allocator which allocates small chunks of memory from the global memory heap as needed by the kernel. The second allocator is a user allocator, that allocates memory from a pre-thread memory heap as needed by user processes.<br />
<br />
=== Kernel Allocator ===<br />
<br />
The most basic memory allocator in the system is the kernel allocator which uses the <code>memget</code> and <code>memfree</code> functions. This operates on the global kernel heap that uses the <code>memlist</code> global variable. In this allocator the kernel developer is trusted to keep track of the accounting information for memory blocks. This makes a rather straightforward API.<br />
<br />
<source lang="c"><br />
void *memptr = memget(nbytes);<br />
memfree(memptr, nbytes);<br />
</source><br />
<br />
As can be seen in the above API, the allocation function takes a single parameter (<code>nbytes</code>) which is the number of bytes requested. The deallocation function takes two parameters (<code>memptr</code> and <code>nbytes</code>), where <code>memptr</code> is the memory address allocated via the <code>memget</code> function and <code>nbytes</code> is the number of bytes requested with the original call.<br />
<br />
=== User Allocator ===<br />
<br />
Unlike the kernel allocator, the user allocator does not trust the programmer to remember the amount of memory requested and instead stores the accounting information immediately before the allocated memory. To the programmer the API for user memory is simply:<br />
<br />
<source lang="c"><br />
void *memptr = malloc(nbytes);<br />
free(memptr);<br />
</source><br />
<br />
This allocator works on a per-thread memory list of free memory, this allows memory to be owned by the calling thread and prevents other threads from having access to the memory. This forms the basis of memory protection.<br />
<br />
When a request for memory comes in to the allocator, it attempts to satisfy the request with free memory that has already been allocated to thread. If that fails, the allocator will then attempt to acquire memory from the region allocator (described below). Since the region allocator works at page granularity, any excess memory is inserted into the thread's free memory list for future requests. When a block of memory is free'd, the memory is returned to the thread's free memory list.<br />
<br />
It is not until the thread is killed that the memory is removed from the thread's protection domain and made available to the region allocator.<br />
<br />
==== Region Allocator ====<br />
<br />
The region allocator works beneath the user allocator and is initialized during the boot process. During system boot Embedded Xinu uses <code>UHEAP_SIZE</code> as defined in <code>xinu.conf</code> to allocate memory for the user heap. This memory is allocated via the kernel <code>memget()</code> function and is then passed to the <code>memRegionInit()</code> function. Once the region allocator is initialized, the only user level interface to the region allocator is hidden behind the <code>malloc</code> and <code>free</code> routines.<br />
<br />
== Memory Protection ==<br />
<br />
Since Embedded Xinu has limited resources to work with it does not provide a virtual memory system. It does take advantage of separate address spaces for each user thread running in the system, which provides simple memory protection for low overhead costs.<br />
<br />
=== Translation Lookaside Buffer ===<br />
<br />
To facilitate memory protect Embedded Xinu uses the translation lookaside buffer (TLB) build into the MIPS processors of the [[WRT54GL]] series of routers.</div>Michaelhttps://xinu.cs.mu.edu/index.php?title=Memory_management&diff=3487Memory management2009-07-29T20:32:45Z<p>Michael: Added stubs for memory management page</p>
<hr />
<div>Memory management is an important aspect of any operating system, as such [[Embedded Xinu]] makes use of some aspects of the underlying hardware to build up a simple to understand memory management system.<br />
<br />
== Memory Allocators ==<br />
<br />
Embedded Xinu uses two main memory allocators that work in tandem to provide dynamic memory to both kernel and user software.<br />
<br />
=== Kernel Allocator ===<br />
<br />
The kernel allocator trusts the programmer to keep track of accounting information on the stack and provides no mapping or protection.<br />
<br />
=== User Allocator ===<br />
<br />
The user allocator stores accounting information adjacent to the allocated memory and provides distinct address spaces for each running thread.<br />
<br />
==== Region Allocator ====<br />
<br />
The region allocator runs below the user allocator and provides more page aligned memory regions upon request.<br />
<br />
== Memory Protection ==<br />
<br />
Since Embedded Xinu has limited resources to work with it does not provide a virtual memory system. It does take advantage of separate address spaces for each user thread running in the system, which provides simple memory protection for low overhead costs.<br />
<br />
=== Translation Lookaside Buffer ===<br />
<br />
To facilitate memory protect Embedded Xinu uses the translation lookaside buffer (TLB) build into the MIPS processors of the [[WRT54GL]] series of routers.</div>Michaelhttps://xinu.cs.mu.edu/index.php?title=Talk:Flash_driver&diff=3486Talk:Flash driver2009-07-29T20:17:27Z<p>Michael: Link to original Flash driver page.</p>
<hr />
<div>The original form of the [[Flash driver]] page can now be found at [[Talk:Flash driver/Original]]. '''Note''' that the original page is now considered deprecated. [[User:Michael|Michael]] 20:17, 29 July 2009 (UTC)</div>Michaelhttps://xinu.cs.mu.edu/index.php?title=User:Michael&diff=3485User:Michael2009-07-29T20:16:09Z<p>Michael: /* Week of July 27 */ Updated flash driver</p>
<hr />
<div>{| align="right" style="padding:0 5px;"<br />
| __TOC__<br />
|}<br />
<br />
Currently I am a in-between graduate student working at Marquette University. I have completed my thesis ([http://www.mscs.mu.edu/~mschul/files/thesis-2009.pdf Using Software Transactional Memory in Interrupt-Driven Systems]), but it was about one week late &mdash; so my graduation was pushed back to August 2009. At the end of the summer I will move to St. Louis and begin working on a Ph.D. in Computer Science at [http://www.wustl.edu Washington University].<br />
<br />
However, until then I am a research assistant for [http://www.mscs.mu.edu/~brylow/ Dr. Dennis Brylow]. At present I am continuing my research with software transactional memory and operating systems. In my spare geek time, I plan on fleshing out or starting up various parts of the Embedded Xinu O/S, as well as doing various administrative lab tasks.<br />
<br />
If you want more detailed information about me and my academic career you can visit the website of [http://www.mscs.mu.edu/~mschul/ Michael J. Schultz]!<br />
<br />
== Weekly Log (Summer 2009) ==<br />
<br />
=== Week of May 11 ===<br />
<br />
* Completed marriage transaction!<br />
* Generated user accounts for new Team Xinu members.<br />
* Reviewed a few papers, notably:<br />
** Liedtke, J. 1995. ''On <math>\mu</math>-kernel construction.'' SIGOPS Operating Systems Review 29, 5 (Dec. 1995), 237-250. DOI=http://doi.acm.org/10.1145/224057.224075 <br />
** Wentzlaff, D. and Agarwal, A. 2009. ''Factored operating systems (fos): the case for a scalable operating system for multicores.'' SIGOPS Operating Systems Review 43, 2 (Apr. 2009), 76-85. DOI=http://doi.acm.org/10.1145/1531793.1531805<br />
** Miller, F. W. ''Simple Memory Protection for Embedded Operating System Kernels.'' 2002 FREENIX Track Technical Program. URL=http://www.usenix.org/events/usenix02/tech/freenix/miller.html<br />
* Created [http://acm.mscs.mu.edu/wiki-reu/ Research Experiences for Undergraduates] wiki for MSCS REU students (and installed necessary extensions).<br />
* Updated all wikis to user MediaWiki 1.14.0 ([http://acm.mscs.mu.edu/wiki-adam/ Adam's Wiki], [http://acm.mscs.mu.edu/wiki-scifi/ BadSciFi Wiki], [http://acm.mscs.mu.edu/wiki-reu/ MSCS REU Wiki], [http://acm.mscs.mu.edu/ Student ACM Wiki], [http://xinu.mscs.mu.edu/ Embedded Xinu Wiki])<br />
* Updated the all important [http://www.mscs.mu.edu/~mschul/rpms/fortune/ fortune-sys-lab] package to 1.0.1-1 to include [[quotes]] through Spring 2009.<br />
* Began tinkering with KVM on Fedora 10 using [http://www.howtoforge.com/virtualization-with-kvm-on-a-fedora-10-server HowtoForge] (TODO: peruse [http://www.techotopia.com/index.php/Installing_and_Configuring_Fedora_KVM_Virtualization Techotopia] manuals, [http://fedoraproject.org/wiki/Virtualization_Quick_Start Fedora-Getting started with virtualization])<br />
<br />
=== Week of May 18 ===<br />
<br />
* Discussed [http://acm.mscs.mu.edu/wiki-reu/ REU Wiki] with REU students.<br />
* Wrote [[trac:Flash|Flash memory]] and [[trac:SafeMemory|memory protection]] pages to the trac wiki with deadlines and some information.<br />
* Worked on KVM a bit more (no success yet) -- it seems to fail to create the graphics properly which halts the installation process.<br />
* Created SVN account and branch for wireless driver developer.<br />
* Began some preliminary work on memory protection (moving to region based memory)<br />
<br />
=== Week of May 25 ===<br />
* Enjoyed some relaxation time in [[w:Galena,_Illinois|Galena]].<br />
<br />
=== Week of June 1 ===<br />
* Moved some essentials of life back to Milwaukee.<br />
* Updated/rebooted mawdryn (arg).<br />
* Discussed network stack with members of Team Xinu.<br />
* Reread and reviewed -- Wentzlaff, D. and Agarwal, A. 2009. ''Factored operating systems (fos): the case for a scalable operating system for multicores.'' SIGOPS Operating Systems Review 43, 2 (Apr. 2009), 76-85. DOI=http://doi.acm.org/10.1145/1531793.1531805.<br />
* Updated and submitted my [http://www.mscs.mu.edu/~mschul/files/thesis-2009.pdf thesis].<br />
* Looking for potential conference/journal matches to submit a paper to ([http://www.usenix.org/events/byname/ USENIX], [http://www.ieee.org/web/publications/journmag/index.html IEEE], [http://www.acm.org/publications/journals ACM Journals], and [http://portal.acm.org/browse_dl.cfm?linked=1&part=series&coll=ACM&dl=ACM ACM Conferences]).<br />
** Format: ''Full Conference Name'' (Abbr., deadline, page limit) -- [http://citeseer.ist.psu.edu/impact.html est. impact]<br />
** ''[http://www.plosworkshop.org/2009/ Workshop on Programming Languages and Operating Systems]'' (PLOS, 2009 Jun 19, 5 pages) -- unknown.<br />
** ''[http://www.usenix.org/events/hotos09/ Workshop on Hot Topics in Operating Systems]'' (HotOS, 2010 Jan, 5 pages) -- 34.<br />
** ''[http://eurosys2010.sigops-france.fr/calls.html European Conference on Computer Systems]'' (EuroSys, 2009 Oct 19, 12 pages) -- unknown.<br />
** ''[http://www.usenix.org/events/usenix09/ USENIX Annual Technical Conference]'' (USENIX, 2010 Jan, 14 pages long form, 6 pages short form) -- 7.<br />
** ''[http://www.embedded.rwth-aachen.de/tacas2009/ Tools and Algorithms for the Construction and Analysis of Systems]'' (TACAS, 2009 October, 15 pages) -- ~175.<br />
** ''[http://www.oopsla.org/oopsla2009/ Object-Oriented Programming Systems, Languages and Applications]'' (OOPSLA, 2010 Mar, 18 pages) -- 28.<br />
** <strike>''[http://www.sigplan.org/lctes.htm Languages, Compilers, and Tools for Embedded Systems]'' (LCTES, 2010 Feb, 10 pages) -- 404</strike>.<br />
** <strike>''[http://www.emsoft.org/ International Conference on Embedded Software]'' (EMSOFT, 2010 May, 10 pages) -- 390</strike>.<br />
** <strike>''[http://www.usenix.org/events/osdi08/cfp/ Operating Systems Design and Implementation]'' (OSDI, 2010 May, 14 pages) -- 1</strike>.<br />
** <strike>''[http://tocs.acm.org/ Transactions on Computer Systems]'' (TOCS, rolling?, $100/page?) -- 8</strike>.<br />
** <strike>''[http://www2.computer.org/portal/web/tc/ IEEE Transactions on Computers]'' (TC, look for special issue, 14 regular/8 brief pages) -- 361</strike>.<br />
** <strike>''[http://www2.computer.org/portal/web/tse/ IEEE Transactions on Software Engineering]'' (TSE, look for special issue, 14 regular/8 short pages) -- unknown</strike>.<br />
** <strike>''[http://www3.interscience.wiley.com/journal/1752/home Software: Practice and Experience]'' (SP&E, rolling?, 40 pages) -- 558</strike>.<br />
* Updated and assigned tasks on the [[trac:Flash|Flash]] page, now has Samsung specification and instructions for storing a Flash image to morbius.<br />
<br />
=== Week of June 8 ===<br />
* Got rejected.<br />
* Reduced conferences to look at for paper submissions.<br />
* Finished work on region based memory allocator. ([[tracsrc:mips/branches/safemem|source]])<br />
** Xinu now (inefficiently) allocates page sized memory when requests are made.<br />
* Read paper<br />
** Stitt, G., Chaudhari, G., and Coole, J. 2008. ''Traversal caches: a first step towards FPGA acceleration of pointer-based data structures''. In Proceedings of the 6th IEEE/ACM/IFIP international Conference on Hardware/Software Codesign and System Synthesis (Atlanta, GA, USA, October 19 - 24, 2008). CODES/ISSS '08. ACM, New York, NY, 61-66. DOI=http://doi.acm.org/10.1145/1450135.1450150 <br />
* Built page mapping/unmapping functionality into Xinu for virtual memory<br />
** TODOs now include:<br />
*** Hacking together TLB initialization and modification code.<br />
*** Correctly use TLB during context switch.<br />
*** Build system call interface and associated system call functions.<br />
*** Make distinction between user-/kernel-level threads and/or processes.<br />
<br />
=== Week of June 15 ===<br />
* Reviewed papers<br />
** Ryzhyk, L., Chubb, P., Kuz, I., and Heiser, G. 2009. ''Dingo: taming device drivers.'' In Proceedings of the Fourth ACM European Conference on Computer Systems (Nuremberg, Germany, April 01 - 03, 2009). EuroSys '09. DOI=http://doi.acm.org/10.1145/1519065.1519095.<br />
** Fuad Tabba, Mark Moir, James R. Goodman, Andrew W. Hay, and Cong Wang. ''NZTM: Nonblocking Zero-indirection Transactional Memory.'' In Proceedings of the 2009 Symposium on Parallelism in Algorithms and Architectures (Calgary, Alberta, Canada, August 11 - 13, 2009). SPAA '09. URI=http://www.virtutech.com/files/academics/spaa091-tabba.pdf.<br />
* System Administration<br />
** Upgraded to [http://lists.wikimedia.org/pipermail/mediawiki-announce/2009-June/000086.html MediaWiki 1.15.0] on [http://acm.mscs.mu.edu/wiki-adam/ Adam's Wiki], [http://acm.mscs.mu.edu/wiki-scifi/ BadSciFi Wiki], [http://acm.mscs.mu.edu/wiki-reu/ MSCS REU Wiki], [http://acm.mscs.mu.edu/ Student ACM Wiki], and [http://xinu.mscs.mu.edu/ Embedded Xinu Wiki].<br />
** Then proceeded to upgrade all the wikis to use a "continuous integration" process like [http://www.wikipedia.org/ Wikipedia] does, so now all the wikis should use the latest trunk version of MediaWiki.<br />
** Modified some settings for the SMI repository.<br />
** <strike>Began writing a</strike> Completed a draft document discussing what administration tasks there are with mulug (available in <code>/var/mulug/README</code>).<br />
* Memory Protection<br />
** Began looking into system call interface. I've decided Xinu was never meant to have user mode -> kernel mode syscalls (see 20.5 of ''Operating System Design''). Implying that the ancient SYSCALL type is a bit of a misnomer. Though the interface is possible (and fairly easy), it would require special wrapper functions around every call deemed to be a system call.<br />
<br />
=== Week of June 22 ===<br />
* Reviewed Paper<br />
** Maeda, S., Asano, S., Shimada, T., Awazu, K., and Tago, H. 2005. ''A Real-Time Software Platform for the Cell Processor''. IEEE Micro 25, 5 (Sep. 2005), 20-29. DOI=http://dx.doi.org/10.1109/MM.2005.79<br />
* Memory Protection<br />
** Filling out TLB EntryHi and EntryLo[0,1] fields with data from processes page table. Doesn't work. Getting Bus error exception with both fast (assembly) and slow (C) handlers.<br />
** Building a version of [http://www.openwrt.org/ OpenWRT] to (hopefully) dump and look at values in TLB.<br />
** Fixed above problem (right shift PFN 6 bits), I thought they were 'reserved' bits---I was wrong, it works now<br />
** Fixed a few other bugs to get TLB working consistently in mapped memory space<br />
** Began working on syscall interface, still needs testing.<br />
* Got some benchmarks to run with nepsim and told [http://acm.mscs.mu.edu/wiki-reu/index.php/User:Rberg Ryan] how to build nepsim on 64-bit machines (and execute without a segfault).<br />
* Helped with some computational sciences for high school teachers activities<br />
<br />
=== Week of June 29 ===<br />
* Reviewed paper<br />
** Klassner, F. and Continanza, C. 2007. ''Mindstorms without robotics: an alternative to simulations in systems courses.'' In Proceedings of the 38th SIGCSE Technical Symposium on Computer Science Education (Covington, Kentucky, USA, March 07 - 11, 2007). SIGCSE '07. ACM, New York, NY, 175-179. DOI=http://doi.acm.org/10.1145/1227310.1227372<br />
* Added syscall interface to safemem branch, now some cleanup work is necessary and a re-review of the files added. (+ commenting functions)<br />
* Tinkered with KVM on Fedora 11 (it seems to work well).<br />
* Helped find/fix various bugs in network stack.<br />
<br />
=== Week of July 6 ===<br />
* Began working on cleanup/documentation/confirmation of all memory related subsystems (region allocator, paging, tlb, syscall interface)<br />
** Stuck thinking about how to allocate the allocators. (Region based, byte based, malloc/memget, ...)<br />
* Read<br />
** Yang, X., Cooprider, N., and Regehr, J. 2009. ''Eliminating the call stack to save RAM.'' In Proceedings of the 2009 ACM SIGPLAN/SIGBED Conference on Languages, Compilers, and Tools For Embedded Systems (Dublin, Ireland, June 19 - 20, 2009). LCTES '09. ACM, New York, NY, 60-69. DOI=http://doi.acm.org/10.1145/1542452.1542461.<br />
* Adapted to Fedora 11 on mawdryn<br />
** Installed "morbius" virtual machine on mawdryn (doesn't have a MAC address in the database, so none of the standard configuration script ran.)<br />
* Went to Door County on Friday (sorry).<br />
<br />
=== Week of July 13 ===<br />
* Worked on memory allocator<br />
** Pages are allocated to a process (but not recovered until process is killed).<br />
** memget tries to allocate from the freelist of the current process, if enough memory doesn't exist it fetches another page (or pages) and allocates it to the process' freelist.<br />
** memfree simply returns a pointer with nbytes of memory to the process' freelist.<br />
** working on some bugs with memRegionReclaim when a process is killed.<br />
** corrected bug in reclaim<br />
** completed kernel/user allocators (still needs some testing)<br />
** memRegionTransfer should also move the memlist from process to process<br />
* Read paper<br />
** Takacs, G., Chandrasekhar, V., Gelfand, N., Xiong, Y., Chen, W., Bismpigiannis, T., Grzeszczuk, R., Pulli, K., and Girod, B. 2008. ''Outdoors augmented reality on mobile phone using loxel-based visual feature organization.'' In Proceeding of the 1st ACM international Conference on Multimedia information Retrieval (Vancouver, British Columbia, Canada, October 30 - 31, 2008). MIR '08. ACM, New York, NY, 427-434. DOI=http://doi.acm.org/10.1145/1460096.1460165.<br />
* Most importantly, I updated the Xinu banner for release of 2.0.<br />
____ ___.__ <br />
\ \/ /|__| ____ __ __ <br />
\ / | |/ \| | \ <br />
/ \ | | | \ | / <br />
/___/\ \|__|___| /____/ <br />
\_/ \/ v2.0 <br />
* Helped various people in the lab.<br />
<br />
=== Week of July 20 ===<br />
* Read paper for Tuesday<br />
** Quach, B., Balakrishnan, M., Benhaddou, D., and Yuan, X. 2009. ''Implementation of integrated wireless health monitoring network''. In Proceedings of the 1st ACM international Workshop on Medical-Grade Wireless Networks (New Orleans, Louisiana, USA, May 18 - 18, 2009). WiMD '09. ACM, New York, NY, 63-68. DOI=http://doi.acm.org/10.1145/1540373.1540390<br />
* Re-implemented safemem slightly<br />
** Now has a separate user heap (using malloc/free calls) and kernel heap (using memget/memfree)<br />
** User heap is of size #define UHEAP_SIZE (currently set to 8MB) in xinu.conf<br />
*** If UHEAP_SIZE is not defined, there is no user heap and malloc always returns NULL<br />
** Only user heap memory is mapped into page table<br />
** Since Embedded Xinu uses only memory protection, we use a single global page table holding the page table entry and address space identifier (thread id)<br />
** When a TLB exception occurs, the system attempts to load the page table entry<br />
*** If the entry is null or the current thread id is not the ASID for the entry, the thread is killed and outputs "Memory protection violation" to stderr<br />
** The entire kernel is mapped as read-only, global memory so any thread can read kernel memory, but not write to it.<br />
** The TLB can be enabled/disabled by defining/undefining the USE_TLB #define in xinu.conf<br />
** Entire user memory subsystem is in the mem/ folder with only four calls in the kernel (each protected with #ifdef UHEAP_SIZE)<br />
*** system/kill.c attempts to memRegionReclaim when the thread is killed.<br />
*** system/initialize.c acquires UHEAP_SIZE using memget, then attempts to initialize the memory subsystem with memInit (setup the user heap), safeInit (setup memory protection), and safeKmapInit (insert kernel mappings).<br />
** TLB initialized with one call in system/initialize.c protected by #ifdef USE_TLB with all TLB code residing in mem/ as well.<br />
* Helped various people in the lab.<br />
* Relaxed in Northern Wisconsin Thursday and Friday<br />
** Read paper for Tuesday<br />
*** Mankin, J., Kaeli, D., and Ardini, J. 2009. ''Software transactional memory for multicore embedded systems''. In Proceedings of the 2009 ACM SIGPLAN/SIGBED Conference on Languages, Compilers, and Tools For Embedded Systems (Dublin, Ireland, June 19 - 20, 2009). LCTES '09. ACM, New York, NY, 90-98. DOI=http://doi.acm.org/10.1145/1542452.1542465<br />
<br />
=== Week of July 27 ===<br />
* Wrote catalogue of activities from last week.<br />
* Began looking at some network code<br />
** Began getting sad.<br />
* Corrected bug in tlbMissHandler that would effectively disable interrupts<br />
** Originally when a memory violation occurred the handler would kill(thrcurrent), exlset(), and resched().<br />
*** Obviously this is incorrect. kill(thrcurrent) has a call to resched() in it and exlset doesn't allow exceptions to occur.<br />
** Now when a memory violation occurs the handler will exlreset() and kill(thrcurrent).<br />
* Moved around code in malloc and memRegionAlloc to more logically separate thread based memory and region based memory.<br />
** memRegionAlloc will allocate the region and return the region allocated to the caller.<br />
** malloc tries to allocate memory from thread->memlist, then tries a memRegionAlloc and inserts remaining memory in thread->memlist<br />
* Expanded the Embedded Xinu [[memory]] page by 30%! Added links to [[flash memory]] and [[memory management]].<br />
** Fleshed out the [[flash memory]], [[TRX header]], and [[flash driver]] pages.<br />
<br />
=== Week of August 3 ===</div>Michaelhttps://xinu.cs.mu.edu/index.php?title=Flash_driver&diff=3484Flash driver2009-07-29T20:14:46Z<p>Michael: Updated the Flash driver page</p>
<hr />
<div>[[Embedded Xinu]] uses a multi-layered approach to dealing with [[Flash memory]]. This allows the presentation of a simple and consistent interface to user programs, while handling the more complicated hardware interface underneath.<br />
<br />
== High level API ==<br />
<br />
Like other drivers in Embedded Xinu, the Flash driver provides user level calls to <code>open()</code>, <code>close()</code>, <code>read()</code>, <code>write()</code>, and <code>control()</code>. In order to begin using a device the user must <code>open()</code> it, this initializes the logical layer and sets up structures for use. The complimentary <code>close()</code> function will clear those structures and write any cached data to the underlying Flash hardware. <br />
<br />
<code>control()</code> provides several functions for getting information and performing operations on the driver. The control functions are presented below.<br />
<br />
* <code>FLASH_BLOCK_SIZE</code> returns the size of logical blocks for the Flash device.<br />
* <code>FLASH_N_BLOCKS</code> returns the number of block available on the Flash device.<br />
* <code>FLASH_SYNC</code> forces a synchronization from cached data onto Flash memory, the two forms are:<br />
** <code>FLASH_BLOCK</code> synchronizes a specific erase block, and<br />
** <code>FLASH_LOGBLOCK</code> synchronizes a logical block of data.<br />
<br />
=== <code>read()</code> and <code>write()</code> ===<br />
<br />
The Flash device takes three slightly different parameters for <code>read()</code> and <code>write()</code> when compared to other devices in Embedded Xinu. Normal devices will take the device identifier, a buffer, and the size of the buffer. Since the Flash device uses fixed size logical blocks, it is assumed that the buffer will be the size of a single logical block. Therefore, the Flash driver API for <code>read()</code> and <code>write()</code> is:<br />
<br />
<source lang="c"><br />
read(int device_id, char *buffer, uint block_number);<br />
write(int device_id, char *buffer, uint block_number);<br />
</source><br />
<br />
== Logical Layer ==<br />
<br />
Normal block-oriented devices present a consistent view of data storage with each block being a small fixed size ranging from 512 bytes to 4,096 bytes. Flash memory does not act like normal block-oriented devices though. The underlying hardware is separated into erase block regions of which there can be four. Each erase block region can hold a number of erase blocks of a fixed size. These fixed sizes can be any size that is a power of two. For example, on the [[WRT54GL]] platform, Flash is separated into two erase block regions, one with 8 - 8 KB erase blocks and the other with 63 - 64 KB erase blocks.<br />
<br />
To avoid the user level programmer from having to deal with this inconsistent view of erase blocks, the logical layer of the Flash driver splits all of Flash memory into uniformly sized logical blocks (at present this is 512 byte blocks). When a call to <code>read()</code> occurs, the logical layer will determine what erase block the logical block maps to, determine if the erase block has already been loaded into RAM and return a pointer to the cached data. Similarly, a call to <code>write()</code> will perform a mapping from logical to erase block and write the data to the cached memory. If too many erase blocks are stored in RAM, the logical layer will evict a block and if it has been modified since the read it will write it back to Flash memory.<br />
<br />
== Physical Layer ==<br />
<br />
Once the logical to erase block mapping has occurred, the logical layer can pass the erase block stored in RAM to the physical layer to perform the low level hardware operations. At this layer, the software only deals in erase block units and uses manufacturer specific code. Currently, Embedded Xinu fully supports the Intel Standard Command Set (SCS) and the AMD/Samsung SCS is a work in progress.<br />
<br />
Largely, the routines to handle the hardware follow similar concepts. When a non-read request is made to the physical layer the software steps through a series of operations to change an erase block from read-mode to program or erase mode. When this happens, the software is able to safely modify the data.<br />
<br />
An interesting property of Flash memory is that certain devices allow program and erase operations to be suspended, so it may be possible to spin the physical layer off as a separate pre-emptible process. Unfortunately, while the Intel SCS supports suspend/resume operations the AMD/Samsung SCS does not, so this would lead to compatibility issues if implemented.<br />
<br />
== NVRAM ==<br />
<br />
[[Flash memory#NVRAM|NVRAM settings]] are stored in Flash memory and take advantage of both the logical and physical layers of the Flash driver. When NVRAM is first initialized, the Flash driver determines what logical block the settings begin in and then begins reading and storing the settings into RAM. Each tuple is indexed into a hash table and allocated a piece of memory to store the data in. When a setting is changed, the original value is released from memory and the new value is added. If a value is requested, the driver will simply find the storage location and return the pointer to the data.<br />
<br />
When the updated settings are committed to Flash, the NVRAM driver will discover the logical block to erase block mapping, create a complete erase block with the new settings, cause a write in the physical layer, and finally force a synchronization to commit the settings to Flash.</div>Michaelhttps://xinu.cs.mu.edu/index.php?title=Flash_driver&diff=3482Flash driver2009-07-29T18:53:22Z<p>Michael: Created a stub for new Flash driver page</p>
<hr />
<div>[[Embedded Xinu]] uses a multi-layered approach to dealing with [[Flash memory]]. This allows the presentation of a simple and consistent interface to user programs, while handling the more complicated hardware interface underneath.<br />
<br />
== High level API ==<br />
<br />
Like other drivers in Embedded Xinu, the Flash driver provides user level calls to <code>open()</code>, <code>close()</code>, <code>read()</code>, <code>write()</code>, <code>control()</code>, and <code>seek()</code>.<br />
<br />
=== <code>read()</code> and <code>write()</code> ===<br />
<br />
Both <code>read()</code> and <code>write()</code> take three parameters (<code>device_id</code>, <code>buffer</code>, and <code>block_number</code>). This is unlike other device calls where the final parameter is the size of the buffer.<br />
<br />
== Logical Layer ==<br />
<br />
Maps the high level 512 byte block size to the underlying erase block size and location for reading and writing. Loads an entire erase block into RAM and marks it as dirty if modified.<br />
<br />
== Physical Layer ==<br />
<br />
Handles interfacing with the underlying hardware by erasing the erase blocks when needed.<br />
<br />
=== Intel ===<br />
<br />
Provides an interface for working with the Intel Standard Command Set.<br />
<br />
=== AMD/Samsung ===<br />
<br />
Provides an interface for working with the AMD/Samsung Standard Command Set.<br />
<br />
== NVRAM ==<br />
<br />
Since [[Flash memory#NVRAM|NVRAM]] settings are part of Flash memory, the code to modify them is closely related to the Flash driver.</div>Michaelhttps://xinu.cs.mu.edu/index.php?title=Talk:Flash_driver/Original&diff=3480Talk:Flash driver/Original2009-07-29T18:39:48Z<p>Michael: moved Flash driver to Talk:Flash driver/Original: Archived original flash driver page</p>
<hr />
<div>[[Image:Flash-design.png|450px|right]]<br />
The [[WRT54GL]] has a 4MB Intel Flash chip which is able to store [[CFE]], [[NVRAM|NVRAM settings]], an operating system (like [[OpenWRT]] or Linksys' operating system (or even [[XINU]]), and optionally a file system. Currently the bleeding edge version of XINU in the flashmem branch has a working Flash driver, though it is not the one on this page and will be replaced with the driver described in this document. GL-series routers have 2 erase-block regions (8-8KB and 63-64KB).<br />
<br />
Flash memory remains minimally tested on the [[WRT54G]]. XINU reports that the G-series has 2MB of Flash memory, separated into 4 regioins of varying erase-block sizes (1-16KB, 2-8KB, 1-32KB, and 31-64KB).<br />
<br />
== Terminology ==<br />
<br />
Flash is bounded by the rule that to program the software may only change a 1-bit to a 0-bit and cannot change from a 0 to a 1. Because of this, it is often necesary to erase a block of memory (setting all bits in the block to 1) and then write data to it. This is known as an "erasae-block". The majority of these seem to be in the 64 kilobyte range, with the smallest being a massive 8 kilobyte erase-block. This causes a problem as most file systems work in 512 byte blocks or 2048 byte blocks, both of which are substantially smaller than the smallest erase-block. The [[Flash driver#Logical Flash Interface|logical flash interface]] attempts to solve this problem by presenting standard 512 byte blocks to the higher layers while maintaining erase-block regions within physical flash memory.<br />
<br />
== Physical Flash ==<br />
<br />
The base location of physical Flash is stored in a flash structure and for both series of routers is 0xBC000000.<br />
<br />
As stated above physical Flash is seperated into erase-blocks which are the smallest writable unit on Flash memory. The GL-series and the G-series have differing Flash sizes and erase-block layouts. The 4MB GLs have 2 erase-block regions with the first having 8-8 kilobyte erase-blocks and the second having 63-64 kilobyte erase-blocks. The 2MB Gs have 4 erase-block regions, the first having 1-16 kilobyte erase-block, followed by 2-8 kilobyte erase-blocks, then 1-32 kilobyte erase-block, and finally 31-64 kilobyte erase-blocks.<br />
<br />
Because of these inconsistencies, this driver will use the Logical Flash Interface to provide a standard view of Flash memory with a fixed block size throughout.<br />
<br />
== Logical Flash Interface ==<br />
<br />
The logical Flash interface will do the bulk of the work needed for accessing flash memory. It will enforce the rules for what memory can be changed, present standard 512 byte block sizes to the upper layers, ensure that erase-blocks are not incorrectly modified (writing 512 bytes to a much larger erase-block would destroy most the data in the erase-block), and also provide an interface into the NVRAM settings of flash memory.<br />
<br />
When a 512 byte logical block is requested the logical Flash interface will read the entire erase-block into memory and pass the proper logical block through to the requester. When attempting to write the same logical block back the interface will recognize that the erase-block is in memory, overwrite the block, and write the erase-block back to Flash. Although the last portion could be modified to only write back to disk when a synchronization is requested, thus the Flash interface could maintain a collection of erase-blocks only writing them to Flash when too many exist or upon a synchronization request.<br />
<br />
== Lower Driver (Optional) ==<br />
<br />
== Upper Driver ==<br />
<br />
The upper driver can communicate directly with the logical Flash interface or use a lower driver if desired with slight code modification. The purpose of the upper driver is to present a simple interface to the rest of the operating system for all Flash input/output. The API is as follows:<br />
<br />
read(FLASH, unsigned char *buffer, ulong block)<br />
<br />
This call will read into a buffer (which should be a pointer to a 512 byte region of memory) the specified block. For the 4MB Flash there are (4*1024*1024 / DISK_BLOCK_SIZE) blocks. It is up to the file system or programmer to know what block to request (although some blocks are off-limits, this is handeled by the logical Flash interface). This will return OK on a successful read and SYSERR on any error.<br />
<br />
write(FLASH, unsigned char *buffer, ulong block)<br />
<br />
Similar to <code>read()</code>, this will write the contents of buffer to the specified block. Again the logical Flash interface will know legal and illegal positions to write. This will return OK on a successful write and SYSERR on any error.<br />
<br />
seek(FLASH, ulong block)<br />
<br />
Seek will simply take the given block and return the position relative to Flash (Flash beginning at 0x00000000). So calling <code>seek(FLASH, 100)</code> will return the position of the 100th block of Flash (100 * DISK_BLOCK_SIZE). Instead of just performing the multiplication in the code, using <code>seek()</code> will provide a type of pre-check, if the block being seek'd to is outside of the range of Flash or if the logical Flash interface deems that block protected (in CFE's memory or NVRAM settings), it will return SYSERR.</div>Michaelhttps://xinu.cs.mu.edu/index.php?title=Flash_driver&diff=3481Flash driver2009-07-29T18:39:48Z<p>Michael: moved Flash driver to Talk:Flash driver/Original: Archived original flash driver page</p>
<hr />
<div>#REDIRECT [[Talk:Flash driver/Original]]</div>Michaelhttps://xinu.cs.mu.edu/index.php?title=Main_Page&diff=3479Main Page2009-07-29T18:36:54Z<p>Michael: Linked to Flash memory instead of Flash driver</p>
<hr />
<div>Embedded Xinu is an ongoing research and implementation project in the area of Operating Systems and Embedded Systems. Its goal is to port the [[Xinu|Xinu Operating System]] to the MIPS platform by specifically targeting Linksys WRT54GL routers. While this project is still in progress, our prototype laboratory environment is already being used as the platform for courses<br />
in Operating Systems, Hardware Systems, Embedded Systems, and Compilers. We're also working on support for Networking and Internetworking classes.<br />
<br />
The Embedded Xinu project was conceived and is supervised by [http://www.mscs.mu.edu/~brylow/ Dr. Dennis Brylow] and is being conducted by both graduate and undergraduate students in the [http://www.mscs.mu.edu/ Math, Statistics, & Computer Science] department of [http://www.mu.edu/ Marquette University] in Milwaukee, Wisconsin. The first major phase of work on Embedded Xinu began in the Summer of 2006.<br />
<br />
== Building an Embedded Xinu Laboratory ==<br />
<br />
In this section we are developing instructions so that other groups can benefit from the work we are doing. These guides can be followed more or less in order to create a relatively inexpensive platform for a custom operating system. As our work develops further, there will be more Xinu-specific information.<br />
<br />
# Obtain a [[List of supported platforms|supported platform]].<br />
# [[HOWTO:Modify the Linksys hardware|Modify the Linksys hardware]]<br />
# [[HOWTO:Connect to a modified router|Connect to a modified router]]<br />
# [[HOWTO:Build Xinu|Build Xinu]]<br />
# [[HOWTO:Deploy Xinu|Deploy Xinu]]<br />
# (Optional) [[HOWTO:Build Backend Pool|Build a pool of backends]]<br />
<br />
== Other Embedded Xinu Information ==<br />
<br />
* MIPS [[processor]]<br />
* Main [[memory]]<br />
* [[Exception and Interrupt Handling]]<br />
* [[UART driver]]<br />
* [[TTY driver]]<br />
* [[Flash memory]]<br />
* [[EJTAG|Enhanced Joint Test Action Group]] debugger<br />
* [[Standard library]]<br />
<br />
----<br />
<br />
<small><small><small>The Xinu Lab is brought to you in part by [[XMMS|M&M's]].</small></small></small><br />
<!--<br />
-->__NOTOC__<!-- Disable "Contents" box from showing --><!--<br />
-->__NOEDITSECTION__<!-- Disable [edit] from appearing --><!--<br />
--></div>Michaelhttps://xinu.cs.mu.edu/index.php?title=User:Michael&diff=3478User:Michael2009-07-29T18:35:32Z<p>Michael: /* Week of July 27 */ Wrote TRX header page stub</p>
<hr />
<div>{| align="right" style="padding:0 5px;"<br />
| __TOC__<br />
|}<br />
<br />
Currently I am a in-between graduate student working at Marquette University. I have completed my thesis ([http://www.mscs.mu.edu/~mschul/files/thesis-2009.pdf Using Software Transactional Memory in Interrupt-Driven Systems]), but it was about one week late &mdash; so my graduation was pushed back to August 2009. At the end of the summer I will move to St. Louis and begin working on a Ph.D. in Computer Science at [http://www.wustl.edu Washington University].<br />
<br />
However, until then I am a research assistant for [http://www.mscs.mu.edu/~brylow/ Dr. Dennis Brylow]. At present I am continuing my research with software transactional memory and operating systems. In my spare geek time, I plan on fleshing out or starting up various parts of the Embedded Xinu O/S, as well as doing various administrative lab tasks.<br />
<br />
If you want more detailed information about me and my academic career you can visit the website of [http://www.mscs.mu.edu/~mschul/ Michael J. Schultz]!<br />
<br />
== Weekly Log (Summer 2009) ==<br />
<br />
=== Week of May 11 ===<br />
<br />
* Completed marriage transaction!<br />
* Generated user accounts for new Team Xinu members.<br />
* Reviewed a few papers, notably:<br />
** Liedtke, J. 1995. ''On <math>\mu</math>-kernel construction.'' SIGOPS Operating Systems Review 29, 5 (Dec. 1995), 237-250. DOI=http://doi.acm.org/10.1145/224057.224075 <br />
** Wentzlaff, D. and Agarwal, A. 2009. ''Factored operating systems (fos): the case for a scalable operating system for multicores.'' SIGOPS Operating Systems Review 43, 2 (Apr. 2009), 76-85. DOI=http://doi.acm.org/10.1145/1531793.1531805<br />
** Miller, F. W. ''Simple Memory Protection for Embedded Operating System Kernels.'' 2002 FREENIX Track Technical Program. URL=http://www.usenix.org/events/usenix02/tech/freenix/miller.html<br />
* Created [http://acm.mscs.mu.edu/wiki-reu/ Research Experiences for Undergraduates] wiki for MSCS REU students (and installed necessary extensions).<br />
* Updated all wikis to user MediaWiki 1.14.0 ([http://acm.mscs.mu.edu/wiki-adam/ Adam's Wiki], [http://acm.mscs.mu.edu/wiki-scifi/ BadSciFi Wiki], [http://acm.mscs.mu.edu/wiki-reu/ MSCS REU Wiki], [http://acm.mscs.mu.edu/ Student ACM Wiki], [http://xinu.mscs.mu.edu/ Embedded Xinu Wiki])<br />
* Updated the all important [http://www.mscs.mu.edu/~mschul/rpms/fortune/ fortune-sys-lab] package to 1.0.1-1 to include [[quotes]] through Spring 2009.<br />
* Began tinkering with KVM on Fedora 10 using [http://www.howtoforge.com/virtualization-with-kvm-on-a-fedora-10-server HowtoForge] (TODO: peruse [http://www.techotopia.com/index.php/Installing_and_Configuring_Fedora_KVM_Virtualization Techotopia] manuals, [http://fedoraproject.org/wiki/Virtualization_Quick_Start Fedora-Getting started with virtualization])<br />
<br />
=== Week of May 18 ===<br />
<br />
* Discussed [http://acm.mscs.mu.edu/wiki-reu/ REU Wiki] with REU students.<br />
* Wrote [[trac:Flash|Flash memory]] and [[trac:SafeMemory|memory protection]] pages to the trac wiki with deadlines and some information.<br />
* Worked on KVM a bit more (no success yet) -- it seems to fail to create the graphics properly which halts the installation process.<br />
* Created SVN account and branch for wireless driver developer.<br />
* Began some preliminary work on memory protection (moving to region based memory)<br />
<br />
=== Week of May 25 ===<br />
* Enjoyed some relaxation time in [[w:Galena,_Illinois|Galena]].<br />
<br />
=== Week of June 1 ===<br />
* Moved some essentials of life back to Milwaukee.<br />
* Updated/rebooted mawdryn (arg).<br />
* Discussed network stack with members of Team Xinu.<br />
* Reread and reviewed -- Wentzlaff, D. and Agarwal, A. 2009. ''Factored operating systems (fos): the case for a scalable operating system for multicores.'' SIGOPS Operating Systems Review 43, 2 (Apr. 2009), 76-85. DOI=http://doi.acm.org/10.1145/1531793.1531805.<br />
* Updated and submitted my [http://www.mscs.mu.edu/~mschul/files/thesis-2009.pdf thesis].<br />
* Looking for potential conference/journal matches to submit a paper to ([http://www.usenix.org/events/byname/ USENIX], [http://www.ieee.org/web/publications/journmag/index.html IEEE], [http://www.acm.org/publications/journals ACM Journals], and [http://portal.acm.org/browse_dl.cfm?linked=1&part=series&coll=ACM&dl=ACM ACM Conferences]).<br />
** Format: ''Full Conference Name'' (Abbr., deadline, page limit) -- [http://citeseer.ist.psu.edu/impact.html est. impact]<br />
** ''[http://www.plosworkshop.org/2009/ Workshop on Programming Languages and Operating Systems]'' (PLOS, 2009 Jun 19, 5 pages) -- unknown.<br />
** ''[http://www.usenix.org/events/hotos09/ Workshop on Hot Topics in Operating Systems]'' (HotOS, 2010 Jan, 5 pages) -- 34.<br />
** ''[http://eurosys2010.sigops-france.fr/calls.html European Conference on Computer Systems]'' (EuroSys, 2009 Oct 19, 12 pages) -- unknown.<br />
** ''[http://www.usenix.org/events/usenix09/ USENIX Annual Technical Conference]'' (USENIX, 2010 Jan, 14 pages long form, 6 pages short form) -- 7.<br />
** ''[http://www.embedded.rwth-aachen.de/tacas2009/ Tools and Algorithms for the Construction and Analysis of Systems]'' (TACAS, 2009 October, 15 pages) -- ~175.<br />
** ''[http://www.oopsla.org/oopsla2009/ Object-Oriented Programming Systems, Languages and Applications]'' (OOPSLA, 2010 Mar, 18 pages) -- 28.<br />
** <strike>''[http://www.sigplan.org/lctes.htm Languages, Compilers, and Tools for Embedded Systems]'' (LCTES, 2010 Feb, 10 pages) -- 404</strike>.<br />
** <strike>''[http://www.emsoft.org/ International Conference on Embedded Software]'' (EMSOFT, 2010 May, 10 pages) -- 390</strike>.<br />
** <strike>''[http://www.usenix.org/events/osdi08/cfp/ Operating Systems Design and Implementation]'' (OSDI, 2010 May, 14 pages) -- 1</strike>.<br />
** <strike>''[http://tocs.acm.org/ Transactions on Computer Systems]'' (TOCS, rolling?, $100/page?) -- 8</strike>.<br />
** <strike>''[http://www2.computer.org/portal/web/tc/ IEEE Transactions on Computers]'' (TC, look for special issue, 14 regular/8 brief pages) -- 361</strike>.<br />
** <strike>''[http://www2.computer.org/portal/web/tse/ IEEE Transactions on Software Engineering]'' (TSE, look for special issue, 14 regular/8 short pages) -- unknown</strike>.<br />
** <strike>''[http://www3.interscience.wiley.com/journal/1752/home Software: Practice and Experience]'' (SP&E, rolling?, 40 pages) -- 558</strike>.<br />
* Updated and assigned tasks on the [[trac:Flash|Flash]] page, now has Samsung specification and instructions for storing a Flash image to morbius.<br />
<br />
=== Week of June 8 ===<br />
* Got rejected.<br />
* Reduced conferences to look at for paper submissions.<br />
* Finished work on region based memory allocator. ([[tracsrc:mips/branches/safemem|source]])<br />
** Xinu now (inefficiently) allocates page sized memory when requests are made.<br />
* Read paper<br />
** Stitt, G., Chaudhari, G., and Coole, J. 2008. ''Traversal caches: a first step towards FPGA acceleration of pointer-based data structures''. In Proceedings of the 6th IEEE/ACM/IFIP international Conference on Hardware/Software Codesign and System Synthesis (Atlanta, GA, USA, October 19 - 24, 2008). CODES/ISSS '08. ACM, New York, NY, 61-66. DOI=http://doi.acm.org/10.1145/1450135.1450150 <br />
* Built page mapping/unmapping functionality into Xinu for virtual memory<br />
** TODOs now include:<br />
*** Hacking together TLB initialization and modification code.<br />
*** Correctly use TLB during context switch.<br />
*** Build system call interface and associated system call functions.<br />
*** Make distinction between user-/kernel-level threads and/or processes.<br />
<br />
=== Week of June 15 ===<br />
* Reviewed papers<br />
** Ryzhyk, L., Chubb, P., Kuz, I., and Heiser, G. 2009. ''Dingo: taming device drivers.'' In Proceedings of the Fourth ACM European Conference on Computer Systems (Nuremberg, Germany, April 01 - 03, 2009). EuroSys '09. DOI=http://doi.acm.org/10.1145/1519065.1519095.<br />
** Fuad Tabba, Mark Moir, James R. Goodman, Andrew W. Hay, and Cong Wang. ''NZTM: Nonblocking Zero-indirection Transactional Memory.'' In Proceedings of the 2009 Symposium on Parallelism in Algorithms and Architectures (Calgary, Alberta, Canada, August 11 - 13, 2009). SPAA '09. URI=http://www.virtutech.com/files/academics/spaa091-tabba.pdf.<br />
* System Administration<br />
** Upgraded to [http://lists.wikimedia.org/pipermail/mediawiki-announce/2009-June/000086.html MediaWiki 1.15.0] on [http://acm.mscs.mu.edu/wiki-adam/ Adam's Wiki], [http://acm.mscs.mu.edu/wiki-scifi/ BadSciFi Wiki], [http://acm.mscs.mu.edu/wiki-reu/ MSCS REU Wiki], [http://acm.mscs.mu.edu/ Student ACM Wiki], and [http://xinu.mscs.mu.edu/ Embedded Xinu Wiki].<br />
** Then proceeded to upgrade all the wikis to use a "continuous integration" process like [http://www.wikipedia.org/ Wikipedia] does, so now all the wikis should use the latest trunk version of MediaWiki.<br />
** Modified some settings for the SMI repository.<br />
** <strike>Began writing a</strike> Completed a draft document discussing what administration tasks there are with mulug (available in <code>/var/mulug/README</code>).<br />
* Memory Protection<br />
** Began looking into system call interface. I've decided Xinu was never meant to have user mode -> kernel mode syscalls (see 20.5 of ''Operating System Design''). Implying that the ancient SYSCALL type is a bit of a misnomer. Though the interface is possible (and fairly easy), it would require special wrapper functions around every call deemed to be a system call.<br />
<br />
=== Week of June 22 ===<br />
* Reviewed Paper<br />
** Maeda, S., Asano, S., Shimada, T., Awazu, K., and Tago, H. 2005. ''A Real-Time Software Platform for the Cell Processor''. IEEE Micro 25, 5 (Sep. 2005), 20-29. DOI=http://dx.doi.org/10.1109/MM.2005.79<br />
* Memory Protection<br />
** Filling out TLB EntryHi and EntryLo[0,1] fields with data from processes page table. Doesn't work. Getting Bus error exception with both fast (assembly) and slow (C) handlers.<br />
** Building a version of [http://www.openwrt.org/ OpenWRT] to (hopefully) dump and look at values in TLB.<br />
** Fixed above problem (right shift PFN 6 bits), I thought they were 'reserved' bits---I was wrong, it works now<br />
** Fixed a few other bugs to get TLB working consistently in mapped memory space<br />
** Began working on syscall interface, still needs testing.<br />
* Got some benchmarks to run with nepsim and told [http://acm.mscs.mu.edu/wiki-reu/index.php/User:Rberg Ryan] how to build nepsim on 64-bit machines (and execute without a segfault).<br />
* Helped with some computational sciences for high school teachers activities<br />
<br />
=== Week of June 29 ===<br />
* Reviewed paper<br />
** Klassner, F. and Continanza, C. 2007. ''Mindstorms without robotics: an alternative to simulations in systems courses.'' In Proceedings of the 38th SIGCSE Technical Symposium on Computer Science Education (Covington, Kentucky, USA, March 07 - 11, 2007). SIGCSE '07. ACM, New York, NY, 175-179. DOI=http://doi.acm.org/10.1145/1227310.1227372<br />
* Added syscall interface to safemem branch, now some cleanup work is necessary and a re-review of the files added. (+ commenting functions)<br />
* Tinkered with KVM on Fedora 11 (it seems to work well).<br />
* Helped find/fix various bugs in network stack.<br />
<br />
=== Week of July 6 ===<br />
* Began working on cleanup/documentation/confirmation of all memory related subsystems (region allocator, paging, tlb, syscall interface)<br />
** Stuck thinking about how to allocate the allocators. (Region based, byte based, malloc/memget, ...)<br />
* Read<br />
** Yang, X., Cooprider, N., and Regehr, J. 2009. ''Eliminating the call stack to save RAM.'' In Proceedings of the 2009 ACM SIGPLAN/SIGBED Conference on Languages, Compilers, and Tools For Embedded Systems (Dublin, Ireland, June 19 - 20, 2009). LCTES '09. ACM, New York, NY, 60-69. DOI=http://doi.acm.org/10.1145/1542452.1542461.<br />
* Adapted to Fedora 11 on mawdryn<br />
** Installed "morbius" virtual machine on mawdryn (doesn't have a MAC address in the database, so none of the standard configuration script ran.)<br />
* Went to Door County on Friday (sorry).<br />
<br />
=== Week of July 13 ===<br />
* Worked on memory allocator<br />
** Pages are allocated to a process (but not recovered until process is killed).<br />
** memget tries to allocate from the freelist of the current process, if enough memory doesn't exist it fetches another page (or pages) and allocates it to the process' freelist.<br />
** memfree simply returns a pointer with nbytes of memory to the process' freelist.<br />
** working on some bugs with memRegionReclaim when a process is killed.<br />
** corrected bug in reclaim<br />
** completed kernel/user allocators (still needs some testing)<br />
** memRegionTransfer should also move the memlist from process to process<br />
* Read paper<br />
** Takacs, G., Chandrasekhar, V., Gelfand, N., Xiong, Y., Chen, W., Bismpigiannis, T., Grzeszczuk, R., Pulli, K., and Girod, B. 2008. ''Outdoors augmented reality on mobile phone using loxel-based visual feature organization.'' In Proceeding of the 1st ACM international Conference on Multimedia information Retrieval (Vancouver, British Columbia, Canada, October 30 - 31, 2008). MIR '08. ACM, New York, NY, 427-434. DOI=http://doi.acm.org/10.1145/1460096.1460165.<br />
* Most importantly, I updated the Xinu banner for release of 2.0.<br />
____ ___.__ <br />
\ \/ /|__| ____ __ __ <br />
\ / | |/ \| | \ <br />
/ \ | | | \ | / <br />
/___/\ \|__|___| /____/ <br />
\_/ \/ v2.0 <br />
* Helped various people in the lab.<br />
<br />
=== Week of July 20 ===<br />
* Read paper for Tuesday<br />
** Quach, B., Balakrishnan, M., Benhaddou, D., and Yuan, X. 2009. ''Implementation of integrated wireless health monitoring network''. In Proceedings of the 1st ACM international Workshop on Medical-Grade Wireless Networks (New Orleans, Louisiana, USA, May 18 - 18, 2009). WiMD '09. ACM, New York, NY, 63-68. DOI=http://doi.acm.org/10.1145/1540373.1540390<br />
* Re-implemented safemem slightly<br />
** Now has a separate user heap (using malloc/free calls) and kernel heap (using memget/memfree)<br />
** User heap is of size #define UHEAP_SIZE (currently set to 8MB) in xinu.conf<br />
*** If UHEAP_SIZE is not defined, there is no user heap and malloc always returns NULL<br />
** Only user heap memory is mapped into page table<br />
** Since Embedded Xinu uses only memory protection, we use a single global page table holding the page table entry and address space identifier (thread id)<br />
** When a TLB exception occurs, the system attempts to load the page table entry<br />
*** If the entry is null or the current thread id is not the ASID for the entry, the thread is killed and outputs "Memory protection violation" to stderr<br />
** The entire kernel is mapped as read-only, global memory so any thread can read kernel memory, but not write to it.<br />
** The TLB can be enabled/disabled by defining/undefining the USE_TLB #define in xinu.conf<br />
** Entire user memory subsystem is in the mem/ folder with only four calls in the kernel (each protected with #ifdef UHEAP_SIZE)<br />
*** system/kill.c attempts to memRegionReclaim when the thread is killed.<br />
*** system/initialize.c acquires UHEAP_SIZE using memget, then attempts to initialize the memory subsystem with memInit (setup the user heap), safeInit (setup memory protection), and safeKmapInit (insert kernel mappings).<br />
** TLB initialized with one call in system/initialize.c protected by #ifdef USE_TLB with all TLB code residing in mem/ as well.<br />
* Helped various people in the lab.<br />
* Relaxed in Northern Wisconsin Thursday and Friday<br />
** Read paper for Tuesday<br />
*** Mankin, J., Kaeli, D., and Ardini, J. 2009. ''Software transactional memory for multicore embedded systems''. In Proceedings of the 2009 ACM SIGPLAN/SIGBED Conference on Languages, Compilers, and Tools For Embedded Systems (Dublin, Ireland, June 19 - 20, 2009). LCTES '09. ACM, New York, NY, 90-98. DOI=http://doi.acm.org/10.1145/1542452.1542465<br />
<br />
=== Week of July 27 ===<br />
* Wrote catalogue of activities from last week.<br />
* Began looking at some network code<br />
** Began getting sad.<br />
* Corrected bug in tlbMissHandler that would effectively disable interrupts<br />
** Originally when a memory violation occurred the handler would kill(thrcurrent), exlset(), and resched().<br />
*** Obviously this is incorrect. kill(thrcurrent) has a call to resched() in it and exlset doesn't allow exceptions to occur.<br />
** Now when a memory violation occurs the handler will exlreset() and kill(thrcurrent).<br />
* Moved around code in malloc and memRegionAlloc to more logically separate thread based memory and region based memory.<br />
** memRegionAlloc will allocate the region and return the region allocated to the caller.<br />
** malloc tries to allocate memory from thread->memlist, then tries a memRegionAlloc and inserts remaining memory in thread->memlist<br />
* Expanded the Embedded Xinu [[memory]] page by 30%! Added links to [[flash memory]] and [[memory management]].<br />
** Fleshed out [[flash memory]] page and [[TRX header]] page.<br />
<br />
=== Week of August 3 ===</div>Michaelhttps://xinu.cs.mu.edu/index.php?title=TRX_header&diff=3477TRX header2009-07-29T18:33:23Z<p>Michael: Created TRX header page</p>
<hr />
<div>TRX is the format used to store kernel images in [[Flash memory]] for [[CFE]] based (and possibly others) routers. Unfortunately, not much is known about the format or what limitations and rules exist. Currently, [[Embedded Xinu]] uses a simple utility from the [[OpenWRT]] repository to build TRX images. However, the quality of our TRX images seems to vary between revisions of the operating system. We do not yet know why. Possible reasons include:<br />
<br />
* alignment problems,<br />
* compression/extraction problems,<br />
* incorrectly configuration at startup (differences between TFTP booting and booting from Flash), or a<br />
* combination of above and some unknown problem.<br />
<br />
What we do know is the format of the 28 byte TRX header, it is as follows:<br />
<br />
0 1 2 3 <br />
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 <br />
+---------------------------------------------------------------+<br />
| magic number ('HDR0') |<br />
+---------------------------------------------------------------+<br />
| length (header size + data) |<br />
+---------------+---------------+-------------------------------+<br />
| 32-bit CRC value |<br />
+---------------+---------------+-------------------------------+<br />
| TRX flags | TRX version |<br />
+-------------------------------+-------------------------------+<br />
| Partition offset[0] |<br />
+---------------------------------------------------------------+<br />
| Partition offset[1] |<br />
+---------------------------------------------------------------+<br />
| Partition offset[2] |<br />
+---------------------------------------------------------------+<br />
<br />
After the TRX header, the data section begins.</div>Michaelhttps://xinu.cs.mu.edu/index.php?title=User:Michael&diff=3476User:Michael2009-07-29T18:11:31Z<p>Michael: /* Week of July 27 */ Flash, a-ah.</p>
<hr />
<div>{| align="right" style="padding:0 5px;"<br />
| __TOC__<br />
|}<br />
<br />
Currently I am a in-between graduate student working at Marquette University. I have completed my thesis ([http://www.mscs.mu.edu/~mschul/files/thesis-2009.pdf Using Software Transactional Memory in Interrupt-Driven Systems]), but it was about one week late &mdash; so my graduation was pushed back to August 2009. At the end of the summer I will move to St. Louis and begin working on a Ph.D. in Computer Science at [http://www.wustl.edu Washington University].<br />
<br />
However, until then I am a research assistant for [http://www.mscs.mu.edu/~brylow/ Dr. Dennis Brylow]. At present I am continuing my research with software transactional memory and operating systems. In my spare geek time, I plan on fleshing out or starting up various parts of the Embedded Xinu O/S, as well as doing various administrative lab tasks.<br />
<br />
If you want more detailed information about me and my academic career you can visit the website of [http://www.mscs.mu.edu/~mschul/ Michael J. Schultz]!<br />
<br />
== Weekly Log (Summer 2009) ==<br />
<br />
=== Week of May 11 ===<br />
<br />
* Completed marriage transaction!<br />
* Generated user accounts for new Team Xinu members.<br />
* Reviewed a few papers, notably:<br />
** Liedtke, J. 1995. ''On <math>\mu</math>-kernel construction.'' SIGOPS Operating Systems Review 29, 5 (Dec. 1995), 237-250. DOI=http://doi.acm.org/10.1145/224057.224075 <br />
** Wentzlaff, D. and Agarwal, A. 2009. ''Factored operating systems (fos): the case for a scalable operating system for multicores.'' SIGOPS Operating Systems Review 43, 2 (Apr. 2009), 76-85. DOI=http://doi.acm.org/10.1145/1531793.1531805<br />
** Miller, F. W. ''Simple Memory Protection for Embedded Operating System Kernels.'' 2002 FREENIX Track Technical Program. URL=http://www.usenix.org/events/usenix02/tech/freenix/miller.html<br />
* Created [http://acm.mscs.mu.edu/wiki-reu/ Research Experiences for Undergraduates] wiki for MSCS REU students (and installed necessary extensions).<br />
* Updated all wikis to user MediaWiki 1.14.0 ([http://acm.mscs.mu.edu/wiki-adam/ Adam's Wiki], [http://acm.mscs.mu.edu/wiki-scifi/ BadSciFi Wiki], [http://acm.mscs.mu.edu/wiki-reu/ MSCS REU Wiki], [http://acm.mscs.mu.edu/ Student ACM Wiki], [http://xinu.mscs.mu.edu/ Embedded Xinu Wiki])<br />
* Updated the all important [http://www.mscs.mu.edu/~mschul/rpms/fortune/ fortune-sys-lab] package to 1.0.1-1 to include [[quotes]] through Spring 2009.<br />
* Began tinkering with KVM on Fedora 10 using [http://www.howtoforge.com/virtualization-with-kvm-on-a-fedora-10-server HowtoForge] (TODO: peruse [http://www.techotopia.com/index.php/Installing_and_Configuring_Fedora_KVM_Virtualization Techotopia] manuals, [http://fedoraproject.org/wiki/Virtualization_Quick_Start Fedora-Getting started with virtualization])<br />
<br />
=== Week of May 18 ===<br />
<br />
* Discussed [http://acm.mscs.mu.edu/wiki-reu/ REU Wiki] with REU students.<br />
* Wrote [[trac:Flash|Flash memory]] and [[trac:SafeMemory|memory protection]] pages to the trac wiki with deadlines and some information.<br />
* Worked on KVM a bit more (no success yet) -- it seems to fail to create the graphics properly which halts the installation process.<br />
* Created SVN account and branch for wireless driver developer.<br />
* Began some preliminary work on memory protection (moving to region based memory)<br />
<br />
=== Week of May 25 ===<br />
* Enjoyed some relaxation time in [[w:Galena,_Illinois|Galena]].<br />
<br />
=== Week of June 1 ===<br />
* Moved some essentials of life back to Milwaukee.<br />
* Updated/rebooted mawdryn (arg).<br />
* Discussed network stack with members of Team Xinu.<br />
* Reread and reviewed -- Wentzlaff, D. and Agarwal, A. 2009. ''Factored operating systems (fos): the case for a scalable operating system for multicores.'' SIGOPS Operating Systems Review 43, 2 (Apr. 2009), 76-85. DOI=http://doi.acm.org/10.1145/1531793.1531805.<br />
* Updated and submitted my [http://www.mscs.mu.edu/~mschul/files/thesis-2009.pdf thesis].<br />
* Looking for potential conference/journal matches to submit a paper to ([http://www.usenix.org/events/byname/ USENIX], [http://www.ieee.org/web/publications/journmag/index.html IEEE], [http://www.acm.org/publications/journals ACM Journals], and [http://portal.acm.org/browse_dl.cfm?linked=1&part=series&coll=ACM&dl=ACM ACM Conferences]).<br />
** Format: ''Full Conference Name'' (Abbr., deadline, page limit) -- [http://citeseer.ist.psu.edu/impact.html est. impact]<br />
** ''[http://www.plosworkshop.org/2009/ Workshop on Programming Languages and Operating Systems]'' (PLOS, 2009 Jun 19, 5 pages) -- unknown.<br />
** ''[http://www.usenix.org/events/hotos09/ Workshop on Hot Topics in Operating Systems]'' (HotOS, 2010 Jan, 5 pages) -- 34.<br />
** ''[http://eurosys2010.sigops-france.fr/calls.html European Conference on Computer Systems]'' (EuroSys, 2009 Oct 19, 12 pages) -- unknown.<br />
** ''[http://www.usenix.org/events/usenix09/ USENIX Annual Technical Conference]'' (USENIX, 2010 Jan, 14 pages long form, 6 pages short form) -- 7.<br />
** ''[http://www.embedded.rwth-aachen.de/tacas2009/ Tools and Algorithms for the Construction and Analysis of Systems]'' (TACAS, 2009 October, 15 pages) -- ~175.<br />
** ''[http://www.oopsla.org/oopsla2009/ Object-Oriented Programming Systems, Languages and Applications]'' (OOPSLA, 2010 Mar, 18 pages) -- 28.<br />
** <strike>''[http://www.sigplan.org/lctes.htm Languages, Compilers, and Tools for Embedded Systems]'' (LCTES, 2010 Feb, 10 pages) -- 404</strike>.<br />
** <strike>''[http://www.emsoft.org/ International Conference on Embedded Software]'' (EMSOFT, 2010 May, 10 pages) -- 390</strike>.<br />
** <strike>''[http://www.usenix.org/events/osdi08/cfp/ Operating Systems Design and Implementation]'' (OSDI, 2010 May, 14 pages) -- 1</strike>.<br />
** <strike>''[http://tocs.acm.org/ Transactions on Computer Systems]'' (TOCS, rolling?, $100/page?) -- 8</strike>.<br />
** <strike>''[http://www2.computer.org/portal/web/tc/ IEEE Transactions on Computers]'' (TC, look for special issue, 14 regular/8 brief pages) -- 361</strike>.<br />
** <strike>''[http://www2.computer.org/portal/web/tse/ IEEE Transactions on Software Engineering]'' (TSE, look for special issue, 14 regular/8 short pages) -- unknown</strike>.<br />
** <strike>''[http://www3.interscience.wiley.com/journal/1752/home Software: Practice and Experience]'' (SP&E, rolling?, 40 pages) -- 558</strike>.<br />
* Updated and assigned tasks on the [[trac:Flash|Flash]] page, now has Samsung specification and instructions for storing a Flash image to morbius.<br />
<br />
=== Week of June 8 ===<br />
* Got rejected.<br />
* Reduced conferences to look at for paper submissions.<br />
* Finished work on region based memory allocator. ([[tracsrc:mips/branches/safemem|source]])<br />
** Xinu now (inefficiently) allocates page sized memory when requests are made.<br />
* Read paper<br />
** Stitt, G., Chaudhari, G., and Coole, J. 2008. ''Traversal caches: a first step towards FPGA acceleration of pointer-based data structures''. In Proceedings of the 6th IEEE/ACM/IFIP international Conference on Hardware/Software Codesign and System Synthesis (Atlanta, GA, USA, October 19 - 24, 2008). CODES/ISSS '08. ACM, New York, NY, 61-66. DOI=http://doi.acm.org/10.1145/1450135.1450150 <br />
* Built page mapping/unmapping functionality into Xinu for virtual memory<br />
** TODOs now include:<br />
*** Hacking together TLB initialization and modification code.<br />
*** Correctly use TLB during context switch.<br />
*** Build system call interface and associated system call functions.<br />
*** Make distinction between user-/kernel-level threads and/or processes.<br />
<br />
=== Week of June 15 ===<br />
* Reviewed papers<br />
** Ryzhyk, L., Chubb, P., Kuz, I., and Heiser, G. 2009. ''Dingo: taming device drivers.'' In Proceedings of the Fourth ACM European Conference on Computer Systems (Nuremberg, Germany, April 01 - 03, 2009). EuroSys '09. DOI=http://doi.acm.org/10.1145/1519065.1519095.<br />
** Fuad Tabba, Mark Moir, James R. Goodman, Andrew W. Hay, and Cong Wang. ''NZTM: Nonblocking Zero-indirection Transactional Memory.'' In Proceedings of the 2009 Symposium on Parallelism in Algorithms and Architectures (Calgary, Alberta, Canada, August 11 - 13, 2009). SPAA '09. URI=http://www.virtutech.com/files/academics/spaa091-tabba.pdf.<br />
* System Administration<br />
** Upgraded to [http://lists.wikimedia.org/pipermail/mediawiki-announce/2009-June/000086.html MediaWiki 1.15.0] on [http://acm.mscs.mu.edu/wiki-adam/ Adam's Wiki], [http://acm.mscs.mu.edu/wiki-scifi/ BadSciFi Wiki], [http://acm.mscs.mu.edu/wiki-reu/ MSCS REU Wiki], [http://acm.mscs.mu.edu/ Student ACM Wiki], and [http://xinu.mscs.mu.edu/ Embedded Xinu Wiki].<br />
** Then proceeded to upgrade all the wikis to use a "continuous integration" process like [http://www.wikipedia.org/ Wikipedia] does, so now all the wikis should use the latest trunk version of MediaWiki.<br />
** Modified some settings for the SMI repository.<br />
** <strike>Began writing a</strike> Completed a draft document discussing what administration tasks there are with mulug (available in <code>/var/mulug/README</code>).<br />
* Memory Protection<br />
** Began looking into system call interface. I've decided Xinu was never meant to have user mode -> kernel mode syscalls (see 20.5 of ''Operating System Design''). Implying that the ancient SYSCALL type is a bit of a misnomer. Though the interface is possible (and fairly easy), it would require special wrapper functions around every call deemed to be a system call.<br />
<br />
=== Week of June 22 ===<br />
* Reviewed Paper<br />
** Maeda, S., Asano, S., Shimada, T., Awazu, K., and Tago, H. 2005. ''A Real-Time Software Platform for the Cell Processor''. IEEE Micro 25, 5 (Sep. 2005), 20-29. DOI=http://dx.doi.org/10.1109/MM.2005.79<br />
* Memory Protection<br />
** Filling out TLB EntryHi and EntryLo[0,1] fields with data from processes page table. Doesn't work. Getting Bus error exception with both fast (assembly) and slow (C) handlers.<br />
** Building a version of [http://www.openwrt.org/ OpenWRT] to (hopefully) dump and look at values in TLB.<br />
** Fixed above problem (right shift PFN 6 bits), I thought they were 'reserved' bits---I was wrong, it works now<br />
** Fixed a few other bugs to get TLB working consistently in mapped memory space<br />
** Began working on syscall interface, still needs testing.<br />
* Got some benchmarks to run with nepsim and told [http://acm.mscs.mu.edu/wiki-reu/index.php/User:Rberg Ryan] how to build nepsim on 64-bit machines (and execute without a segfault).<br />
* Helped with some computational sciences for high school teachers activities<br />
<br />
=== Week of June 29 ===<br />
* Reviewed paper<br />
** Klassner, F. and Continanza, C. 2007. ''Mindstorms without robotics: an alternative to simulations in systems courses.'' In Proceedings of the 38th SIGCSE Technical Symposium on Computer Science Education (Covington, Kentucky, USA, March 07 - 11, 2007). SIGCSE '07. ACM, New York, NY, 175-179. DOI=http://doi.acm.org/10.1145/1227310.1227372<br />
* Added syscall interface to safemem branch, now some cleanup work is necessary and a re-review of the files added. (+ commenting functions)<br />
* Tinkered with KVM on Fedora 11 (it seems to work well).<br />
* Helped find/fix various bugs in network stack.<br />
<br />
=== Week of July 6 ===<br />
* Began working on cleanup/documentation/confirmation of all memory related subsystems (region allocator, paging, tlb, syscall interface)<br />
** Stuck thinking about how to allocate the allocators. (Region based, byte based, malloc/memget, ...)<br />
* Read<br />
** Yang, X., Cooprider, N., and Regehr, J. 2009. ''Eliminating the call stack to save RAM.'' In Proceedings of the 2009 ACM SIGPLAN/SIGBED Conference on Languages, Compilers, and Tools For Embedded Systems (Dublin, Ireland, June 19 - 20, 2009). LCTES '09. ACM, New York, NY, 60-69. DOI=http://doi.acm.org/10.1145/1542452.1542461.<br />
* Adapted to Fedora 11 on mawdryn<br />
** Installed "morbius" virtual machine on mawdryn (doesn't have a MAC address in the database, so none of the standard configuration script ran.)<br />
* Went to Door County on Friday (sorry).<br />
<br />
=== Week of July 13 ===<br />
* Worked on memory allocator<br />
** Pages are allocated to a process (but not recovered until process is killed).<br />
** memget tries to allocate from the freelist of the current process, if enough memory doesn't exist it fetches another page (or pages) and allocates it to the process' freelist.<br />
** memfree simply returns a pointer with nbytes of memory to the process' freelist.<br />
** working on some bugs with memRegionReclaim when a process is killed.<br />
** corrected bug in reclaim<br />
** completed kernel/user allocators (still needs some testing)<br />
** memRegionTransfer should also move the memlist from process to process<br />
* Read paper<br />
** Takacs, G., Chandrasekhar, V., Gelfand, N., Xiong, Y., Chen, W., Bismpigiannis, T., Grzeszczuk, R., Pulli, K., and Girod, B. 2008. ''Outdoors augmented reality on mobile phone using loxel-based visual feature organization.'' In Proceeding of the 1st ACM international Conference on Multimedia information Retrieval (Vancouver, British Columbia, Canada, October 30 - 31, 2008). MIR '08. ACM, New York, NY, 427-434. DOI=http://doi.acm.org/10.1145/1460096.1460165.<br />
* Most importantly, I updated the Xinu banner for release of 2.0.<br />
____ ___.__ <br />
\ \/ /|__| ____ __ __ <br />
\ / | |/ \| | \ <br />
/ \ | | | \ | / <br />
/___/\ \|__|___| /____/ <br />
\_/ \/ v2.0 <br />
* Helped various people in the lab.<br />
<br />
=== Week of July 20 ===<br />
* Read paper for Tuesday<br />
** Quach, B., Balakrishnan, M., Benhaddou, D., and Yuan, X. 2009. ''Implementation of integrated wireless health monitoring network''. In Proceedings of the 1st ACM international Workshop on Medical-Grade Wireless Networks (New Orleans, Louisiana, USA, May 18 - 18, 2009). WiMD '09. ACM, New York, NY, 63-68. DOI=http://doi.acm.org/10.1145/1540373.1540390<br />
* Re-implemented safemem slightly<br />
** Now has a separate user heap (using malloc/free calls) and kernel heap (using memget/memfree)<br />
** User heap is of size #define UHEAP_SIZE (currently set to 8MB) in xinu.conf<br />
*** If UHEAP_SIZE is not defined, there is no user heap and malloc always returns NULL<br />
** Only user heap memory is mapped into page table<br />
** Since Embedded Xinu uses only memory protection, we use a single global page table holding the page table entry and address space identifier (thread id)<br />
** When a TLB exception occurs, the system attempts to load the page table entry<br />
*** If the entry is null or the current thread id is not the ASID for the entry, the thread is killed and outputs "Memory protection violation" to stderr<br />
** The entire kernel is mapped as read-only, global memory so any thread can read kernel memory, but not write to it.<br />
** The TLB can be enabled/disabled by defining/undefining the USE_TLB #define in xinu.conf<br />
** Entire user memory subsystem is in the mem/ folder with only four calls in the kernel (each protected with #ifdef UHEAP_SIZE)<br />
*** system/kill.c attempts to memRegionReclaim when the thread is killed.<br />
*** system/initialize.c acquires UHEAP_SIZE using memget, then attempts to initialize the memory subsystem with memInit (setup the user heap), safeInit (setup memory protection), and safeKmapInit (insert kernel mappings).<br />
** TLB initialized with one call in system/initialize.c protected by #ifdef USE_TLB with all TLB code residing in mem/ as well.<br />
* Helped various people in the lab.<br />
* Relaxed in Northern Wisconsin Thursday and Friday<br />
** Read paper for Tuesday<br />
*** Mankin, J., Kaeli, D., and Ardini, J. 2009. ''Software transactional memory for multicore embedded systems''. In Proceedings of the 2009 ACM SIGPLAN/SIGBED Conference on Languages, Compilers, and Tools For Embedded Systems (Dublin, Ireland, June 19 - 20, 2009). LCTES '09. ACM, New York, NY, 90-98. DOI=http://doi.acm.org/10.1145/1542452.1542465<br />
<br />
=== Week of July 27 ===<br />
* Wrote catalogue of activities from last week.<br />
* Began looking at some network code<br />
** Began getting sad.<br />
* Corrected bug in tlbMissHandler that would effectively disable interrupts<br />
** Originally when a memory violation occurred the handler would kill(thrcurrent), exlset(), and resched().<br />
*** Obviously this is incorrect. kill(thrcurrent) has a call to resched() in it and exlset doesn't allow exceptions to occur.<br />
** Now when a memory violation occurs the handler will exlreset() and kill(thrcurrent).<br />
* Moved around code in malloc and memRegionAlloc to more logically separate thread based memory and region based memory.<br />
** memRegionAlloc will allocate the region and return the region allocated to the caller.<br />
** malloc tries to allocate memory from thread->memlist, then tries a memRegionAlloc and inserts remaining memory in thread->memlist<br />
* Expanded the Embedded Xinu [[memory]] page by 30%! Added links to [[flash memory]] and [[memory management]].<br />
** Fleshed out [[flash memory]] page.<br />
<br />
=== Week of August 3 ===</div>Michaelhttps://xinu.cs.mu.edu/index.php?title=Flash_memory&diff=3475Flash memory2009-07-29T18:10:53Z<p>Michael: /* Data Locations */ re wiki-linked TRX header</p>
<hr />
<div>Like other memory mapped hardware devices on the MIPS platform, Flash memory has an address range in KSEG1. This means that the memory is '''unmapped''' and '''uncached'''. An interesting, and important, piece of information is that all 4 megabytes of Flash memory is mapped 1-1 into the address range between <tt>0xBC00 0000</tt> and <tt>0xBC3F FFFF</tt>. This allows for random read-access without using an interface to load the data a fixed amount of registers.<br />
<br />
<br />
== Data Locations ==<br />
<br />
Stored on Flash memory are several important parts to make a backend work properly, some of these data points are listed below.<br />
<br />
* <tt>0xBC00 1000</tt> has backup NVRAM settings. If the "proper" settings become corrupt, [[CFE]] will replace the proper settings with these.<br />
* <tt>0xBC00 1E00</tt> holds the "true" MAC address of device. During CFE boot, this is the address that will be used. Once a full kernel has been loaded the MAC address may be different.<br />
* <tt>0xBC00 1F00</tt> holds the current CFE boot version (should be "v3.7" for [[WRT54GL|WRT54GLs]]).<br />
* <tt>0xBC00 2000</tt> is the beginning of CFE code.<br />
* <tt>0xBC03 F400</tt> is a unique device ID (should match the NVRAM setting for <code>eou_device_id</code>).<br />
* <tt>0xBC03 F408</tt> is a unique private key for device (should match the NVRAM setting for <code>eou_private_key</code>).<br />
* <tt>0xBC03 F508</tt> is a unique public key for device (should match the NVRAM setting for <code>eou_public_key</code>).<br />
* <tt>0xBC04 0000</tt> is the beginning of the operating system kernel ([[Embedded Xinu]] or some Linux variant). Typically, this will be a gzipped version of the raw kernel code prefixed with a [[TRX header]].<br />
* <tt>0xBC3F 8000</tt> is the location of proper [[#NVRAM|NVRAM settings]].<br />
<br />
This is not a comprehensive list of memory locations within Flash memory, but a guide of where some values may be stored when trying to interface with a new system.<br />
<br />
== Writing Flash ==<br />
<br />
Writing data to Flash memory is not simply a matter of writing data to the memory address. For the WRT54GL backends the common NOR type of Flash memory is used. As with all Flash memories there are certain properties that must be followed when storing data.<br />
<br />
An important property of NOR based Flash memory is that each bit on Flash can only be changed from a <tt>1</tt> to a <tt>0</tt> and not the other way around. So if a byte has the pattern <tt>1001 1101</tt> only the high bits can be written. This presents an interesting challenge for efficient file system structures. Once a bit has been set to <tt>0</tt> and the operating system wishes to reset the bit to <tt>1</tt> a special erase command must be sent to the device. Because of this Flash memory is broken down into several distinct segments called ''erase blocks''. These erase blocks can vary in size between Flash memory chips and even within the same chip. After sending the command to erase an erase block, the entire erase block will be set to <tt>1</tt>s, allowing any data to be written. The specific method of erasing and writing data depends on the manufacturer of the underlying hardware. In general it is a matter of writing a sequence of values to a certain location to prepare the device, then writing the new data to the correct position. These operations are more detailed on the [[Flash driver]] page under [[Flash driver#Physical Layer|physical layer]].<br />
<br />
== Common Flash Interface ==<br />
<br />
Luckily for software authors, the manufacturers of Flash memory have developed a standard for discovering information about a Flash device, called the Common Flash Interface (CFI). By implementing a CFI query routine, the operating system can discover what command set the chip implements (Intel, AMD, and Mitsubishi all have a standard command set and extended command set). Other information that can be queried is voltages, timeouts for writing and erasing, access mode (word or byte), device size (as <math>2^n</math>), and information about up-to four erase block regions. The information about each erase block region will consist of the size of an erase block in the region and the number of equally sized erase blocks that exist in the regions.<br />
<br />
== NVRAM ==<br />
<br />
While technically a misnomer, NVRAM (non-volatile random access memory) refers specifically to the platform settings stored across power cycles of the device. These settings will always begin 8 pages (32 kilobytes) away from the end of Flash memory. In the case of the WRT54GL, this means NVRAM settings are stored beginning at <tt>0xBC3F 8000</tt>. At this point there is a 20 byte header which is laid out as follows:<br />
<br />
0 1 2 3 <br />
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 <br />
+---------------------------------------------------------------+<br />
| magic number ('FLSH') |<br />
+---------------------------------------------------------------+<br />
| length (header size + variables) |<br />
+---------------+---------------+-------------------------------+<br />
| CRC | version | SDRAM Init (?) |<br />
+---------------+---------------+-------------------------------+<br />
| SDRAM config (?) | SDRAM refresh (?) |<br />
+-------------------------------+-------------------------------+<br />
| NCDL value (?) |<br />
+---------------------------------------------------------------+<br />
<br />
Several of the values are not used by Embedded Xinu as the values represent something that is not fully understood (all the SDRAM values and the NCDL value).<br />
<br />
Immediately after the header begins the NVRAM settings as NULL delimited <code>name=value</code> tuples stored as plain text. It is possible that after the final tuple the settings are NULL character padded to the nearest 4 byte word.</div>Michaelhttps://xinu.cs.mu.edu/index.php?title=Flash_memory&diff=3474Flash memory2009-07-29T18:08:27Z<p>Michael: /* NVRAM */ Added disclaimer about header</p>
<hr />
<div>Like other memory mapped hardware devices on the MIPS platform, Flash memory has an address range in KSEG1. This means that the memory is '''unmapped''' and '''uncached'''. An interesting, and important, piece of information is that all 4 megabytes of Flash memory is mapped 1-1 into the address range between <tt>0xBC00 0000</tt> and <tt>0xBC3F FFFF</tt>. This allows for random read-access without using an interface to load the data a fixed amount of registers.<br />
<br />
<br />
== Data Locations ==<br />
<br />
Stored on Flash memory are several important parts to make a backend work properly, some of these data points are listed below.<br />
<br />
* <tt>0xBC00 1000</tt> has backup NVRAM settings. If the "proper" settings become corrupt, [[CFE]] will replace the proper settings with these.<br />
* <tt>0xBC00 1E00</tt> holds the "true" MAC address of device. During CFE boot, this is the address that will be used. Once a full kernel has been loaded the MAC address may be different.<br />
* <tt>0xBC00 1F00</tt> holds the current CFE boot version (should be "v3.7" for [[WRT54GL|WRT54GLs]]).<br />
* <tt>0xBC00 2000</tt> is the beginning of CFE code.<br />
* <tt>0xBC03 F400</tt> is a unique device ID (should match the NVRAM setting for <code>eou_device_id</code>).<br />
* <tt>0xBC03 F408</tt> is a unique private key for device (should match the NVRAM setting for <code>eou_private_key</code>).<br />
* <tt>0xBC03 F508</tt> is a unique public key for device (should match the NVRAM setting for <code>eou_public_key</code>).<br />
* <tt>0xBC04 0000</tt> is the beginning of the operating system kernel ([[Embedded Xinu]] or some Linux variant). Typically, this will be a gzipped version of the raw kernel code prefixed with a [[TRX]] header.<br />
* <tt>0xBC3F 8000</tt> is the location of proper [[#NVRAM|NVRAM settings]].<br />
<br />
This is not a comprehensive list of memory locations within Flash memory, but a guide of where some values may be stored when trying to interface with a new system.<br />
<br />
== Writing Flash ==<br />
<br />
Writing data to Flash memory is not simply a matter of writing data to the memory address. For the WRT54GL backends the common NOR type of Flash memory is used. As with all Flash memories there are certain properties that must be followed when storing data.<br />
<br />
An important property of NOR based Flash memory is that each bit on Flash can only be changed from a <tt>1</tt> to a <tt>0</tt> and not the other way around. So if a byte has the pattern <tt>1001 1101</tt> only the high bits can be written. This presents an interesting challenge for efficient file system structures. Once a bit has been set to <tt>0</tt> and the operating system wishes to reset the bit to <tt>1</tt> a special erase command must be sent to the device. Because of this Flash memory is broken down into several distinct segments called ''erase blocks''. These erase blocks can vary in size between Flash memory chips and even within the same chip. After sending the command to erase an erase block, the entire erase block will be set to <tt>1</tt>s, allowing any data to be written. The specific method of erasing and writing data depends on the manufacturer of the underlying hardware. In general it is a matter of writing a sequence of values to a certain location to prepare the device, then writing the new data to the correct position. These operations are more detailed on the [[Flash driver]] page under [[Flash driver#Physical Layer|physical layer]].<br />
<br />
== Common Flash Interface ==<br />
<br />
Luckily for software authors, the manufacturers of Flash memory have developed a standard for discovering information about a Flash device, called the Common Flash Interface (CFI). By implementing a CFI query routine, the operating system can discover what command set the chip implements (Intel, AMD, and Mitsubishi all have a standard command set and extended command set). Other information that can be queried is voltages, timeouts for writing and erasing, access mode (word or byte), device size (as <math>2^n</math>), and information about up-to four erase block regions. The information about each erase block region will consist of the size of an erase block in the region and the number of equally sized erase blocks that exist in the regions.<br />
<br />
== NVRAM ==<br />
<br />
While technically a misnomer, NVRAM (non-volatile random access memory) refers specifically to the platform settings stored across power cycles of the device. These settings will always begin 8 pages (32 kilobytes) away from the end of Flash memory. In the case of the WRT54GL, this means NVRAM settings are stored beginning at <tt>0xBC3F 8000</tt>. At this point there is a 20 byte header which is laid out as follows:<br />
<br />
0 1 2 3 <br />
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 <br />
+---------------------------------------------------------------+<br />
| magic number ('FLSH') |<br />
+---------------------------------------------------------------+<br />
| length (header size + variables) |<br />
+---------------+---------------+-------------------------------+<br />
| CRC | version | SDRAM Init (?) |<br />
+---------------+---------------+-------------------------------+<br />
| SDRAM config (?) | SDRAM refresh (?) |<br />
+-------------------------------+-------------------------------+<br />
| NCDL value (?) |<br />
+---------------------------------------------------------------+<br />
<br />
Several of the values are not used by Embedded Xinu as the values represent something that is not fully understood (all the SDRAM values and the NCDL value).<br />
<br />
Immediately after the header begins the NVRAM settings as NULL delimited <code>name=value</code> tuples stored as plain text. It is possible that after the final tuple the settings are NULL character padded to the nearest 4 byte word.</div>Michaelhttps://xinu.cs.mu.edu/index.php?title=Flash_memory&diff=3473Flash memory2009-07-29T18:06:59Z<p>Michael: Created more extensive Flash memory page</p>
<hr />
<div>Like other memory mapped hardware devices on the MIPS platform, Flash memory has an address range in KSEG1. This means that the memory is '''unmapped''' and '''uncached'''. An interesting, and important, piece of information is that all 4 megabytes of Flash memory is mapped 1-1 into the address range between <tt>0xBC00 0000</tt> and <tt>0xBC3F FFFF</tt>. This allows for random read-access without using an interface to load the data a fixed amount of registers.<br />
<br />
<br />
== Data Locations ==<br />
<br />
Stored on Flash memory are several important parts to make a backend work properly, some of these data points are listed below.<br />
<br />
* <tt>0xBC00 1000</tt> has backup NVRAM settings. If the "proper" settings become corrupt, [[CFE]] will replace the proper settings with these.<br />
* <tt>0xBC00 1E00</tt> holds the "true" MAC address of device. During CFE boot, this is the address that will be used. Once a full kernel has been loaded the MAC address may be different.<br />
* <tt>0xBC00 1F00</tt> holds the current CFE boot version (should be "v3.7" for [[WRT54GL|WRT54GLs]]).<br />
* <tt>0xBC00 2000</tt> is the beginning of CFE code.<br />
* <tt>0xBC03 F400</tt> is a unique device ID (should match the NVRAM setting for <code>eou_device_id</code>).<br />
* <tt>0xBC03 F408</tt> is a unique private key for device (should match the NVRAM setting for <code>eou_private_key</code>).<br />
* <tt>0xBC03 F508</tt> is a unique public key for device (should match the NVRAM setting for <code>eou_public_key</code>).<br />
* <tt>0xBC04 0000</tt> is the beginning of the operating system kernel ([[Embedded Xinu]] or some Linux variant). Typically, this will be a gzipped version of the raw kernel code prefixed with a [[TRX]] header.<br />
* <tt>0xBC3F 8000</tt> is the location of proper [[#NVRAM|NVRAM settings]].<br />
<br />
This is not a comprehensive list of memory locations within Flash memory, but a guide of where some values may be stored when trying to interface with a new system.<br />
<br />
== Writing Flash ==<br />
<br />
Writing data to Flash memory is not simply a matter of writing data to the memory address. For the WRT54GL backends the common NOR type of Flash memory is used. As with all Flash memories there are certain properties that must be followed when storing data.<br />
<br />
An important property of NOR based Flash memory is that each bit on Flash can only be changed from a <tt>1</tt> to a <tt>0</tt> and not the other way around. So if a byte has the pattern <tt>1001 1101</tt> only the high bits can be written. This presents an interesting challenge for efficient file system structures. Once a bit has been set to <tt>0</tt> and the operating system wishes to reset the bit to <tt>1</tt> a special erase command must be sent to the device. Because of this Flash memory is broken down into several distinct segments called ''erase blocks''. These erase blocks can vary in size between Flash memory chips and even within the same chip. After sending the command to erase an erase block, the entire erase block will be set to <tt>1</tt>s, allowing any data to be written. The specific method of erasing and writing data depends on the manufacturer of the underlying hardware. In general it is a matter of writing a sequence of values to a certain location to prepare the device, then writing the new data to the correct position. These operations are more detailed on the [[Flash driver]] page under [[Flash driver#Physical Layer|physical layer]].<br />
<br />
== Common Flash Interface ==<br />
<br />
Luckily for software authors, the manufacturers of Flash memory have developed a standard for discovering information about a Flash device, called the Common Flash Interface (CFI). By implementing a CFI query routine, the operating system can discover what command set the chip implements (Intel, AMD, and Mitsubishi all have a standard command set and extended command set). Other information that can be queried is voltages, timeouts for writing and erasing, access mode (word or byte), device size (as <math>2^n</math>), and information about up-to four erase block regions. The information about each erase block region will consist of the size of an erase block in the region and the number of equally sized erase blocks that exist in the regions.<br />
<br />
== NVRAM ==<br />
<br />
While technically a misnomer, NVRAM (non-volatile random access memory) refers specifically to the platform settings stored across power cycles of the device. These settings will always begin 8 pages (32 kilobytes) away from the end of Flash memory. In the case of the WRT54GL, this means NVRAM settings are stored beginning at <tt>0xBC3F 8000</tt>. At this point there is a 20 byte header which is laid out as follows:<br />
<br />
0 1 2 3 <br />
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 <br />
+---------------------------------------------------------------+<br />
| magic number ('FLSH') |<br />
+---------------------------------------------------------------+<br />
| length (header size + variables) |<br />
+---------------+---------------+-------------------------------+<br />
| CRC | version | SDRAM Init (?) |<br />
+---------------+---------------+-------------------------------+<br />
| SDRAM config (?) | SDRAM refresh (?) |<br />
+-------------------------------+-------------------------------+<br />
| NCDL value (?) |<br />
+---------------------------------------------------------------+<br />
<br />
Immediately after the header begins the NVRAM settings as NULL delimited <code>name=value</code> tuples stored as plain text. It is possible that after the final tuple the settings are NULL character padded to the nearest 4 byte word.</div>Michaelhttps://xinu.cs.mu.edu/index.php?title=Memory&diff=3472Memory2009-07-29T04:23:29Z<p>Michael: /* Kernel Segments */ More emphasis on mapping and caching properties</p>
<hr />
<div>Memory on MIPS-based processors is broken into several segments, consuming the entire 32-address space. These segments are arranged as follows:<br />
<br />
* [[#User Segment|User Segment]] (USEG), 2 GB '''mapped''' and '''cached''', addresses <tt>0x0000 0000</tt> through <tt>0x7FFF FFFF</tt><br />
* [[#Kernel Segment 0|Kernel Segment 0]] (KSEG0), 512 MB '''unmapped''' and '''cached''', addresses <tt>0x8000 0000</tt> through <tt>0x9FFF FFFF</tt><br />
* [[#Kernel Segment 1|Kernel Segment 1]] (KSEG1), 512 MB '''unmapped''' and '''uncached''', addresses <tt>0xA000 0000</tt> through <tt>0xBFFF FFFF</tt><br />
* [[#Kernel Segment 2|Kernel Segment 2]] (KSEG2), 1 GB '''mapped''' and '''cached''', addresses <tt>0xC000 0000</tt> through <tt>0xFFFF FFFF</tt><br />
<br />
Note that the [[WRT54GL]] only has 16 MB of main memory, so a 1-1 mapping is not be available above <tt>0x..FF FFFF</tt>.<br />
<br />
== User Segment ==<br />
<br />
The user segment of memory, or USEG, is the range of memory addresses from <tt>0x0000 0000</tt> through <tt>0x7FFF FFFF</tt>. This memory is both mapped and cached, meaning that any attempt to access memory within this range will result in the hardware consulting the memory manager prior to access. '''Note''' that any attempted access in this range must with the CPU privilege level set to user mode (i.e. <math>Status(KSU) = 2</math>) or the processor must be in the exception state with the error level bit set (i.e. <math>Status(EXL) = 1</math>). In the latter case, all mappings turn into 1-1, so directly accessing these address is not recommended.<br />
<br />
Under normal operation, when an address in this memory range is accessed, the processor will query the memory management unit is consulted for a mapping. In turn this will ask the translation lookaside buffer (TLB), and if no mapping is found cause a TLB load or store exception. When this exception occurs, the operating system is consulted and should write the correct mapping to the TLB and return from the exception handler.<br />
<br />
It should be noted that when a TLB exception occurs in the USEG range of addresses, a special "fast" exception handler is consulted instead of the normal exception handler. This fast handler is at most 32 instructions long and begins at <tt>0x8000 0000</tt>.<br />
<br />
=== User Segment under Xinu ===<br />
<br />
[[Embedded Xinu]] has basic [[memory management]] as of the 2.0 release (stored in the <tt>mem/</tt> directory). During initialization, the kernel allocates some amount of memory (defined in <code>xinu.conf</code> as UHEAP_SIZE) to act as the user memory heap. Once this memory is initialized, calls to <code>malloc</code> and <code>free</code> will use the user heap for memory allocation and automatically insert mappings into the system page table. All mappings are 1-1 since there is no backing store for a virtual memory subsystem, though it would be possible to provide each thread with a private address space this requires lots of memory overhead.<br />
<br />
Exception code to handle TLB faults is in the <code>tlbMissHandler</code> function and simply performs a lookup of the faulting address in the system page table, checks to see if it is valid and in the correct address space, and inserts the mapping in the TLB hardware.<br />
<br />
== Kernel Segments ==<br />
<br />
While the first part of memory is dedicated to the user segment, the remainder is the kernel segment. Unlike the user segment, the kernel segment is sub-divided into three segments with different memory access properties. '''Note''' that these properties can be very important if you are dealing with device drivers and/or hardware that uses direct memory access (DMA) because there may be caching considerations.<br />
<br />
In brief:<br />
<br />
* [[#Kernel Segment 0|KSEG0]] uses '''unmapped''' and '''cached''' memory accesses,<br />
* [[#Kernel Segment 1|KSEG1]] uses '''unmapped''' and '''uncached''' memory accesses, and<br />
* [[#Kernel Segment 2|KSEG2]] uses '''mapped''' and '''cached''' memory accesses.<br />
<br />
=== Kernel Segment 0 ===<br />
<br />
The first kernel segment, or KSEG0, is the range of memory addresses from <tt>0x8000 0000</tt> through <tt>0x9FFF FFFF</tt>. This memory '''unmapped''' and '''cached''', meaning that when the processor attempts to access an address in this range it will not consult the memory manager for a mapping, but will store and modifications in the on-chip memory cache. '''Note''' that when allocating memory for a device driver that will be using DMA, the caching effects could lead to major headaches. If memory is being given to a hardware backend it should be mapped into the range of [[#Kernel Segment 1|KSEG1]].<br />
<br />
On many MIPS processors the first page (4096 bytes) of KSEG0 is considered to be reserved system space where small amounts of specialized code can be loaded for fast execution. Typically, this memory is used for exception handling and the following sections are reserved for the following:<br />
<br />
* <tt>0x8000 0000</tt> (32 instructions) is for the TLB exception handler,<br />
* <tt>0x8000 0080</tt> (32 instructions) is for the 64-bit TLB exception handler, and<br />
* <tt>0x8000 0180</tt> (32 instructions) is for the generic exception handler.<br />
<br />
Other reserved portions of this memory page remain unknown.<br />
<br />
After the reserved system page, the operating system is free to use memory however it sees fit.<br />
<br />
==== KSEG0 under Xinu ====<br />
<br />
[[Embedded Xinu]] uses KSEG0 extensively for kernel operations. As the WRT54GL uses a 32-bit MIPS processor, Embedded Xinu loads a quick TLB handler into memory at <tt>0x8000 0000</tt> and a generic exception handler at <tt>0x8000 0180</tt>, both of these are limited to 32 instructions and jump to higher level C code when needed. It is important to note that Embedded Xinu also makes use of reserved memory starting at <tt>0x8000 0200</tt> to store an array of exception handler entry points (32-bit function pointers for 32 possible exceptions) and <tt>0x8000 0280</tt> to store an array of interrupt handler entry points (32-bit function pointers for 8 possible interrupts).<br />
<br />
Xinu loads the kernel entry point beginning at <tt>0x8000 1000</tt>, and upon booting begins execution at that address. Within Embedded Xinu, the memory segments are in the following order (as defined by <code>ld.script</code>): text, read-only data, data, and block started by symbol (BSS, uninitialized data). The kernel allocates a small kernel stack after the BSS segment and finally initializes a dynamic memory heap for the remaining physical memory addresses.<br />
<br />
The kernel memory allocator (<code>memget</code> and <code>memfree</code>), will allocate memory from the kernel heap as requested. Since Embedded Xinu uses a single page table, all kernel addresses will be mapped read-only in all address spaces, giving a user thread the ability to read from but not write to kernel memory.<br />
<br />
=== Kernel Segment 1 ===<br />
<br />
The second kernel segment, or KSEG1, is the range of memory addresses from 0xA000 0000 through 0xBFFF FFFF. This memory '''unmapped''' and '''uncached''', meaning that when the processor attempts to access an address in this range it will not consult the memory manager for a mapping and it ''will'' bypass the on-chip memory cache for memory loads and stores.<br />
<br />
By skipping the hardware cache, KSEG1 will see slower memory accesses because it must get data directly from the RAM. Because of this, it is not typical to use KSEG1 for normal kernel operations, rather this segment is useful for accessing memory that is mapped to some other hardware device on the platform. These mappings will either be pre-existing, so they are out-of-range of physical memory addresses, or they will be dynamically allocated memory that will be shared between the operating system and some hardware device.<br />
<br />
==== KSEG1 under Xinu ====<br />
<br />
Embedded Xinu uses several hardware devices that are mapped out-of-range of physical memory and some hardware devices that use dynamically allocated memory for sharing. Some devices on the WRT54GL that are beyond the range of physical memory are:<br />
<br />
* Broadcom I/O controllor registers at <tt>0xB800 0000</tt>,<br />
* [[UART]] registers at <tt>0xB800 0300</tt> and <tt>0xB800 0400</tt>,<br />
* Broadcom Ethernet 47xx registers at <tt>0xB800 1000</tt>,<br />
* Broadcom Wireless LAN controller registers at <tt>0xB800 5000</tt>,<br />
* Broadcom 47xx RoboSwitch registers at <tt>0xB800 6000</tt>, and<br />
* [[Flash memory]] (4 MB) read mapped beginning at <tt>0xBC00 0000</tt>.<br />
<br />
Certain drivers (such as the [[Ethernet]] driver), also take advantage of shared memory between the operating system and the hardware. This requires the use of dynamically allocated kernel memory (originating in KSEG0), that has been mapped to KSEG1 address range. This is not problematic because both KSEG0 and KSEG1 use a 1-1 memory mapping. With the Ethernet driver of Embedded Xinu, the shared memory that is in KSEG1 hold the DMA descriptor rings and the Ethernet packet buffers to store the packets in.<br />
<br />
=== Kernel Segment 2 ===<br />
<br />
The third kernel segment, or KSEG2, is the range of memory addresses from 0xC000 0000 through 0xFFFF FFFF. This memory is both '''mapped''' and '''cached''', meaning that the processor will consult the memory manager for a mapping and store memory modifications in the on-chip cache.<br />
<br />
Like the user segment of memory any attempt to access memory in KSEG2 will result in the processor querying the memory manager and the TLB to find a mapping. If a mapping does not exist the processor will generate a TLB load or store exception and the operating system must fill the TLB entry. Unlike USEG, a TLB exception will not jump to the "fast" handler and instead follow the normal path for exception handling through the generic exception mechanism.<br />
<br />
This memory segment could be useful to create the appearance of page aligned data to the underlying hardware or operating system if needed.<br />
<br />
==== KSEG2 under Xinu ====<br />
<br />
Embedded Xinu does not make use of any KSEG2 memory yet. However, to take advantage of the Context register of MIPS processors when a TLB exception occurs, it is possible that a mapping of the system page table to KSEG2 might exist in future versions.<br />
<br />
== References ==<br />
Sweetman, Dominic. ''See MIPS Run''. San Francisco: Morgan Kaufmann Publishers, 2007.</div>Michaelhttps://xinu.cs.mu.edu/index.php?title=User:Michael&diff=3471User:Michael2009-07-29T01:41:12Z<p>Michael: /* Week of July 27 */ wiki-doc'ing</p>
<hr />
<div>{| align="right" style="padding:0 5px;"<br />
| __TOC__<br />
|}<br />
<br />
Currently I am a in-between graduate student working at Marquette University. I have completed my thesis ([http://www.mscs.mu.edu/~mschul/files/thesis-2009.pdf Using Software Transactional Memory in Interrupt-Driven Systems]), but it was about one week late &mdash; so my graduation was pushed back to August 2009. At the end of the summer I will move to St. Louis and begin working on a Ph.D. in Computer Science at [http://www.wustl.edu Washington University].<br />
<br />
However, until then I am a research assistant for [http://www.mscs.mu.edu/~brylow/ Dr. Dennis Brylow]. At present I am continuing my research with software transactional memory and operating systems. In my spare geek time, I plan on fleshing out or starting up various parts of the Embedded Xinu O/S, as well as doing various administrative lab tasks.<br />
<br />
If you want more detailed information about me and my academic career you can visit the website of [http://www.mscs.mu.edu/~mschul/ Michael J. Schultz]!<br />
<br />
== Weekly Log (Summer 2009) ==<br />
<br />
=== Week of May 11 ===<br />
<br />
* Completed marriage transaction!<br />
* Generated user accounts for new Team Xinu members.<br />
* Reviewed a few papers, notably:<br />
** Liedtke, J. 1995. ''On <math>\mu</math>-kernel construction.'' SIGOPS Operating Systems Review 29, 5 (Dec. 1995), 237-250. DOI=http://doi.acm.org/10.1145/224057.224075 <br />
** Wentzlaff, D. and Agarwal, A. 2009. ''Factored operating systems (fos): the case for a scalable operating system for multicores.'' SIGOPS Operating Systems Review 43, 2 (Apr. 2009), 76-85. DOI=http://doi.acm.org/10.1145/1531793.1531805<br />
** Miller, F. W. ''Simple Memory Protection for Embedded Operating System Kernels.'' 2002 FREENIX Track Technical Program. URL=http://www.usenix.org/events/usenix02/tech/freenix/miller.html<br />
* Created [http://acm.mscs.mu.edu/wiki-reu/ Research Experiences for Undergraduates] wiki for MSCS REU students (and installed necessary extensions).<br />
* Updated all wikis to user MediaWiki 1.14.0 ([http://acm.mscs.mu.edu/wiki-adam/ Adam's Wiki], [http://acm.mscs.mu.edu/wiki-scifi/ BadSciFi Wiki], [http://acm.mscs.mu.edu/wiki-reu/ MSCS REU Wiki], [http://acm.mscs.mu.edu/ Student ACM Wiki], [http://xinu.mscs.mu.edu/ Embedded Xinu Wiki])<br />
* Updated the all important [http://www.mscs.mu.edu/~mschul/rpms/fortune/ fortune-sys-lab] package to 1.0.1-1 to include [[quotes]] through Spring 2009.<br />
* Began tinkering with KVM on Fedora 10 using [http://www.howtoforge.com/virtualization-with-kvm-on-a-fedora-10-server HowtoForge] (TODO: peruse [http://www.techotopia.com/index.php/Installing_and_Configuring_Fedora_KVM_Virtualization Techotopia] manuals, [http://fedoraproject.org/wiki/Virtualization_Quick_Start Fedora-Getting started with virtualization])<br />
<br />
=== Week of May 18 ===<br />
<br />
* Discussed [http://acm.mscs.mu.edu/wiki-reu/ REU Wiki] with REU students.<br />
* Wrote [[trac:Flash|Flash memory]] and [[trac:SafeMemory|memory protection]] pages to the trac wiki with deadlines and some information.<br />
* Worked on KVM a bit more (no success yet) -- it seems to fail to create the graphics properly which halts the installation process.<br />
* Created SVN account and branch for wireless driver developer.<br />
* Began some preliminary work on memory protection (moving to region based memory)<br />
<br />
=== Week of May 25 ===<br />
* Enjoyed some relaxation time in [[w:Galena,_Illinois|Galena]].<br />
<br />
=== Week of June 1 ===<br />
* Moved some essentials of life back to Milwaukee.<br />
* Updated/rebooted mawdryn (arg).<br />
* Discussed network stack with members of Team Xinu.<br />
* Reread and reviewed -- Wentzlaff, D. and Agarwal, A. 2009. ''Factored operating systems (fos): the case for a scalable operating system for multicores.'' SIGOPS Operating Systems Review 43, 2 (Apr. 2009), 76-85. DOI=http://doi.acm.org/10.1145/1531793.1531805.<br />
* Updated and submitted my [http://www.mscs.mu.edu/~mschul/files/thesis-2009.pdf thesis].<br />
* Looking for potential conference/journal matches to submit a paper to ([http://www.usenix.org/events/byname/ USENIX], [http://www.ieee.org/web/publications/journmag/index.html IEEE], [http://www.acm.org/publications/journals ACM Journals], and [http://portal.acm.org/browse_dl.cfm?linked=1&part=series&coll=ACM&dl=ACM ACM Conferences]).<br />
** Format: ''Full Conference Name'' (Abbr., deadline, page limit) -- [http://citeseer.ist.psu.edu/impact.html est. impact]<br />
** ''[http://www.plosworkshop.org/2009/ Workshop on Programming Languages and Operating Systems]'' (PLOS, 2009 Jun 19, 5 pages) -- unknown.<br />
** ''[http://www.usenix.org/events/hotos09/ Workshop on Hot Topics in Operating Systems]'' (HotOS, 2010 Jan, 5 pages) -- 34.<br />
** ''[http://eurosys2010.sigops-france.fr/calls.html European Conference on Computer Systems]'' (EuroSys, 2009 Oct 19, 12 pages) -- unknown.<br />
** ''[http://www.usenix.org/events/usenix09/ USENIX Annual Technical Conference]'' (USENIX, 2010 Jan, 14 pages long form, 6 pages short form) -- 7.<br />
** ''[http://www.embedded.rwth-aachen.de/tacas2009/ Tools and Algorithms for the Construction and Analysis of Systems]'' (TACAS, 2009 October, 15 pages) -- ~175.<br />
** ''[http://www.oopsla.org/oopsla2009/ Object-Oriented Programming Systems, Languages and Applications]'' (OOPSLA, 2010 Mar, 18 pages) -- 28.<br />
** <strike>''[http://www.sigplan.org/lctes.htm Languages, Compilers, and Tools for Embedded Systems]'' (LCTES, 2010 Feb, 10 pages) -- 404</strike>.<br />
** <strike>''[http://www.emsoft.org/ International Conference on Embedded Software]'' (EMSOFT, 2010 May, 10 pages) -- 390</strike>.<br />
** <strike>''[http://www.usenix.org/events/osdi08/cfp/ Operating Systems Design and Implementation]'' (OSDI, 2010 May, 14 pages) -- 1</strike>.<br />
** <strike>''[http://tocs.acm.org/ Transactions on Computer Systems]'' (TOCS, rolling?, $100/page?) -- 8</strike>.<br />
** <strike>''[http://www2.computer.org/portal/web/tc/ IEEE Transactions on Computers]'' (TC, look for special issue, 14 regular/8 brief pages) -- 361</strike>.<br />
** <strike>''[http://www2.computer.org/portal/web/tse/ IEEE Transactions on Software Engineering]'' (TSE, look for special issue, 14 regular/8 short pages) -- unknown</strike>.<br />
** <strike>''[http://www3.interscience.wiley.com/journal/1752/home Software: Practice and Experience]'' (SP&E, rolling?, 40 pages) -- 558</strike>.<br />
* Updated and assigned tasks on the [[trac:Flash|Flash]] page, now has Samsung specification and instructions for storing a Flash image to morbius.<br />
<br />
=== Week of June 8 ===<br />
* Got rejected.<br />
* Reduced conferences to look at for paper submissions.<br />
* Finished work on region based memory allocator. ([[tracsrc:mips/branches/safemem|source]])<br />
** Xinu now (inefficiently) allocates page sized memory when requests are made.<br />
* Read paper<br />
** Stitt, G., Chaudhari, G., and Coole, J. 2008. ''Traversal caches: a first step towards FPGA acceleration of pointer-based data structures''. In Proceedings of the 6th IEEE/ACM/IFIP international Conference on Hardware/Software Codesign and System Synthesis (Atlanta, GA, USA, October 19 - 24, 2008). CODES/ISSS '08. ACM, New York, NY, 61-66. DOI=http://doi.acm.org/10.1145/1450135.1450150 <br />
* Built page mapping/unmapping functionality into Xinu for virtual memory<br />
** TODOs now include:<br />
*** Hacking together TLB initialization and modification code.<br />
*** Correctly use TLB during context switch.<br />
*** Build system call interface and associated system call functions.<br />
*** Make distinction between user-/kernel-level threads and/or processes.<br />
<br />
=== Week of June 15 ===<br />
* Reviewed papers<br />
** Ryzhyk, L., Chubb, P., Kuz, I., and Heiser, G. 2009. ''Dingo: taming device drivers.'' In Proceedings of the Fourth ACM European Conference on Computer Systems (Nuremberg, Germany, April 01 - 03, 2009). EuroSys '09. DOI=http://doi.acm.org/10.1145/1519065.1519095.<br />
** Fuad Tabba, Mark Moir, James R. Goodman, Andrew W. Hay, and Cong Wang. ''NZTM: Nonblocking Zero-indirection Transactional Memory.'' In Proceedings of the 2009 Symposium on Parallelism in Algorithms and Architectures (Calgary, Alberta, Canada, August 11 - 13, 2009). SPAA '09. URI=http://www.virtutech.com/files/academics/spaa091-tabba.pdf.<br />
* System Administration<br />
** Upgraded to [http://lists.wikimedia.org/pipermail/mediawiki-announce/2009-June/000086.html MediaWiki 1.15.0] on [http://acm.mscs.mu.edu/wiki-adam/ Adam's Wiki], [http://acm.mscs.mu.edu/wiki-scifi/ BadSciFi Wiki], [http://acm.mscs.mu.edu/wiki-reu/ MSCS REU Wiki], [http://acm.mscs.mu.edu/ Student ACM Wiki], and [http://xinu.mscs.mu.edu/ Embedded Xinu Wiki].<br />
** Then proceeded to upgrade all the wikis to use a "continuous integration" process like [http://www.wikipedia.org/ Wikipedia] does, so now all the wikis should use the latest trunk version of MediaWiki.<br />
** Modified some settings for the SMI repository.<br />
** <strike>Began writing a</strike> Completed a draft document discussing what administration tasks there are with mulug (available in <code>/var/mulug/README</code>).<br />
* Memory Protection<br />
** Began looking into system call interface. I've decided Xinu was never meant to have user mode -> kernel mode syscalls (see 20.5 of ''Operating System Design''). Implying that the ancient SYSCALL type is a bit of a misnomer. Though the interface is possible (and fairly easy), it would require special wrapper functions around every call deemed to be a system call.<br />
<br />
=== Week of June 22 ===<br />
* Reviewed Paper<br />
** Maeda, S., Asano, S., Shimada, T., Awazu, K., and Tago, H. 2005. ''A Real-Time Software Platform for the Cell Processor''. IEEE Micro 25, 5 (Sep. 2005), 20-29. DOI=http://dx.doi.org/10.1109/MM.2005.79<br />
* Memory Protection<br />
** Filling out TLB EntryHi and EntryLo[0,1] fields with data from processes page table. Doesn't work. Getting Bus error exception with both fast (assembly) and slow (C) handlers.<br />
** Building a version of [http://www.openwrt.org/ OpenWRT] to (hopefully) dump and look at values in TLB.<br />
** Fixed above problem (right shift PFN 6 bits), I thought they were 'reserved' bits---I was wrong, it works now<br />
** Fixed a few other bugs to get TLB working consistently in mapped memory space<br />
** Began working on syscall interface, still needs testing.<br />
* Got some benchmarks to run with nepsim and told [http://acm.mscs.mu.edu/wiki-reu/index.php/User:Rberg Ryan] how to build nepsim on 64-bit machines (and execute without a segfault).<br />
* Helped with some computational sciences for high school teachers activities<br />
<br />
=== Week of June 29 ===<br />
* Reviewed paper<br />
** Klassner, F. and Continanza, C. 2007. ''Mindstorms without robotics: an alternative to simulations in systems courses.'' In Proceedings of the 38th SIGCSE Technical Symposium on Computer Science Education (Covington, Kentucky, USA, March 07 - 11, 2007). SIGCSE '07. ACM, New York, NY, 175-179. DOI=http://doi.acm.org/10.1145/1227310.1227372<br />
* Added syscall interface to safemem branch, now some cleanup work is necessary and a re-review of the files added. (+ commenting functions)<br />
* Tinkered with KVM on Fedora 11 (it seems to work well).<br />
* Helped find/fix various bugs in network stack.<br />
<br />
=== Week of July 6 ===<br />
* Began working on cleanup/documentation/confirmation of all memory related subsystems (region allocator, paging, tlb, syscall interface)<br />
** Stuck thinking about how to allocate the allocators. (Region based, byte based, malloc/memget, ...)<br />
* Read<br />
** Yang, X., Cooprider, N., and Regehr, J. 2009. ''Eliminating the call stack to save RAM.'' In Proceedings of the 2009 ACM SIGPLAN/SIGBED Conference on Languages, Compilers, and Tools For Embedded Systems (Dublin, Ireland, June 19 - 20, 2009). LCTES '09. ACM, New York, NY, 60-69. DOI=http://doi.acm.org/10.1145/1542452.1542461.<br />
* Adapted to Fedora 11 on mawdryn<br />
** Installed "morbius" virtual machine on mawdryn (doesn't have a MAC address in the database, so none of the standard configuration script ran.)<br />
* Went to Door County on Friday (sorry).<br />
<br />
=== Week of July 13 ===<br />
* Worked on memory allocator<br />
** Pages are allocated to a process (but not recovered until process is killed).<br />
** memget tries to allocate from the freelist of the current process, if enough memory doesn't exist it fetches another page (or pages) and allocates it to the process' freelist.<br />
** memfree simply returns a pointer with nbytes of memory to the process' freelist.<br />
** working on some bugs with memRegionReclaim when a process is killed.<br />
** corrected bug in reclaim<br />
** completed kernel/user allocators (still needs some testing)<br />
** memRegionTransfer should also move the memlist from process to process<br />
* Read paper<br />
** Takacs, G., Chandrasekhar, V., Gelfand, N., Xiong, Y., Chen, W., Bismpigiannis, T., Grzeszczuk, R., Pulli, K., and Girod, B. 2008. ''Outdoors augmented reality on mobile phone using loxel-based visual feature organization.'' In Proceeding of the 1st ACM international Conference on Multimedia information Retrieval (Vancouver, British Columbia, Canada, October 30 - 31, 2008). MIR '08. ACM, New York, NY, 427-434. DOI=http://doi.acm.org/10.1145/1460096.1460165.<br />
* Most importantly, I updated the Xinu banner for release of 2.0.<br />
____ ___.__ <br />
\ \/ /|__| ____ __ __ <br />
\ / | |/ \| | \ <br />
/ \ | | | \ | / <br />
/___/\ \|__|___| /____/ <br />
\_/ \/ v2.0 <br />
* Helped various people in the lab.<br />
<br />
=== Week of July 20 ===<br />
* Read paper for Tuesday<br />
** Quach, B., Balakrishnan, M., Benhaddou, D., and Yuan, X. 2009. ''Implementation of integrated wireless health monitoring network''. In Proceedings of the 1st ACM international Workshop on Medical-Grade Wireless Networks (New Orleans, Louisiana, USA, May 18 - 18, 2009). WiMD '09. ACM, New York, NY, 63-68. DOI=http://doi.acm.org/10.1145/1540373.1540390<br />
* Re-implemented safemem slightly<br />
** Now has a separate user heap (using malloc/free calls) and kernel heap (using memget/memfree)<br />
** User heap is of size #define UHEAP_SIZE (currently set to 8MB) in xinu.conf<br />
*** If UHEAP_SIZE is not defined, there is no user heap and malloc always returns NULL<br />
** Only user heap memory is mapped into page table<br />
** Since Embedded Xinu uses only memory protection, we use a single global page table holding the page table entry and address space identifier (thread id)<br />
** When a TLB exception occurs, the system attempts to load the page table entry<br />
*** If the entry is null or the current thread id is not the ASID for the entry, the thread is killed and outputs "Memory protection violation" to stderr<br />
** The entire kernel is mapped as read-only, global memory so any thread can read kernel memory, but not write to it.<br />
** The TLB can be enabled/disabled by defining/undefining the USE_TLB #define in xinu.conf<br />
** Entire user memory subsystem is in the mem/ folder with only four calls in the kernel (each protected with #ifdef UHEAP_SIZE)<br />
*** system/kill.c attempts to memRegionReclaim when the thread is killed.<br />
*** system/initialize.c acquires UHEAP_SIZE using memget, then attempts to initialize the memory subsystem with memInit (setup the user heap), safeInit (setup memory protection), and safeKmapInit (insert kernel mappings).<br />
** TLB initialized with one call in system/initialize.c protected by #ifdef USE_TLB with all TLB code residing in mem/ as well.<br />
* Helped various people in the lab.<br />
* Relaxed in Northern Wisconsin Thursday and Friday<br />
** Read paper for Tuesday<br />
*** Mankin, J., Kaeli, D., and Ardini, J. 2009. ''Software transactional memory for multicore embedded systems''. In Proceedings of the 2009 ACM SIGPLAN/SIGBED Conference on Languages, Compilers, and Tools For Embedded Systems (Dublin, Ireland, June 19 - 20, 2009). LCTES '09. ACM, New York, NY, 90-98. DOI=http://doi.acm.org/10.1145/1542452.1542465<br />
<br />
=== Week of July 27 ===<br />
* Wrote catalogue of activities from last week.<br />
* Began looking at some network code<br />
** Began getting sad.<br />
* Corrected bug in tlbMissHandler that would effectively disable interrupts<br />
** Originally when a memory violation occurred the handler would kill(thrcurrent), exlset(), and resched().<br />
*** Obviously this is incorrect. kill(thrcurrent) has a call to resched() in it and exlset doesn't allow exceptions to occur.<br />
** Now when a memory violation occurs the handler will exlreset() and kill(thrcurrent).<br />
* Moved around code in malloc and memRegionAlloc to more logically separate thread based memory and region based memory.<br />
** memRegionAlloc will allocate the region and return the region allocated to the caller.<br />
** malloc tries to allocate memory from thread->memlist, then tries a memRegionAlloc and inserts remaining memory in thread->memlist<br />
* Expanded the Embedded Xinu [[memory]] page by 30%! Added links to [[flash memory]] and [[memory management]].<br />
<br />
=== Week of August 3 ===</div>Michael