Author Topic: Accessing RedBoot with Uart  (Read 4721 times)

theeuwke

  • Newbie
  • *
  • Posts: 1
Accessing RedBoot with Uart
« on: June 08, 2009, 08:33:50 PM »
Hi Everybody,

I've just have the Elonex One (Aware Aview) for a couple of weeks. I want to use it as a server, but the current linux distrobution is not very suitable. So I decided to open it and see whats inside.

I notised that there are 2 whiteconnections on the top of the main pcb, on the battery side. The Uart is located on J12.
From above, from left to right:
PIN1: Ground
PIN3: TX (to RX of the PC)
PIN6: RX (to TX of the PC)

you need a converter cable (max232 based of similar) to convert the voltage level. I used a siemens C35 datacable, because you won't need an extra power supply, and they are very cheap.

Hook the Elonex on the pc, and open Hyperterm on 38400 Baud. Notise, the first time you may see garbage data. When I was discovering the Uart, I notished the clock seems to jitter, And I had to hack the uart driver to work on 40000 baud.

If everything is alright, you should see something like this:
Quote
ÿ+Ethernet eth0: MAC address 00:00:01:02:03:04
IP: 192.168.253.10/255.255.255.0, Gateway: 192.168.253.254
Default server: 0.0.0.0

RedBoot(tm) bootstrap and debug environment [ROM]
Non-certified release, version v2_0 - built 07:54:36, Feb 10 2008

Platform: PC (I386)
Copyright (C) 2000, 2001, 2002, Red Hat, Inc.

RAM: 0x00000000-0x000f0000, 0x000726b0-0x000a0000 available
R3233    00:0012 30-12-2007
<press Ctrl+C to enter prompt mode>

RedBoot>

So the "bios" and nothing more than just a bootloader, to load a linux kernel or plain binary.
When you let the notebook boot:

Quote
mem_size: 10000000
initrd fe60000 len 180000
Linux version 2.6.21.3 (root@vm-db26) (gcc version 3.3.5 (Debian 1:3.3.5-13)) #8 Mon Jan 28 06:27:54 CST 2008
BIOS-provided physical RAM map:
sanitize start
sanitize bail 0
 BIOS-e801: 0000000000000000 - 000000000009f000 (usable)
 BIOS-e801: 0000000000100000 - 0000000010000000 (usable)
256MB LOWMEM available.
Zone PFN ranges:
  DMA             0 ->     4096
  Normal       4096 ->    65536
early_node_map[1] active PFN ranges
    0:        0 ->    65536
DMI not present or invalid.
Allocating PCI resources starting at 20000000 (gap: 10000000:f0000000)
Built 1 zonelists.  Total pages: 65024
Kernel command line: console=ttyS0,38400
No local APIC present or hardware disabled
Initializing CPU#0
PID hash table entries: 1024 (order: 10, 4096 bytes)
Console: colour dummy device 80x25
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 253672k/262144k available (2491k kernel code, 8044k reserved, 1125k data, 188k init, 0k highmem)
virtual kernel memory layout:
    fixmap  : 0xfffbb000 - 0xfffff000   ( 272 kB)
    vmalloc : 0xd0800000 - 0xfffb9000   ( 759 MB)
    lowmem  : 0xc0000000 - 0xd0000000   ( 256 MB)
      .init : 0xc048c000 - 0xc04bb000   ( 188 kB)
      .data : 0xc036ed7a - 0xc048844c   (1125 kB)
      .text : 0xc0100000 - 0xc036ed7a   (2491 kB)
Checking if this processor honours the WP bit even in supervisor mode... Ok.
Mount-cache hash table entries: 512
Compat vDSO mapped to ffffe000.
CPU: 486
Checking 'hlt' instruction... OK.
NET: Registered protocol family 16
PCI: Using configuration type 1
Setting up standard PCI resources
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
PCI: Probing PCI hardware
Time: pit clocksource has been installed.
NET: Registered protocol family 2
IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
TCP established hash table entries: 8192 (order: 4, 65536 bytes)
TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
TCP reno registered
checking if image is initramfs...it isn't (no cpio magic); looks like an initrd
Freeing initrd memory: 1536k freed
microcode: CPU0 not a capable Intel processor
IA-32 Microcode Update Driver: v1.14a <tigran@aivazian.fsnet.co.uk>
NTFS driver 2.1.28 [Flags: R/W].
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled
serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
RAMDISK driver initialized: 16 RAM disks of 32000K size 1024 blocksize
loop: loaded (max 8 devices)
nbd: registered device at major 43
ehci_hcd 0000:00:02.2: EHCI Host Controller
ehci_hcd 0000:00:02.2: new USB bus registered, assigned bus number 1
ehci_hcd 0000:00:02.2: irq 14, io mem 0xd8000000
ehci_hcd 0000:00:02.2: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 4 ports detected
ehci_hcd 0000:00:03.2: EHCI Host Controller
ehci_hcd 0000:00:03.2: new USB bus registered, assigned bus number 2
ehci_hcd 0000:00:03.2: irq 12, io mem 0xd9000000
ehci_hcd 0000:00:03.2: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004
usb usb2: configuration #1 chosen from 1 choice
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 4 ports detected
USB Universal Host Controller Interface driver v3.0
uhci_hcd 0000:00:02.0: UHCI Host Controller
uhci_hcd 0000:00:02.0: new USB bus registered, assigned bus number 3
uhci_hcd 0000:00:02.0: irq 12, io base 0x0000f000
usb usb3: configuration #1 chosen from 1 choice
hub 3-0:1.0: USB hub found
hub 3-0:1.0: 2 ports detected
usb 1-1: new high speed USB device using ehci_hcd and address 2
uhci_hcd 0000:00:02.1: UHCI Host Controller
uhci_hcd 0000:00:02.1: new USB bus registered, assigned bus number 4
uhci_hcd 0000:00:02.1: irq 9, io base 0x0000f100
usb usb4: configuration #1 chosen from 1 choice
hub 4-0:1.0: USB hub found
hub 4-0:1.0: 2 ports detected
uhci_hcd 0000:00:03.0: UHCI Host Controller
uhci_hcd 0000:00:03.0: new USB bus registered, assigned bus number 5
uhci_hcd 0000:00:03.0: irq 9, io base 0x0000f200
usb usb5: configuration #1 chosen from 1 choice
hub 5-0:1.0: USB hub found
hub 5-0:1.0: 2 ports detected
usb 1-1: configuration #1 chosen from 1 choice
uhci_hcd 0000:00:03.1: UHCI Host Controller
uhci_hcd 0000:00:03.1: new USB bus registered, assigned bus number 6
uhci_hcd 0000:00:03.1: irq 14, io base 0x0000f300
usb usb6: configuration #1 chosen from 1 choice
hub 6-0:1.0: USB hub found
hub 6-0:1.0: 2 ports detected
Initializing USB Mass Storage driver...
usb 2-3: new high speed USB device using ehci_hcd and address 4
usb 2-3: configuration #1 chosen from 1 choice
usb 4-2: new full speed USB device using uhci_hcd and address 2
usb 4-2: configuration #1 chosen from 1 choice
scsi0 : SCSI emulation for USB Mass Storage devices
usb 5-1: new full speed USB device using uhci_hcd and address 2
usb 5-1: configuration #1 chosen from 1 choice
usb 5-2: new low speed USB device using uhci_hcd and address 3
usb 5-2: configuration #1 chosen from 1 choice
usb 6-2: new full speed USB device using uhci_hcd and address 2
usb 6-2: device descriptor read/64, error -71
usb 6-2: device descriptor read/64, error -71
usb 6-2: new full speed USB device using uhci_hcd and address 3
usb 6-2: device descriptor read/64, error -71
usb 6-2: device descriptor read/64, error -71
usb 6-2: new full speed USB device using uhci_hcd and address 4
usb 6-2: device not accepting address 4, error -71
usb 6-2: new full speed USB device using uhci_hcd and address 5
usb 6-2: device not accepting address 5, error -71
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
input: C-Media USB Audio Device    as /class/input/input0
input: USB HID v1.00 Device [C-Media USB Audio Device   ] on usb-0000:00:03.0-1
input: U+P Mouse    as /class/input/input1
input: USB HID v1.10 Mouse [U+P Mouse   ] on usb-0000:00:03.0-2
usbcore: registered new interface driver usbhid
drivers/usb/input/hid-core.c: v2.6:USB HID core driver
i8042.c: Can't read CTR while initializing i8042.
i8042: probe of i8042 failed with error -5
mice: PS/2 mouse device common for all mice
Advanced Linux Sound Architecture Driver Version 1.0.14rc3 (Wed Mar 14 07:25:50 2007 UTC).
usbcore: registered new interface driver snd-usb-audio
ALSA device list:
  #0: C-Media USB Audio Device    at usb-0000:00:03.0-1, full speed
NET: Registered protocol family 26
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
ieee80211: 802.11 data/management/control stack, git-1.1.13
ieee80211: Copyright (C) 2004-2005 Intel Corporation <jketreno@linux.intel.com>
Using IPI Shortcut mode
RAMDISK: Compressed image found at block 0
kjournald starting.  Commit interval 5 seconds
EXT3 FS on ram0, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
VFS: Mounted root (ext3 filesystem).
Freeing unused kernel memory: 188k freed
scsi 0:0:0:0: Direct-Access     Generic  Flash Disk       8.07 PQ: 0 ANSI: 2
SCSI device sda: 3964928 512-byte hdwr sectors (2030 MB)
sda: Write Protect is off
sda: assuming drive cache: write through
SCSI device sda: 3964928 512-byte hdwr sectors (2030 MB)
sda: Write Protect is off
sda: assuming drive cache: write through
 sda: sda1 sda2 sda3
sd 0:0:0:0: Attached scsi removable disk sda
sd 0:0:0:0: Attached scsi generic sg0 type 0
Using /usr/modules/net/r6040.ko
r6040: RDC R6040 net driver, version 0.13 (24Aug2006)
r6040: RDC R6040 net driver, version 0.13 (24Aug2006)
r6040: RDC R6040 net driver, version 0.13 (24Aug2006)
Using /usr/modules/vga/cfbcopyarea.ko
Using /usr/modules/vga/cfbimgblt.ko
Using /usr/modules/vga/cfbfillrect.ko
Using /usr/modules/vga/adayfb.ko
adayfb 0000:00:01.0: ADAYFB addr= f8000000
adayfb 0000:00:01.0: ADAYFB size= 200000
adayfb 0000:00:01.0: remap addr= 0xd0880000
ADAY-IO-ADDR= 2001
init_aday finish
register fb finish
adayfb 0000:00:01.0: fb0: ADAY-DV101 frame buffer (2048K RAM detected)
mknod: /dev/pm: File exists
Using /usr/modulpm: module license 'unspecified' taints kernel.
es/pm/pm.ko
/dev/sda3: recovering journal
/dev/sda3: clean, 825/3680 files, 8180/29292 blocks
kjournald starting.  Commit interval 5 seconds
EXT3 FS on sda3, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
udevd init...
smbfs: no version for "struct_module" found: kernel tainted.
Using /mnt/mtd/lib/modules/2.6.21.3/kernel/drivers/i2c/i2c-core.ko
Using /mnt/mtd/lib/modules/2.6.21.3/kernel/drivers/i2c/algos/i2c-algo-bit.ko
Using /usr/modules/i2c/aday5e_i2c.ko
Using /mnt/mtd/lib/modules/2.6.21.3/kernel/drivers/i2c/i2c-dev.ko
Mon Jun  8 21:32:00 UTC 2009
init sleep....
kjournald starting.  Commit interval 5 seconds
EXT3-fs: mounted filesystem with ordered data mode.
/dev/sda2: recovering journal
/dev/sda2: clean, 1961/122880 files, 155510/976500 blocks
kjournald starting.  Commit interval 5 seconds
EXT3 FS on sda2, internal journal
EXT3-fs: mounted filesystem with ordered data mode.

Please press Enter to activate this console. Name = 16
SIOCGIFFLAGS: No such device
info, udhcpc (v0.9.9-pre) started
eth0      Link encap:Ethernet  HWaddr 00:11:C0:F0:02:16
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:10 Base address:0xe800

debug, Sending discover...
debug, Sending discover...
Bluetooth: Core ver 2.11
NET: Registered protocol family 31
Bluetooth: HCI device and connection manager initialized
Bluetooth: HCI socket layer initialized
Bluetooth: HCI USB driver ver 2.9
usbcore: registered new interface driver hci_usb
rt73: init
rt73: idVendor = 0x7b8, idProduct = 0xb21d
/usr/X11R6/bin/startx: 129: mcookie: not found
xauth:  creating new authority file //.Xauthority
xauth:  creating new authority file //.Xauthority
Using authority file //.Xauthority
xauth: (stdin):1:  bad "add" command line
xauth:  creating new authority file //.Xauthority
xauth:  creating new authority file //.Xauthority
Using authority file //.Xauthority
xauth: (stdin):1:  bad "add" command line

rt73: Interface up for first time, activating permanent MAC
rt73: Active MAC is: 00:12:0e:92:b4:1b.
rt73: Local MAC = 00:12:0e:92:b4:1b
usbcore: registered new interface driver rt73
XFree86 Version 4.3.0.1 (Debian 4.3.0.dfsg.1-14 20050601051219 fabbione@fabbione.net)
Release Date: 15 August 2003
X Protocol Version 11, Revision 0, Release 6.6
Build Operating System: Linux 2.4.29-pre2 i686 [ELF]
Build Date: 01 June 2005

This version of XFree86 has been extensively modified by the Debian
Project, and is not supported by the XFree86 Project, Inc., in any
way.  Bugs should be reported to the Debian Bug Tracking System; see
<URL: http://www.debian.org/Bugs/Reporting >.

We strongly encourage the use of the "reportbug" package and command
to ensure that bug reports contain as much useful information as
possible.

Before filing a bug report, you may want to consult the Debian X FAQ:
       XHTML version: file:///usr/share/doc/xfree86-common/FAQ.xhtml
  plain text version: file:///usr/share/doc/xfree86-common/FAQ.gz

Module Loader present
OS Kernel: Linux version 2.6.21.3 (root@vm-db26) (gcc version 3.3.5 (Debian 1:3.3.5-13)) #8 Mon Jan 28 06:27:54 CST 2008 TF
Markers: (--) probed, (**) from config file, (==) default setting,
         (++) from command line, (!!) notice, (II) informational,
         (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/XFree86.0.log", Time: Mon Jun  8 21:32:10 2009
(==) Using config file: "/etc/X11/XF86Config"
debug, Sending discover...
Skipping "/usr/X11R6/lib/modules/fonts/libspeedo.a:spencode.o":  No symbols found
(EE) FBDEV(0): FBIOPAN_DISPLAY: Invalid argument
rt73: driver version - 1.0.3.6 CVS
cat: //.Xauthority: No such file or directory
XCIN (Chinese XIM server) version 2.5.3-pre2.
(module ver: 20010918, syscin ver: 20000210).
(use "-h" option for help)

xcin: locale "en_GB" encoding "iso-8859-1"
xcin: error: /etc/xcinrc:
        locale section "en_GB": DEFAULT_IM: value not specified.
/home/user/.webstart/theme/default/images/desktop.loading.png is 800x480 PNG image, color type RGB, 8 bit
  Zooming image by 100%...Speaker 150 unmute
done
  Merging...amixer set Speaker,0 150 unmute
done
  Building XImage...Simple mixer control 'Speaker',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 151
  Front Left: Playback 150 [99%] [on]
  Front Right: Playback 150 [99%] [on]
done
File name     : /mnt/disk/mp3/mity_start.wav
Sampling rate : 44100 Hz
Bits/Sample   : 16 Bits
Channels      : 2
Size          : 1110528 Bytes

The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Type "ONE_LEVEL" has 1 levels, but <RALT> has 2 symbols
>                   Ignoring extra symbols
Errors from xkbcomp are not fatal to the X server
No needed to update menu.
icewmtray: using //.icewm for private configuration files
IceWM: using //.icewm for private configuration files
debug, Sending discover...
enable DHCP on eth0
killall: rutilt: no process killed
cat: /etc/rutilt/config/rutilt/rutilt.default: No such file or directory
BusyBox v1.00-rc2 (2007.06.30-03:46+0000) multi-call binary

Usage: grep [-ihHnqvs] PATTERN [FILEs...]

Within Redboot, its possible to settup an ethernet connection, download a new kernel/initrd with TFTP and boot. However, I did not have any succes, since this is an old version of RedBoot, and not all RedBoot commands are supported.

Quote
Ethernet eth0: MAC address 00:00:01:02:03:04
IP: 192.168.253.10/255.255.255.0, Gateway: 192.168.253.254
Default server: 0.0.0.0

RedBoot(tm) bootstrap and debug environment [ROM]
Non-certified release, version v2_0 - built 07:54:36, Feb 10 2008

Platform: PC (I386)
Copyright (C) 2000, 2001, 2002, Red Hat, Inc.

RAM: 0x00000000-0x000f0000, 0x000726b0-0x000a0000 available
R3233    00:0012 30-12-2007
<press Ctrl+C to enter prompt mode>

RedBoot> ^C
RedBoot> help
Manage machine caches
   cache [ON | OFF]
Display/switch console channel
   channel [<channel number>]
Compute a 32bit checksum [POSIX algorithm] for a range of memory
   cksum -b <location> -l <length>
Display (hex dump) a range of memory
   dump -b <location> [-l <length>] [-s] [-1|2|4]
Execute code at a location
   go [-w <timeout>] [entry]
Help about help?
   help [<topic>]
Set/change IP addresses
   ip_address [-l <local_ip_address>] [-h <server_address>]
Execute a Linux image
   linux [-w timeout] [-b <base address> [-l <image length>]]
        [-r <ramdisk addr> [-s <ramdisk length>]]
        [-c "kernel command line"]
Load a file
   load [-r] [-v] [-h <host>] [-m <varies>] [-c <channel_number>]
        [-b <base_address>] <file_name>
Compare two blocks of memory
   mcmp -s <location> -d <location> -l <length> [-1|-2|-4]
Fill a block of memory with a pattern
   mfill -b <location> -l <length> -p <pattern> [-1|-2|-4]
Network connectivity test
   ping [-v] [-n <count>] [-l <length>] [-t <timeout>] [-r <rate>]
        [-i <IP_addr>] -h <IP_addr>
Reset the system
   reset
Display RedBoot version information
   version
Display (hex dump) a range of memory
   x -b <location> [-l <length>] [-s] [-1|2|4]
flash upgrade
   flash [-s <source>][-d <destination>][-l <image length>]
RedBoot>

Whatever you do: DON'T USE the FLASH command: you propperly brick your notebook!

Linux is booting the Kernel/Initrd from internal flash (on the cpu module i think), the initrd image contains BusyBox. Afther that, It mount the onboard solderd usb flash, and runs the applications and notebook specific notebook modules (only binary, no source!).

I'll post again when i'm any further.