Moxie uses a simple software interrupt instruction (swi
) to implement
system calls. The swi
instruction creates a call frame on the stack
and then jumps to a global exception handler routine. The exception
handler for moxie-uClinux switches to the kernel stack before jumping to
the relevant kernel routine. Returning from …
I found some time to look at the Linux kernel port again, and discovered a bug in the forking code (the child process must return 0 after a fork!). What we're looking at here is the start of userland, post kernel boot, where busybox is trying to run an init …
It's been a while since my last update. What can I say... summer was nice.
But now, back to business! I've just committed some long overdue patches to the upstream GNU tools:
- Add a device tree blob to the gdb simulator. This lets us describe the gdb sim target to …
Tonight I got a hello world app to use uClibc's puts()
routine! This
is a big deal because it's the first time I've had system calls coming
in from userland. I haven't checked the changes in yet, because they're
a mess, but here's a basic run-down of what I had …
I've been taking advantage of the nice summer weather recently, so it's taken me a while to get around to this... but here's the first moxie userland app!
#include <string.h>
#define MSG "Hello, World!\n"
void __attribute__((noinline)) gloss_write (int fd, char *ptr, int len)
{
asm("swi 5"); // "write …
Sooo..... it turns out there's lots to take care of before userland apps like BusyBox can run.
- The root filesystem. This one is easy. I just built a short Hello World application in C with moxie-uclinux-gcc. This produces an executable in BFLT format which I call 'init'. The kernel build …
Userland, here I come! Check out moxiedev, run "ant build", then do the following...
$ ./root/usr/bin/moxie-elf-run linux-2.6/vmlinux
Linux version 2.6.31-rc3-gb006656-dirty (green@dev.moxielogic.com) (gcc version 4.5.0 20090715 (experimental) [trunk revision 149693] (GCC) ) #6 Sun Jul …
I've spent a lot of time in airports/planes/hotels recently, which is good news for the moxie linux port. It runs about 6.5M instructions, booting up to the point where a couple of kernel threads are created. However, a few context switches later it all comes tumbling down …
I've just checked the start of the kernel port into moxiedev. Running "ant build" will produce tools, simulators, u-boot and now a vmlinux you can run with moxie-elf-run or in gdb. It crashes on startup right now, but that's to be expected. I just got it to the point where …