mntmn b986ab8dc6 disk writing (fat) works; pixel editor demo 9 gadi atpakaļ
..
rpi-boot-tools 62ade15fbd complete move 9 gadi atpakaļ
test_kernel 62ade15fbd complete move 9 gadi atpakaļ
MULTIBOOT-ARM 62ade15fbd complete move 9 gadi atpakaļ
Makefile 62ade15fbd complete move 9 gadi atpakaļ
Makefile.rpi-boot.in 62ade15fbd complete move 9 gadi atpakaļ
README 62ade15fbd complete move 9 gadi atpakaļ
assert.c 62ade15fbd complete move 9 gadi atpakaļ
assert.h 62ade15fbd complete move 9 gadi atpakaļ
atag.c 62ade15fbd complete move 9 gadi atpakaļ
atag.h 62ade15fbd complete move 9 gadi atpakaļ
block.c b986ab8dc6 disk writing (fat) works; pixel editor demo 9 gadi atpakaļ
block.h 62ade15fbd complete move 9 gadi atpakaļ
block_cache.c 91fb33499c soundfs initial version; new fatfs with experimental writing support 9 gadi atpakaļ
boot.s 62ade15fbd complete move 9 gadi atpakaļ
config.h 62ade15fbd complete move 9 gadi atpakaļ
console.c 62ade15fbd complete move 9 gadi atpakaļ
console.h 62ade15fbd complete move 9 gadi atpakaļ
crc32.c 62ade15fbd complete move 9 gadi atpakaļ
crc32.h 62ade15fbd complete move 9 gadi atpakaļ
ctype.c 62ade15fbd complete move 9 gadi atpakaļ
ctype.h 62ade15fbd complete move 9 gadi atpakaļ
dirent.h 62ade15fbd complete move 9 gadi atpakaļ
dwc_usb.c 62ade15fbd complete move 9 gadi atpakaļ
dwc_usb.h 62ade15fbd complete move 9 gadi atpakaļ
elf.c 62ade15fbd complete move 9 gadi atpakaļ
elf.h 62ade15fbd complete move 9 gadi atpakaļ
emmc.c b986ab8dc6 disk writing (fat) works; pixel editor demo 9 gadi atpakaļ
errno.h 62ade15fbd complete move 9 gadi atpakaļ
ext2.c 62ade15fbd complete move 9 gadi atpakaļ
fat.c f3c8e9a6b4 uartkeys fs, crash fix in reader, arm shifting fixes 9 gadi atpakaļ
fb.c 62ade15fbd complete move 9 gadi atpakaļ
fb.h 62ade15fbd complete move 9 gadi atpakaļ
font.c 62ade15fbd complete move 9 gadi atpakaļ
fs.h 07ec8c3a07 device changes brought back; rpi fs + eval working 9 gadi atpakaļ
heap.c 62ade15fbd complete move 9 gadi atpakaļ
libfs.c 07ec8c3a07 device changes brought back; rpi fs + eval working 9 gadi atpakaļ
linker-qemu.ld 62ade15fbd complete move 9 gadi atpakaļ
linker.ld 62ade15fbd complete move 9 gadi atpakaļ
log.c 62ade15fbd complete move 9 gadi atpakaļ
log.h 62ade15fbd complete move 9 gadi atpakaļ
main.c 62ade15fbd complete move 9 gadi atpakaļ
mbox.c 62ade15fbd complete move 9 gadi atpakaļ
mbox.h 07ec8c3a07 device changes brought back; rpi fs + eval working 9 gadi atpakaļ
mbr.c 07ec8c3a07 device changes brought back; rpi fs + eval working 9 gadi atpakaļ
memchunk.c 62ade15fbd complete move 9 gadi atpakaļ
memchunk.h 62ade15fbd complete move 9 gadi atpakaļ
mksdimg.sh 62ade15fbd complete move 9 gadi atpakaļ
mmio.c 62ade15fbd complete move 9 gadi atpakaļ
mmio.h 62ade15fbd complete move 9 gadi atpakaļ
multiboot.c 62ade15fbd complete move 9 gadi atpakaļ
multiboot.h 62ade15fbd complete move 9 gadi atpakaļ
nofs.c 62ade15fbd complete move 9 gadi atpakaļ
output.c 62ade15fbd complete move 9 gadi atpakaļ
output.h 62ade15fbd complete move 9 gadi atpakaļ
printf.c 62ade15fbd complete move 9 gadi atpakaļ
ramdisk.c 62ade15fbd complete move 9 gadi atpakaļ
raspbootin-server.c 62ade15fbd complete move 9 gadi atpakaļ
raspbootin.c 62ade15fbd complete move 9 gadi atpakaļ
raspbootin.h 62ade15fbd complete move 9 gadi atpakaļ
stdio.c 62ade15fbd complete move 9 gadi atpakaļ
stdio.h 62ade15fbd complete move 9 gadi atpakaļ
stdlib.c 62ade15fbd complete move 9 gadi atpakaļ
stdlib.h 62ade15fbd complete move 9 gadi atpakaļ
stream.c 62ade15fbd complete move 9 gadi atpakaļ
string.h 62ade15fbd complete move 9 gadi atpakaļ
strtol.c 62ade15fbd complete move 9 gadi atpakaļ
strtoll.c 62ade15fbd complete move 9 gadi atpakaļ
timer.c 62ade15fbd complete move 9 gadi atpakaļ
timer.h 62ade15fbd complete move 9 gadi atpakaļ
uart.c 62ade15fbd complete move 9 gadi atpakaļ
uart.h 62ade15fbd complete move 9 gadi atpakaļ
usb.h 62ade15fbd complete move 9 gadi atpakaļ
util.h 62ade15fbd complete move 9 gadi atpakaļ
vfs.c 62ade15fbd complete move 9 gadi atpakaļ
vfs.h 07ec8c3a07 device changes brought back; rpi fs + eval working 9 gadi atpakaļ

README

rpi-boot
--------

A simple second stage boot loader for the Raspberry Pi to assist in the
development of hobby kernels.


Features
--------

* Supports booting flat binary files, ELF executables and ELF and a.out
executables with a Multiboot header. Linux kernels are currently not
supported (but support is planned for a future version).

* Supports FAT(16/32) and ext2 filesystems.

* Supports loading additional modules when in Multiboot mode.

* Proviedes functions to the loaded kernel to allow it to easily
access the framebuffer (via a printf() interface) and the filesystem
(via fopen/fread/fclose/opendir/readdir/closedir).


Installation
------------

Edit config.h to your needs to enable/disable certain functionality.

Run make in the source directory and copy the kernel.img file to the SD card
containing your Raspian distribution. You are recommended to backup your
original kernel.img file first.


Usage
-----

The rpi-boot bootloader will initially search for files called
/boot/rpi_boot.cfg, /boot/rpi-boot.cfg and /boot/grub/grub.cfg (in that order)
on the first partition of the SD card. If one is not found, it searches for
those files on each filesystem known to the system.

It understands the following commands:

multiboot [cmdline]
- Load a multiboot compliant kernel

module [name]
- Load an additional Multiboot module

kernel
- Load a non-multiboot compliant kernel

boot
- Boot the kernel

binary_load_addr
- Set the load address for a flat binary file subsequently loaded by the
'kernel' command

entry_addr
- Set the entry point that is jumped to by a subsequent 'boot' command

console_log [+] [buffer_size]
- Copy the console log to a file. If '+' is specified after the file name
then append to the file instead of overwriting it. If 'buffer_size'
is specified then it is the number of bytes to buffer before writing
to the file. This prevents the log quickly using up all the write
cycles on solid state media, but runs the risk of some messages being
lost on a kernel crash. Call fflush(get_log_file()) from the guest
OS to manually flush the buffer. Support for console_log requires
that ENABLE_CONSOLE_LOGFILE be enabled in config.h


System state on kernel start
----------------------------

For Multiboot kernels, the system state is defined in MULTIBOOT-ARM, otherwise:

r0 will be 0
r1 will be the ARM machine type
r2 will be the address of the ATAGs

(the above 3 are identical to the ARM Linux boot protocol)

r3 will be the address of the multiboot_arm_functions structure as defined in
MULTIBOOT-ARM.

See the test-kernel directory for an example.


Caveats
-------

rpi-boot occupies the first 1 MiB of memory for itself. If you wish to make
use of the multiboot_arm_functions functions you need to preserve this. If
not you can overwrite it from within your kernel. If you do overwrite it,
you should make sure you have already obtained all the information you need
from the various Multiboot structures (or copied them elsewhere).

Because of this, rpi-boot will not boot kernels which are linked below 1 MiB.