Skip to content

Instantly share code, notes, and snippets.

@hak8or
Created March 24, 2015 20:43
Show Gist options
  • Select an option

  • Save hak8or/a11baa267f64a16840a5 to your computer and use it in GitHub Desktop.

Select an option

Save hak8or/a11baa267f64a16840a5 to your computer and use it in GitHub Desktop.
Boosh, gcc compiles on my board
RomBOOT
==============================
Using Dataflash!
ba_offset = 0xb ...
AT91Bootstrap 3.7.1-00054-gef803bb-dirty (Sun Mar 15 19:00:41 PDT 2015)
Edited by hak8or!
Yey custom code execution and toolchain verification! :D
======--======--======--======
MASTER_CLOCK (MCLK): 0x5f5e100
SPI clock rate requested: 0xa1220
scbr: 0x97
SF: Got Manufacturer and Device ID:0x1f 0x25 0x0 0x1 0x0
SF: Copy 0x55500 bytes from 0x8400 to 0x20008400
SF: Done loading image from SerialFlash
Jumping to JUMP_ADDR (0x20008400) ...
U-Boot 2014.07-00058-gb44bde2-dirty (Mar 23 2015 - 01:35:56)
CPU: AT91SAM9N12
Crystal frequency: 16 MHz
CPU clock : 301.333 MHz
Master clock : 100.444 MHz
DRAM: 64 MiB
WARNING: Caches not enabled
NAND: atmel_nand: Fail to initialize #0 chip0 MiB
MMC: mci: 0
** Bad device usb 0 **
Using default environment
In: serial
Out: serial
Err: serial
Net: ks8851_mll: Invalid chip id 0x30c0
Board Net Initialization Failed
No ethernet found.
Hit any key to stop autoboot: 0
(Re)start USB...
USB0: scanning bus 0 for devices... ERROR: USB-error: DEVICENOTRESPONDING: Device did not respond to token (IN) or did
not provide a handshake (OUT) (5)
ERROR: USB-error: DEVICENOTRESPONDING: Device did not respond to token (IN) or did
not provide a handshake (OUT) (5)
1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
** Bad device usb 0 **
Wrong Image Format for bootm command
ERROR: can't get kernel image!
U-Boot> usb reset
(Re)start USB...
USB0: scanning bus 0 for devices... 2 USB Device(s) found
scanning usb for storage devices... 1 Storage Device(s) found
U-Boot> fatload usb 0:1 0x20000000 uimage.bin
reading uimage.bin
1515300 bytes read in 4075 ms (362.3 KiB/s)
U-Boot> bootm
## Booting kernel from Legacy Image at 20000000 ...
Image Name: linux-2.6
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1515236 Bytes = 1.4 MiB
Load Address: 20008000
Entry Point: 20008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
Starting kernel ...
Uncompressing Linux... done, booting the kernel.
Linux version 2.6.39 (hak8or@ubuntu) (gcc version 4.8.3 20140320 (prerelease) (Sourcery CodeBench Lite 2014.05-29) ) #5 Mon Mar 16 07:24:35 EDT 2015
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: Atmel AT91SAM9N12-EK
Memory policy: ECC disabled, Data cache writeback
Clocks: CPU 301 MHz, master 100 MHz, main 16.000 MHz
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256
Kernel command line: console=ttyS0,115200 root=/dev/sda2 rootwait rw rootfstype=ext2 init=/bin/init
PID hash table entries: 256 (order: -2, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 64MB = 64MB total
Memory: 61728k/61728k available, 3808k reserved, 0K highmem
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
DMA : 0xff000000 - 0xffe00000 ( 14 MB)
vmalloc : 0xc4800000 - 0xfee00000 ( 934 MB)
lowmem : 0xc0000000 - 0xc4000000 ( 64 MB)
modules : 0xbf000000 - 0xc0000000 ( 16 MB)
.init : 0xc0008000 - 0xc0027000 ( 124 kB)
.text : 0xc0027000 - 0xc02de000 (2780 kB)
.data : 0xc02de000 - 0xc02fcac0 ( 123 kB)
NR_IRQS:192
AT91: 128 gpio irqs in 4 banks
Console: colour dummy device 80x30
console [ttyS0] enabled
Calibrating delay loop... 149.91 BogoMIPS (lpj=749568)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
AT91: Power Management (with slow clock mode)
AT91: Starting after power-restored wakeup
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
i2c-gpio i2c-gpio.0: using pins 62 (SDA) and 63 (SCL)
at_hdmac at_hdmac.0: Atmel AHB DMA Controller ( cpy slave ), 8 channels
Advanced Linux Sound Architecture Driver Version 1.0.24.
Switching to clocksource tcb_clksrc
NetWinder Floating Point Emulator V0.97 (double precision)
JFFS2 version 2.2. (NAND) (SUMMARY) © 2001-2006 Red Hat, Inc.
msgmni has been set to 120
io scheduler noop registered (default)
atmel_hlcdfb atmel_hlcdfb_base.0: 510KiB frame buffer at 23980000 (mapped at ffd80000)
Console: switching to colour frame buffer device 60x34
atmel_hlcdfb atmel_hlcdfb_base.0: fb0: Atmel LCDC at 0xf8038000 (mapped at c486e000), irq 25
atmel_usart.0: ttyS0 at MMIO 0xfefff200 (irq = 1) is a ATMEL_SERIAL
brd: module loaded
loop: module loaded
ssc ssc.0: Atmel SSC device at 0xc4878000 (irq 28)
atmel_nand atmel_nand: Using dma0chan0 for DMA transfers.
nand_get_flash_type: second ID read did not match 30,30 against ff,00
No NAND device found.
atmel_spi atmel_spi.0: Using dma0chan0 (tx) and dma0chan1 (rx) for DMA transfers
atmel_spi atmel_spi.0: Atmel SPI Controller at 0xf0000000 (irq 13)
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
at91_ohci at91_ohci: AT91 OHCI
at91_ohci at91_ohci: new USB bus registered, assigned bus number 1
at91_ohci at91_ohci: irq 22, io mem 0x00500000
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usbcore: registered new interface driver libusual
udc: at91_udc version 3 May 2006
mousedev: PS/2 mouse device common for all mice
input: gpio-keys as /devices/platform/gpio-keys/input/input0
qt1070 0-001b: can not read register, returned -6
qt1070 0-001b: ID -6 not supported
atmel_tsadcc atmel_tsadcc: Master clock is set at: 100444438 Hz
atmel_tsadcc atmel_tsadcc: Prescaler is set at: 166
input: atmel touch screen controller as /devices/platform/atmel_tsadcc/input/input1
at91_rtc at91_rtc: rtc core: registered at91_rtc as rtc0
AT91 Real Time Clock driver.
i2c /dev entries driver
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
ASoC: Setting pck0 to 32768Hz
wm8904-codec 0-001a: i2c_transfer() returned -6
wm8904-codec 0-001a: Device is not a WM8904, ID is 0
wm8904-codec 0-001a: asoc: failed to probe CODEC wm8904-codec.0-001a: -22
asoc: failed to instantiate card WM8904 @ AT91SAM9N12: -22
ASoC: at91sam9n12_init ok
ALSA device list:
No soundcards found.
at91_rtc at91_rtc: setting system clock to 2007-01-01 00:26:24 UTC (1167611184)
atmel_mci atmel_mci.0: Using dma0chan2 for DMA transfers
atmel_mci atmel_mci.0: Atmel MCI controller at 0xf0008000 irq 12, 1 slots
Waiting for root device /dev/sda2...
usb 1-1: new full speed USB device number 2 using at91_ohci
scsi0 : usb-storage 1-1:1.0
scsi 0:0:0:0: Direct-Access OCZ DIESEL PMAP PQ: 0 ANSI: 0 CCS
sd 0:0:0:0: [sda] 31326208 512-byte logical blocks: (16.0 GB/14.9 GiB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Assuming drive cache: write through
sd 0:0:0:0: [sda] Assuming drive cache: write through
sda: detected capacity change from 0 to 16039018496
sda: sda1 sda2
sd 0:0:0:0: [sda] Assuming drive cache: write through
sd 0:0:0:0: [sda] Attached SCSI removable disk
EXT2-fs (sda2): warning: mounting unchecked fs, running e2fsck is recommended
VFS: Mounted root (ext2 filesystem) on device 8:2.
Freeing init memory: 124K
/bin/sh: can't access tty; job control turned off
/ # ls
bin etc linuxrc proc sys
dev lib mnt sbin usr
/ # cd usr/home/
/usr/home # ls
arm-unknown-linux-gnueabi cross_tool_bins hello_world
/usr/home # cd cross_tool_bins/
/usr/home/cross_tool_bins # ls
Sodoku_crosstools_dyn hello_cross_tool_dyn
Sodoku_crosstools_stat hello_cross_tool_static
/usr/home/cross_tool_bins # ./hello_cross_tool_static
Hello world! :D
/usr/home/cross_tool_bins # ./hello_cross_tool_dyn
Hello world! :D
/usr/home/cross_tool_bins # ./Sodoku_crosstools_dyn
Running self tests ...
All tests passed (69 assertions in 18 test cases)
Size of Sodoku puzzle: 2
This is your empty sodoku puzzle.
| . . |
| . . |
Lets fill 25% of it with some random yet valid starting cells.
NOTE:
Partial fill does not guarantee to supply a valid puzzle. This loop will try to find a solvable partially filled puzzle by trying to actually solve it and if it can't solve it, then it partially fills it again.
Partially pre-filled puzzle.
| . . |
| . 0 |
Solved puzzle
| 0 1 |
| 1 0 |
# of times a value was tried per cell.
| 1 2 |
| 2 0 |
Whew! That took 5 steps!
/usr/home/cross_tool_bins # cd ..
/usr/home # ls
arm-unknown-linux-gnueabi cross_tool_bins hello_world
/usr/home # cd arm-unknown-linux-gnueabi/
/usr/home/arm-unknown-linux-gnueabi # ls
arm-unknown-linux-gnueabi include share
bin lib
build.log.bz2 libexec
/usr/home/arm-unknown-linux-gnueabi # cd bin/
/usr/home/arm-unknown-linux-gnueabi/bin # ls
arm-unknown-linux-gnueabi-addr2line arm-unknown-linux-gnueabi-gcov
arm-unknown-linux-gnueabi-ar arm-unknown-linux-gnueabi-gprof
arm-unknown-linux-gnueabi-as arm-unknown-linux-gnueabi-ld
arm-unknown-linux-gnueabi-c++ arm-unknown-linux-gnueabi-ld.bfd
arm-unknown-linux-gnueabi-c++filt arm-unknown-linux-gnueabi-ldd
arm-unknown-linux-gnueabi-cc arm-unknown-linux-gnueabi-nm
arm-unknown-linux-gnueabi-cpp arm-unknown-linux-gnueabi-objcopy
arm-unknown-linux-gnueabi-ct-ng.config arm-unknown-linux-gnueabi-objdump
arm-unknown-linux-gnueabi-elfedit arm-unknown-linux-gnueabi-populate
arm-unknown-linux-gnueabi-g++ arm-unknown-linux-gnueabi-ranlib
arm-unknown-linux-gnueabi-gcc arm-unknown-linux-gnueabi-readelf
arm-unknown-linux-gnueabi-gcc-4.8.3 arm-unknown-linux-gnueabi-size
arm-unknown-linux-gnueabi-gcc-ar arm-unknown-linux-gnueabi-strings
arm-unknown-linux-gnueabi-gcc-nm arm-unknown-linux-gnueabi-strip
arm-unknown-linux-gnueabi-gcc-ranlib
/usr/home/arm-unknown-linux-gnueabi/bin # ./arm-unknown-linux-gnueabi-g++ -v
Using built-in specs.
COLLECT_GCC=./arm-unknown-linux-gnueabi-g++
COLLECT_LTO_WRAPPER=/usr/home/arm-unknown-linux-gnueabi/bin/../libexec/gcc/arm-unknown-linux-gnueabi/4.8.3/lto-wrapper
Target: arm-unknown-linux-gnueabi
Configured with: /home/hak8or/Desktop/toolchain_setup/crosstool-ng-crosstool-ng-1.20.0/.build/src/gcc-4.8.3/configure --build=x86_64-build_unknown-linux-gnu --host=arm-host_unknown-linux-gnueabi --target=arm-unknown-linux-gnueabi --prefix=/home/hak8or/cross-native-toolchain/arm-unknown-linux-gnueabi --with-sysroot=/home/hak8or/cross-native-toolchain/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sysroot --enable-languages=c,c++ --with-pkgversion='crosstool-NG 1.20.0' --enable-__cxa_atexit --disable-libmudflap --disable-libgomp --disable-libssp --disable-libquadmath --disable-libquadmath-support --disable-libsanitizer --with-gmp=/home/hak8or/Desktop/toolchain_setup/crosstool-ng-crosstool-ng-1.20.0/.build/arm-unknown-linux-gnueabi/buildtools/complibs-host --with-mpfr=/home/hak8or/Desktop/toolchain_setup/crosstool-ng-crosstool-ng-1.20.0/.build/arm-unknown-linux-gnueabi/buildtools/complibs-host --with-mpc=/home/hak8or/Desktop/toolchain_setup/crosstool-ng-crosstool-ng-1.20.0/.build/arm-unknown-linux-gnueabi/buildtools/complibs-host --with-ppl=no --with-isl=no --with-cloog=no --with-libelf=no --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++ -lm' --enable-threads=posix --disable-nls --disable-multilib --with-local-prefix=/home/hak8or/cross-native-toolchain/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sysroot --enable-c99 --enable-long-long
Thread model: posix
gcc version 4.8.3 (crosstool-NG 1.20.0)
/usr/home/arm-unknown-linux-gnueabi/bin # cd ..
/usr/home/arm-unknown-linux-gnueabi # cd ..
/usr/home # cd hello_world/
/usr/home/hello_world # ls
main.cpp
/usr/home/hello_world # cat main.cpp
#include <iostream>
int main(void) {
std::cout << "Hello World! :o\n";
return 0;
}
/usr/home/hello_world # ../arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnuea
bi-g++ main.cpp
/usr/home/hello_world # ./a.out
Hello World! :o
/usr/home/hello_world # cd /proc/
/proc # cat cpuinfo
Processor : ARM926EJ-S rev 5 (v5l)
BogoMIPS : 149.91
Features : swp half thumb fastmult edsp java
CPU implementer : 0x41
CPU architecture: 5TEJ
CPU variant : 0x0
CPU part : 0x926
CPU revision : 5
Hardware : Atmel AT91SAM9N12-EK
Revision : 0000
Serial : 0000000000000000
/proc # echo "\n\tWhat whaatt :D :D :D"
\n\tWhat whaatt :D :D :D
/proc # echo -e "\n\tWhat whaatt :D :D :D"
What whaatt :D :D :D
/proc #
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment