OSDev.org
https://forum.osdev.org/

Raspberry Pi 1 Bare Bones & QEMU
https://forum.osdev.org/viewtopic.php?f=8&t=36328
Page 1 of 1

Author:  jbltx [ Sat Nov 30, 2019 5:20 pm ]
Post subject:  Raspberry Pi 1 Bare Bones & QEMU

Hello,

I just read the tutorial about Raspberry Pi Bare Bones : https://wiki.osdev.org/Raspberry_Pi_Bare_Bones#Pi_Model_A.2C_B.2C_A.2B.2C_B.2B.2C_and_Zero
I was wondering if the code is up-to-date for BCM2835 (arm11) ? Because I can't get it working on QEMU.

My steps :
- Create kernel.c, boot.S and linker.ld
- Change in kernel.c -> GPIO_BASE = 0x20200000
- Change in kernel.c -> UART0_BASE = (GPIO_BASE + 0x1000)
- Check linker.ld's LOADER_ADDR is equal to 0x8000
- Check boot.S' stack setup is using #0x8000

Build :
Code:
arm-none-eabi-gcc -mcpu=arm1176jzf-s -fpic -ffreestanding -std=gnu99 -c kernel.c -o kernel.o -O2 -Wall -Wextra
arm-none-eabi-gcc -mcpu=arm1176jzf-s -fpic -ffreestanding -c boot.S -o boot.o
arm-none-eabi-gcc -T linker.ld -o myos.elf -ffreestanding -O2 -nostdlib boot.o kernel.o -lgcc


Test :
Code:
qemu-system-arm -m 256  -M versatilepb -cpu arm1176 -serial stdio -kernel myos.elf


There's no output in stdio, it just hangs.
The version of GCC is 9.2.1 (20191025).

I was able to make it work for raspberry Pi 2 and 3, but not for the first one. That's unfortunate because I have a Pi Zero which uses the same architecture as the first Pi...

Thank you.

Author:  Velko [ Mon Dec 02, 2019 6:27 am ]
Post subject:  Re: Raspberry Pi 1 Bare Bones & QEMU

Have you tried to run it on a real RPi ?

It looks like you're launching Qemu specifying VersatilePB board, which (most likely) has different I/O addresses.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/