The Moxie Blog (original) (raw)
The Moxie Bloghttp://moxielogic.github.io/blog/2019-12-14T00:00:00-05:00Evaluating DejaGnu results with Red Light Green Light2019-12-14T00:00:00-05:00greentag:moxielogic.github.io,2019-12-14:/blog/red-light-green-light.html/
Last year I hacked up a tool in frustration called Red Light Green Light (rlgl) -- a proof-of-concept effort to demonstrate a git-centric way to manage "quality gates" in a CI/CD pipeline.
A CI/CD quality gate is a process that evaluates the quality of a software artefact before allowing …
Ledger launches moxie-based secure VM technology for blockchain applications2016-03-02T00:00:00-05:00greentag:moxielogic.github.io,2016-03-02:/blog/introducing-bolos.html/So here's an interesting picture from Ledger. Check out the chewy center on the right -- that APP is a moxie binary!
Image credit: Ledger's blog
Ledger, the hardware bitcoin wallet company, just announced BOLOS, the "Blockchain Open Ledger Operating Systems". What's most interesting to me, however, is that they have …
Moxie Mixie: Frustrating Remote Attackers with Container Specific Instruction Sets2016-01-14T00:00:00-05:00greentag:moxielogic.github.io,2016-01-14:/blog/moxie-mixie.html/While there are many existing technologies to frustrate remote attackers, it can be fun to think up novel protections that might be used to layer on additional defences.
Consider, for instance, that remote code execution through attacks like buffer overflows depends on knowledge of the remote systems' instruction set. Knowledge …
Moxie talk at Bitcoin Dev Meetup2015-02-15T15:21:00-05:00greentag:moxielogic.github.io,2015-02-15:/blog/moxie-talk-at-bitcoin-dev-meetup.html/
A very meta photo of me at the Toronto Bitcoin Developer Meetup yesterday, explaining moxie, and the value of a security oriented VM (moxiebox).
Photo used by permission from Jan Miranda.
An ELF Machine Number for Moxie2015-01-09T15:21:00-05:00greentag:moxielogic.github.io,2015-01-09:/blog/elf-machine-number.html/Moxie was assigned an official ELF machine number this week! You can check it out here: http://www.sco.com/developers/gabi/latest/ch4.eheader.html.
All ELF files start with a header describing properties of the object at hand. One of the most important properties is the 'machine' type …
Compacting the code with shorter load/store offsets2014-12-28T08:47:00-05:00greentag:moxielogic.github.io,2014-12-28:/blog/shorter-load-store-offsets.html/You may recall that moxie supports two instructions lengths: 16- and 48-bit. Today I'm introducing a few 32-bit instructions as well.
Previously, moxie's "load and store with offset" instructions were defined as...
Multiplication in the Real World2014-12-24T08:47:00-05:00greentag:moxielogic.github.io,2014-12-24:/blog/real-world-multiply.html/Load offset, long. Loads into $rA the 32-bit value from memory pointed at by …
ldo.l 00001100AAAABBBB iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
The bitcoin team has been exercising moxie in ways that it hasn't been stressed before. For example, they've been examining the code quality for their crypto libraries like libsecp256k1, an elliptical curve crypto library in C. One of their first feedbacks here was that moxie provides no native way to …
Moxiebox and bitcoin2014-12-18T05:00:00-05:00greentag:moxielogic.github.io,2014-12-18:/blog/moxiebox-and-bitcoint.html/
One of the more interesting developments around moxie is the adoption of the moxie architecture by the core bitcoin developers (Jeff Garzik, in particular), for an experimental project called moxiebox
.
To quote Jeff...
New Site2014-12-02T00:40:00-05:00greentag:moxielogic.github.io,2014-12-02:/blog/new-site.html/The goal is to provide a secure, sandboxed execution mechanism that enables deterministic input, processing and output …
I had finally had enough of the wiki spammers, and decided to migrate all of my content over to a static github hosted site. I believe all of the blog entries migrated over now, and I'm in the process of migrating the wiki content over to pages you can link …
Sign Extension2014-04-04T00:40:00-04:00greentag:moxielogic.github.io,2014-04-04:/blog/sign-extension.html/Moxie zero-extends all 8 and 16-bit loads from memory. Until recently, however, the GCC port didn't understand how loads worked, and would always shift loaded values back and forth to either empty out the upper bits or sign-extend the loaded value. While correct, it was overly bloated. If we're loading …
NetHack in your browser2014-01-26T18:12:00-05:00greentag:moxielogic.github.io,2014-01-26:/blog/nethack-in-your-browser.html/This is a moxie-rtems port of NetHack running on a modified version of the gdb moxie simulator compiled to javascript with emscripten.
Terminal uses canvasKrister Lagerström is responsible for this marvellous hack.
Also, I suppose this blog entry represents a distribution of some GPL'd source code from GDB, so …
The Moxie Game Console?2014-01-11T06:06:00-05:00greentag:moxielogic.github.io,2014-01-11:/blog/the-moxie-game-console.html/Ok, not quite, but Krister Lagerström recently did something cool..
That's NetHack ported to RTEMS running on the moxie based Marin SoC.
It runs on QEMU, via "qemu-system-moxie --nographic --machine marin --kernel nethack.elf
", or on FPGA hardware. I tested with a Nexys 3 Spartan-6 board by simply converting it …
The on-chip firmware for the Marin SoC has been updated with the gdb stub, so now when you program the FPGA, you'll see the following on the serial console:
MOXIE On-Chip Bootloader v2.0 Copyright (c) 2013 Anthony Green Waiting for an S-Record Download or Remote GDB Connection …
I recently trimmed the Marin SoC's on-chip memory down to 4k. The existing firmware for downloading srecord programs into external RAM for execution was taking up about 2k. With 2k to spare, I was wondering if you could fit a GDB remote protocol stub in there as well. It turns …
Moxie on Altera's Cyclone II, and a Chance Encounter2013-08-08T18:59:00-04:00greentag:moxielogic.github.io,2013-08-08:/blog/moxie-on-alteras-cyclone-ii-and-a-chance-encounter.html/I recently fired up the Altera software, Quartus II, and spent a little time porting the Marin SoC to the popular Cyclone II based DE2 board. There's no external memory support yet, but on-chip memory is working, and it looks like the on-chip bootloader is coming up properly. As usual …
QEMU 1.5 includes Moxie support2013-05-21T04:16:00-04:00greentag:moxielogic.github.io,2013-05-21:/blog/qemu-1-5-includes-moxie-support.html/QEMU 1.5 was just released the other day, and in the "And much more..." category I'm happy to say that it includes Moxie support!
This release contains basic Moxie core support, with the imaginary "moxiesim" board support. I have some local changes that provide Marin SoC emulation, and can …
An On-Chip Bootloader2013-05-06T02:25:00-04:00greentag:moxielogic.github.io,2013-05-06:/blog/an-on-chip-bootloader.html/Good news: we can access external memory! The logic for my pseudo-static RAM controller is working, and big programs can finally run on hardware.
You may recall that I had previously only been accessing fake memory that was configured directly out of limited FPGA resources. I could squeeze a tiny …
And time ticks on...2013-03-29T20:12:00-04:00greentag:moxielogic.github.io,2013-03-29:/blog/and-time-ticks-on.html/The interrupt controller is working now, as is the timer and my exception handling firmware. So now I'm able to write a basic stop-watch application, where the 7-segment display simply increments the count every second. Yes, this sounds basic, but there's a lot of complexity under the hood! This is …
Moxie ports and hardware developments2013-03-24T04:25:00-04:00greentag:moxielogic.github.io,2013-03-24:/blog/moxie-ports-and-hardware-developments.html/It's been a while since my last update.. let me bring you up to speed.
A couple of libffi releases got in the way of moxie hacking (although libffi 3.0.13 now includes full moxie support!), but things are picking up speed again.
On the software side of things …
Native On-Chip GDB Remote Protocol Support2012-11-24T05:47:00-05:00greentag:moxielogic.github.io,2012-11-24:/blog/native-on-chip-gdb-remote-protocol-support.html/A typical software debug solution for an embedded systems might involve a JTAG connection to the board, and then some kind of protocol translation software that handles communication between GDB's remote serial protocol and the target JTAG port (see OpenOCD, for instance). The FPGA systems I'm working with include JTAG …
Running a C Program on the Marin SoC2012-11-15T21:10:00-05:00greentag:moxielogic.github.io,2012-11-15:/blog/running-a-c-program-on-the-marin-soc.html/I've just committed the bits required to run a C program on the Marin SoC.
Rather than hook up the Nexys3 external RAM module, I'm using extra space on the FPGA itself for RAM. Most of the hard work was sorting out the linker script magic required to generate an …
Moxie SoC Progress2012-11-10T05:23:00-05:00greentag:moxielogic.github.io,2012-11-10:/blog/moxie-soc-progress.html/Time for a quick update!
"Marin" is the name of my test SoC consisting of a wishbone wrapped 75Mhz big-endian MoxieLite bus master, along with two slave devices: embedded ROM and the Nexys3's 7-segment display. So, right now I can write some code into FPGA embedded ROM to manipulate the …
Moxie and Free Software EDA at FSOSS2012-10-16T15:09:00-04:00greentag:moxielogic.github.io,2012-10-16:/blog/moxie-and-free-software-eda-at-fsoss.html/I'll be speaking at FSOSS in Toronto next week on moxie and Free Software EDA tools. Check it out here: http://fsoss.senecac.on.ca/2012/node/150.
MoxieLite in Action2012-09-22T04:40:00-04:00greentag:moxielogic.github.io,2012-09-22:/blog/moxielite-in-action.html/
Brad Robinson just sent me this awesome shot of MoxieLite in action. His Xilinx Spartan-6 FPGA based SoC features a moxie core handling VGA video, keyboard and FAT-on-flash filesystem duties using custom firmware written in C. This is all in support of a second z80-based core on the same FPGA …
It's Alive!2012-09-14T14:39:00-04:00greentag:moxielogic.github.io,2012-09-14:/blog/its-alive.html/There's a working hardware implementation of moxie in the wild!
Intrepid hacker Brad Robinson created this moxie-compatible core as a peripheral controller for his SoC. He had been using a simple 8-bit core, but needed to address more memory than was possible with the 8-bit part. Moxie is a nice …
The case against the [L]GPL for Semiconductor Core Licensing2012-09-09T19:35:00-04:00greentag:moxielogic.github.io,2012-09-09:/blog/the-case-against-the-lgpl-for-semiconductor-core-licensing.html/Eli Greenbaum wrote a terrific article for the Harvard Journal of Law & Technology last fall called 'Open Source Semiconductor Core Licensing'. I'm using the GPL as a place-holder in my verilog source, but I've always felt that the GPL/LGPL were inappropriate licenses for digital logic. Eli's article makes clear …
vfork() for uClinux forces an architecture change2012-09-03T07:35:00-04:00greentag:moxielogic.github.io,2012-09-03:/blog/vfork-for-uclinux-forces-an-architecture-change.html/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 …
Multiported Registers, Microcode and Register Forwarding2012-07-01T14:46:00-04:00greentag:moxielogic.github.io,2012-07-01:/blog/multiported-registers-microcode-and-register-forwarding.html/When I last wrote about tackling the 'pop' instruction I noted that I needed the ability to write to multiple registers before retiring that one instruction - something that would require extra instruction cycles or loads more logic. I recently came across some work by Charles Eric LaForest on Efficient Multi-Ported …
Notes on a novel in-game CPU: the dcpu-162012-04-09T07:35:00-04:00greentag:moxielogic.github.io,2012-04-09:/blog/notes-on-a-novel-in-game-cpu-the-dcpu-16.html/The hacker behind the Minecraft phenomena, Notch, is working on his next game, most likely another hit. This one is interesting in that it includes an in-game 16-bit processor called the dcpu-16. Details are sparse, but it seems as though gamers will use this processor to control spacecraft and play …
Using the Altera USB-Blaster on Fedora2011-10-28T13:14:00-04:00greentag:moxielogic.github.io,2011-10-28:/blog/using-the-altera-usb-blaster-on-fedora.html/Altera's Quartus tools include some special software to download bitstreams to their devices over USB (a DE-2 eval board, in my case). They require some tricky work to set up properly on Fedora - my dev host of choice. But you're in luck! I've packaged up an RPM that takes care …
Fake RAM, load/store and push2011-10-11T19:00:00-04:00greentag:moxielogic.github.io,2011-10-11:/blog/fake-ram-loadstore-and-push.html/Progress report time....
I need RAM in order to implement/test most instructions. To that end, I've implemented a fake data cache that is always accessed within a single cycle during the WRITE pipeline stage. Eventually this will have to be replaced with a real data cache that reads/writes …
GTKWave Tip #2: Translate Filter Files2011-10-06T17:10:00-04:00greentag:moxielogic.github.io,2011-10-06:/blog/gtkwave-tip-2-translate-filter-files.html/Tip #1 was about using an external process to perform dynamic translations of signal display values. GTKWave can also perform simple static translations of data. In the example below, for instance, moxie's execute unit is receiving a 4-bit signal identifying "register A" (riA_i) for whatever operation is about to happen …
GTKWave Tip #12011-10-04T10:34:00-04:00greentag:moxielogic.github.io,2011-10-04:/blog/gtkwave-tip-1.html/GTKWave is a new tool for me, so I'll use this space to post useful tips as I discover them.
The first tip comes from Tony Bybell, author of GTKWave, who pointed me at some helpful functionality in a recent blog comment. You can enhance GTKWave's waveform display by replacing …
Branch delays2011-09-28T07:13:00-04:00greentag:moxielogic.github.io,2011-09-28:/blog/branch-delays.html/I've coded up logic for more arithmetic instructions, register moves, as well as direct and indirect jumps. For jumps, I simply pass a branch signal from the execute stage back to the fetch stage, as well as the computed target address. Here's some code that works now:
.text xor $r0 …
A moxie-based SoC had it's first successful simulation run today....
Pretty exciting! So, here's what's happening...
The SoC, code named "Muskoka", has three main components: the moxie core, a wishbone switch and a ROM device. The switch was easy to implement, as I just have a single bus master (moxie …
RTEMS status update2011-06-15T04:35:00-04:00greentag:moxielogic.github.io,2011-06-15:/blog/rtems-status-update.html/The RTEMS port in moxiedev is looking pretty good right now. Here's a test of the RTEMS network loopback device running on the moxie gdb simulator. The first two client connections fail in this test. It's supposed to fail in the first case, but I'm not sure about the second …
Bisecting GCC2011-06-06T07:23:00-04:00greentag:moxielogic.github.io,2011-06-06:/blog/bisecting-gcc.html/The thing about GCC is that things break when you take your eye off the ball. And this is what happened during my months long hiatus from the moxie project. Somewhere between early March and today, the moxie GCC port lost the ability to compile non-trivial code, notably libgcc. Firing …
On-chip communications2010-10-06T04:37:00-04:00greentag:moxielogic.github.io,2010-10-06:/blog/on-chip-communications.html/I need to build real SoC infrastructure around my developing core in order to test it on real hardware. For the most part, this means a memory controller and IO devices. I've decided to implement a shared-bus wishbone-style interconnect for these devices. Wishbone is an open source on chip bus …
Quartus II and the Cloud: Not There Yet...2010-09-20T15:55:00-04:00greentag:moxielogic.github.io,2010-09-20:/blog/quartus-ii-and-the-cloud-not-there-yet.html/Altera's Quartus II software is now running on my Fedora box, but I was really hoping to load it into a grid of Amazon EC2 instances so I could batch out jobs for synthesis, place and route. Unfortunately the free-beer Quartus software requires a license file that is generated based …
Pipeline hazards2010-09-10T13:25:00-04:00greentag:moxielogic.github.io,2010-09-10:/blog/pipeline-hazards.html/I've coded up a first go at four pipeline stages so far: Fetch, Decode, Execute, and Write. After the relative complexity of the Fetch implementation, the rest has been pretty straight forward, and I've started running the first bit of compiled code through the pipline. Here's that start of our …
Fetching instructions2010-09-07T13:56:00-04:00greentag:moxielogic.github.io,2010-09-07:/blog/fetching-instructions.html/Moxie requires some interesting instruction fetch logic.
For my initial implementation I'm assuming a 32-bit path to instruction memory. But moxie has both 16- and 48-bit instructions, so it's not like simple RISC cores that can feed the pipeline on every cycle. My solution is to feed 32-bit instruction memory …
The FPGA test board2010-08-18T14:03:00-04:00greentag:moxielogic.github.io,2010-08-18:/blog/the-fpga-test-board.html/I picked up a lightly used FPGA development board from craigslist today. It's the Altera DE2 board with a Cyclone II FPGA.
There are a few nice things about this board...
- It's loaded with real and useful peripherals: 16x2 LCD Panel, VGA DAC, lots of LEDs, RS232, IrDA, PS/2 …
...Just in case you were wondering!
But it's been slow going. The good news is that moxie is front and centre for me again, so let's see what we can do over the next few weeks. And over these next few weeks I'm promising myself not to touch a C …
The Moxielyzer2009-10-14T22:05:00-04:00greentag:moxielogic.github.io,2009-10-14:/blog/the-moxielyzer.html/I just committed a little binary analysis tool to moxiedev. You can use it to perform simple static analysis on moxie binaries. The kinds of things I'm looking for are compiler bugs (because I know there's still one there that is triggered by -frerun-cse-after-loop), and instruction statistics. For instance, which …
Summer is over, so put away the white pants and start submitting patches!2009-09-10T14:21:00-04:00greentag:moxielogic.github.io,2009-09-10:/blog/summer-is-over-so-put-away-the-white-pants-and-start-submitting-patches.html/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 …
Before we can start building BusyBox, we need a few more bits of technology...
- uClibc: this is a popular embedded C library, like newlib, but used more often in Linux environments. I ported uClibc to the moxie core just like every other bit of software in this project: quickly! My …
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 …
The Moxie Linux port2009-07-23T03:50:00-04:00greentag:moxielogic.github.io,2009-07-23:/blog/the-moxie-linux-port.html/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 …
Reverse debugging!2009-07-12T21:55:00-04:00greentag:moxielogic.github.io,2009-07-12:/blog/reverse-debugging.html/A few weeks ago I happened to be in Palo Alto and met up with my friend and long-time GDB hacker Michael Snyder. He told me about a new feature in GDB called "process recording". The basic idea is that when you tell GDB to enter into "record mode", it …
A Disassembler in Verilog2009-06-22T18:55:00-04:00greentag:moxielogic.github.io,2009-06-22:/blog/a-disassembler-in-verilog.html/I've been playing around a little more with verilog. Here's a mostly complete moxie disassembler module written in verilog.
And here's a little driver for it. The driver reads a hex dump file into an array representing memory. On every clock cycle it updates the instruction and data output registers …
ISA improvements2009-06-11T05:19:00-04:00greentag:moxielogic.github.io,2009-06-11:/blog/isa-improvements.html/I've committed the PC-relative branch instruction changes upstream. But this is just one of many ISA improvements that need to happen. Here are a handful of other ideas off the top of my head. None of these projects should be particularly difficult.
- Shorten load/store offsets to 16-bits. They are …
The moxie port has been accepted by the GCC steering committee!
I just checked it in.
That is all.
Everything is relative (finally!)2009-06-07T17:57:00-04:00greentag:moxielogic.github.io,2009-06-07:/blog/everything-is-relative-finally.html/The Moxie ISA still needs quite a bit of tuning. Take branches, for instance. A beq
instruction currently encoded like so...
`00001111xxxxxxxx iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii`
...where the "x
"s represent "don't care" bits, and "i
"s are a 32-bit absolute branch target. That's right -- branch targets are not PC relative! This …
So it turns out that hosting a git repo that is only accessible via slow http is no fun.
Fortunately, the great team at github.com were willing to take this on, so now the real repository is accessible via this command:
$ git clone git://github.com/atgreen/moxiedev.git …
I'll bottom line this one quickly:
- moxiedev is now maintained with git. Check it out like so..
$ git clone http://moxielogic.org/moxiedev.git
- moxiedev now contains a partial u-boot port. It's "partial" because I fat fingered some commands and blew away four or five important files. They will have …
I just read The Race For A New Game Machine today on a cross-country flight, and wow.. fun read!
If you've ever read Tracy Kidder's great book The Soul of a New Machine, you'll know what to expect. But this book chronicles the SONY/Toshiba/IBM Cell partnership, and the …
RPMs2009-05-07T17:37:00-04:00greentag:moxielogic.github.io,2009-05-07:/blog/rpms.html/There's a little more detail on the wiki, but basically...
$ rpm -ivh http://moxielogic.org/download/moxielogic-repo-1-1.noarch.rpm $ yum groupinstall moxiedev
Your welcome.
Seriously though... release engineering is at times both tedious and fascinating. But mostly tedious. Still, I was interested in tackling a little releng work this week …
Quick update...2009-04-29T22:38:00-04:00greentag:moxielogic.github.io,2009-04-29:/blog/quick-update.html/A few quick MoxieDev updates...
- The verilog output patch is in binutils
- The moxie ports for binutils, newlib, libgloss and gdb are all upstream. Waiting on sim and gcc reviews.
- The upstream qemu team have switched to git, so I've rebased MoxieDev's qemu against this new repository.
Also, I've been …
Loading programs into the verilog simulation2009-04-22T13:38:00-04:00greentag:moxielogic.github.io,2009-04-22:/blog/loading-programs-into-the-verilog-simulation.html/The moxie newlib port was just accepted. The GCC port will take a little longer to review, but I hope that it will get accepted early next week. Already there has been some useful feedback resulting in a few improvements. For instance, the moxie libgcc.a now provides the soft-fp …
Pushing Bits Upstream2009-04-16T17:55:00-04:00greentag:moxielogic.github.io,2009-04-16:/blog/pushing-bits-upstream.html/If there's one thing I've learned about GNU tools development over the years, it's that attempting to maintain a tools port outside of the upstream tree is A Very Bad Idea! It's easy to let your private tree fall out of sync from upstream. And the longer you wait to …
A Verilogical Place To Start *2009-04-07T20:31:00-04:00greentag:moxielogic.github.io,2009-04-07:/blog/a-verilogical-place-to-start.html/I've written my first bit of verilog tonight. It's not much, really, but it's a start. I'm using Icarus Verilog (iverlog) to compile and simulate the code. I also plan on using GTKWave to examine timing dumps from the iverilog simulator. Both of these tools are part of my development …
Das U-Boot on moxie!2009-04-02T16:28:00-04:00greentag:moxielogic.github.io,2009-04-02:/blog/das-u-boot-on-moxie.html/My moxie port of U-Boot, the Universal Boot Loader, has started working!
$ qemu-system-moxie -nographic -kernel u-boot SDRAM : U-Boot Start:0x00001000 Using default environment U-BOOT for "moxiesim" => version U-Boot 2009.03-rc2-00013-gefb4734-dirty (Apr 02 2009 - 20:07:32) => printenv bootargs=root …
My first go at exceptions is working well. The basic idea is that moxie will have a single exception handling routine whose address lives in special register 1. You set the exception handler like so:
void install_handler(void (*handler)(void)) { printf ("Installing handler 0x%x\n", (unsigned) handler); asm("ssr …
In reading about how other processors handle exceptions, they seem to be of two sorts. Some (most?) processors look into a vector of exception handlers based on the exception type (Divide by Zero, Software Interrupt, IRQ, etc), and the other sort jumps to a single exception address and lets the …
Adding a Real Time Clock2009-03-17T15:38:00-04:00greentag:moxielogic.github.io,2009-03-17:/blog/adding-a-real-time-clock.html/After a UART, one of the most useful and interesting peripherals you can add to a board is a Real Time Clock (RTC). Qemu comes with a simulation of Freescale's MC146818 RTC chip. Adding it to our qemu-defined board was as simple as....
rtc_mm_init(0x400, 0, 0, 0);
This …
Board Support Packages2009-03-17T14:51:00-04:00greentag:moxielogic.github.io,2009-03-17:/blog/board-support-packages.html/Today we're introducing the notion of Board Support Packages (BSPs) to the moxie toolchain.
A BSP provides all of the configuration data and code requires to target a specific hardware platform. This mostly involves linker scripts, platform initialization code, and hardware abstraction support libraries.
Until recently the gdb sim was …
Debugging with the moxie qemu simulator2009-03-14T06:58:00-04:00greentag:moxielogic.github.io,2009-03-14:/blog/debugging-with-the-moxie-qemu-simulator.html/I've finally cracked the gdb+qemu puzzle, so now we can debug code running on the qemu moxie simulator!
The last little gotcha was that the simulated pcwasn′tbeingupdatedaftersingle−stepping.Thiswillgetyounowherefast!Butit′sallfixednow,andhere′showitworks...</p><p><code>pc wasn't being updated after single-stepping. This will get you nowhere fast! But it's all fixed now, and here's how it works...</p> <p><code>pcwasn′tbeingupdatedaftersingle−stepping.Thiswillgetyounowherefast!Butit′sallfixednow,andhere′showitworks...</p><p><code> qemu-system-moxie …
A Tiny Computer2009-03-13T14:48:00-04:00greentag:moxielogic.github.io,2009-03-13:/blog/a-tiny-computer.html/Lambda the Ultimate today posted a interesting blog entry on A Tiny Computer. It refers to 2007 paper by Chuck Thacker at Microsoft Research describing a tiny 32-bit processor. Appendix A of the paper includes the entire synthesizeable verilog implementation in just a page and a half of code! Here's …
Progress...2009-03-12T20:34:00-04:00greentag:moxielogic.github.io,2009-03-12:/blog/progress.html/I made some progress on using moxie-elf-gdb with qemu the other day. Qemu has an integrated gdb stub, so GDB speaks to it via the remote protocol. It's still not quite there, but getting close. I'm anxious to get it working, as it's the last step before hacking on the …
MoxieDev and the Wiki2009-03-07T06:22:00-05:00greentag:moxielogic.github.io,2009-03-07:/blog/moxiedev-and-the-wiki.html/Now that the project has been renamed, the mercurial source repository has also changed from ggxdev to MoxieDev. This repository contains the entire toolchain, simulators and benchmark programs. You can check the entire thing out like so...
I've also created a wik …
Qemu says Hello, World!2009-03-07T06:22:00-05:00greentag:moxielogic.github.io,2009-03-07:/blog/qemu-says-hello-world.html/Virtually all of the simulation done so far was with the GDB instruction set simulator. As a basic instruction set simulator, it was limited to executing instructions found in typical "user level" applications. And, if you recall, all interaction with the outside world happened through magic software interrupts that were …
Moxie: the ggx reboot2009-03-07T05:23:00-05:00greentag:moxielogic.github.io,2009-03-07:/blog/moxie-the-ggx-reboot.html/Hola Amigos! Several months ago I experimented with a new ISA design called ggx. I blogged about the co-evolution of the ISA and tools, and it was fun.
Now, after a short break, I'm ready to resume hacking.
I'm also ready to put a stake in the ground as far …