www.flickr.com
tres frijoles' photos More of tres frijoles' photos
You are here: tearsoffire.org > Projects Web > ElectronicsProjects > SolidStatePc r3 - 20 Jun 2007 - 10:17 - ChristopherPepe


Start of topic | Skip to actions

SolidStatePc



Stumble It!

em-351.JPG

about

I recently came into this sweet SBC. It's a geode (x86) with parallel port, 2xRS232, 2xUSB, VGA/TV-Out, Keyboad/Mouse via PS/2 and other great features. Most I won't use like the ChipOnDisk socket, LCD header, floppy and IDE headers and some others. The board was designed to be about the same size as a 3.5" harddrive so it's nice and compact.

There is a CF slot attached to the secondary IDE controller with ATA support thus a CF card looks just like any other IDE drive to the system. This means it is pretty straight forward to install a standard operating system rather than going thru most of the trouble I usually do with embedded systems. Still there needs to be some challenging aspect to the project otherwise it's boring. In this case it will be configuring the system to run off of a CF card and of course installing linux onto the CF card from a development box.

I don't yet have a good feel for the processing power that this box has yet.

Install GRUB and Kernel on the CF card via USB

The first step is to create the filesystem. Initally I'll use EXT2 since I don't want a journaling FS on a flash drive. The CF card is attached to my laptop via a USB card reader.

 cfdisk /dev/sda 
I created one linux partition (type 0x83) and then made the filesystem.
 mkfs.ext2 /dev/sda1 

Then copied over some of the boot partition from my laptop. Note that I'll later be using LFS to build the whole system but for initial testing I'll just use what I have laying around.

mkdir -p /media/usbdisk/boot/grub
cp /boot/grub/stage* /media/usbdisk/boot/grub
touch /media/usbdisk/boot/grub/menu.lst
touch /media/usbdisk/boot/grub/device.map
cp /boot/vmlinuz.2.6.15-28-386 /media/usbdisk/boot/vmlinuz

The device map just tells grub which device to use and mine contains hd0 /dev/hda. The menu.lst file points grub at the system kernel and filesystem. Mine looks like:

default 0
timeout 10

title           kernel 2.6.15-28-386
root            (hd0,0)
kernel          /boot/vmlinuz root=/dev/hda1
boot

Now the CF card contains all it needs to install GRUB and test it out. I run grub as a normal user (not root) so I only have access to the CF card and not my real harddrive. This provides some protection against hosing my laptop since I don't have permission to overwrite it's bootloader - be careful when messing with bootloaders. Drop into the grub tool by running grub and issue a few commands:

grub> root (hd0,0)
grub> setup (hd0)

That's it! GRUB is not installed and will look for menu.lst on boot. The setup command installs stage1 and stage2 which handle the actual bootloading and bring up the grub menu we all know and love.

Testing with QEMU

So netstatic turned me on to using QEMU for testing the CF card images. It is really cumbersome rebooting the target machine each time you try a new image so QEMU speeds up the process quite a bit.

DONE At this point we have GRUB installed and a good kernel but no filesystem. I'm just testing so I don't care but remember this isn't a full system yet.

Invoke QEMU with the target system properties:

qemu -hda /dev/sda -m 64
This invokes qemu with /dev/sda being emulated as hda and with 64MB of RAM. The GRUB menu comes up with the option shown above in my menu.lst and then the kernel starts to boot. Of course it panics when VFS mount the filesystem.

Testing on the Real System

Once the systems is booting and looks good in qemu its time to pop the CF card in the real system and power up. First a few things have to change since the CF card is on the secondary IDE contoller in the EM351A.

/boot/grub/device.map contains:
(hd0) /dev/hdc

/etc/fstab:
change the root mount line from hda1 to hdc1

Oddly enough the SBC has eth1 brought out to a connector rather than eth0. That took a little while to figure out and get networking setup... I'm using a copy of netstatic's LFS image from another project to get going however this system really needs its own LinuxForScratch? image for the project to continue.

System Stats

cpuinfo

processor	: 0
vendor_id	: CyrixInstead
cpu family	: 5
model		: 9
model name	: Geode(TM) Integrated Processor by National Semi
stepping	: 2
cpu MHz		: 300.715
cache size	: 16 KB
fdiv_bug	: no
hlt_bug		: no
f00f_bug	: no
coma_bug	: no
fpu		: yes
fpu_exception	: yes
cpuid level	: 2
wp		: yes
flags		: fpu tsc msr cx8 cmov mmx cxmmx
bogomips	: 606.26

dmesg

Linux version 2.6.16.27 (root@lfslivecd) (gcc version 4.0.3) #1 SMP PREEMPT Thu Aug 31 15:52:32 EST 2006
BIOS-provided physical RAM map:
 BIOS-e820: 0000000000000000 - 00000000000a0000 (usable)
 BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
 BIOS-e820: 0000000000100000 - 0000000003d80000 (usable)
 BIOS-e820: 00000000ffff0000 - 0000000100000000 (reserved)
61MB LOWMEM available.
On node 0 totalpages: 15744
  DMA zone: 4096 pages, LIFO batch:0
  DMA32 zone: 0 pages, LIFO batch:0
  Normal zone: 11648 pages, LIFO batch:1
  HighMem zone: 0 pages, LIFO batch:0
DMI not present or invalid.
ACPI: Unable to locate RSDP
Allocating PCI resources starting at 10000000 (gap: 03d80000:fc270000)
Built 1 zonelists
Kernel command line: root=/dev/hdc1
No local APIC present or hardware disabled
mapped APIC to ffffd000 (010bc000)
Initializing CPU#0
PID hash table entries: 256 (order: 8, 4096 bytes)
Detected 300.715 MHz processor.
Using tsc for high-res timesource
Console: colour VGA+ 80x25
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 57736k/62976k available (2669k kernel code, 4836k reserved, 853k data, 208k init, 0k highmem)
Checking if this processor honours the WP bit even in supervisor mode... Ok.
Calibrating delay using timer specific routine.. 606.26 BogoMIPS (lpj=1212520)
Mount-cache hash table entries: 512
CPU: After generic identify, caps: 00808131 01818131 00000000 00000000 00000000 00000000 00000000
CPU: After vendor identify, caps: 00808131 01818131 00000000 00000000 00000000 00000000 00000000
Working around Cyrix MediaGX virtual DMA bugs.
Enable Memory-Write-back mode on Cyrix/NSC processor.
Enable Memory access reorder on Cyrix/NSC processor.
Enable Incrementor on Cyrix/NSC processor.
CPU: After all inits, caps: 00808131 00818131 00000000 00000001 00000000 00000000 00000000
Checking 'hlt' instruction... OK.
CPU0: Cyrix Geode(TM) Integrated Processor by National Semi stepping 02
SMP motherboard not detected.
Local APIC not detected. Using dummy APIC emulation.
Brought up 1 CPUs
migration_cost=0
NET: Registered protocol family 16
PCI: PCI BIOS revision 2.10 entry at 0xfad80, last bus=0
PCI: Using configuration type 1
ACPI: Subsystem revision 20060127
ACPI: Interpreter disabled.
Linux Plug and Play Support v0.97 (c) Adam Belay
pnp: PnP ACPI: disabled
SCSI subsystem initialized
usbcore: registered new driver usbfs
usbcore: registered new driver hub
PCI: Probing PCI hardware
PCI: Probing PCI hardware (bus 00)
Boot video device is 0000:00:12.4
PCI: Using IRQ router NatSemi [1078/0100] at 0000:00:12.0
PCI: Ignore bogus resource 6 [0:0] of 0000:00:12.4
audit: initializing netlink socket (disabled)
audit(1177167771.448:1): initialized
Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
lp: driver loaded but no devices found
Linux agpgart interface v0.101 (c) Dave Jones
[drm] Initialized drm 1.0.1 20051102
PNP: No PS/2 controller found. Probing ports directly.
serio: i8042 AUX port at 0x60,0x64 irq 12
serio: i8042 KBD port at 0x60,0x64 irq 1
Serial: 8250/16550 driver $Revision: 1.3 $ 4 ports, IRQ sharing disabled
serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
serial8250: ttyS2 at I/O 0x3e8 (irq = 4) is a 16550A
serial8250: ttyS3 at I/O 0x2e8 (irq = 3) is a 16550A
parport0: PC-style at 0x378 [PCSPP(,...)]
lp0: using parport0 (polling).
parport1: PC-style at 0x278 [PCSPP(,...)]
lp1: using parport1 (polling).
Floppy drive(s): fd0 is 1.44M
FDC 0 is a post-1991 82077
8139too Fast Ethernet driver 0.9.27
PCI: setting IRQ 12 as level-triggered
PCI: Assigned IRQ 12 for device 0000:00:0f.0
eth0: RealTek RTL8139 at 0xe000, 00:90:0b:05:bd:f5, IRQ 12
eth0:  Identified 8139 chip type 'RTL-8139C'
PCI: Found IRQ 10 for device 0000:00:10.0
IRQ routing conflict for 0000:00:10.0, have irq 5, want irq 10
eth1: RealTek RTL8139 at 0xe400, 00:90:0b:05:bd:f6, IRQ 5
eth1:  Identified 8139 chip type 'RTL-8139C'
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
Probing IDE interface ide0...
Probing IDE interface ide1...
hdc: SanDisk SDCFJ-256, CFA DISK drive
ide1 at 0x170-0x177,0x376 on irq 15
hdc: max request size: 128KiB
hdc: 501760 sectors (256 MB) w/1KiB Cache, CHS=980/16/32
hdc: cache flushes not supported
 hdc: hdc1
libata version 1.20 loaded.
ieee1394: raw1394: /dev/raw1394 device initialized
usbmon: debugfs is not available
USB Universal Host Controller Interface driver v2.3
usbcore: registered new driver usblp
drivers/usb/class/usblp.c: v0.13: USB Printer Device Class driver
Initializing USB Mass Storage driver...
usbcore: registered new driver usb-storage
USB Mass Storage support registered.
usbcore: registered new driver usbhid
drivers/usb/input/hid-core.c: v2.6:USB HID core driver
mice: PS/2 mouse device common for all mice
Advanced Linux Sound Architecture Driver Version 1.0.11rc2 (Wed Jan 04 08:57:20 2006 UTC).
ALSA device list:
  No soundcards found.
oprofile: using timer interrupt.
NET: Registered protocol family 2
IP route cache hash table entries: 512 (order: -1, 2048 bytes)
TCP established hash table entries: 2048 (order: 2, 24576 bytes)
TCP bind hash table entries: 2048 (order: 2, 24576 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
ip_conntrack version 2.4 (492 buckets, 3936 max) - 172 bytes per conntrack
TCP bic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
Using IPI Shortcut mode
VFS: Mounted root (ext2 filesystem) readonly.
Freeing unused kernel memory: 208k freed
input: AT Translated Set 2 keyboard as /class/input/input0
eth1: link up, 100Mbps, full-duplex, lpa 0x45E1

-- ChristopherPepe - 18 Apr 2007

Edit | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r3 < r2 < r1 | More topic actions
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding tearsoffire.org? Send feedback