OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 4:52 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Raspberry Pi 1 Bare Bones & QEMU
PostPosted: Sat Nov 30, 2019 5:20 pm 
Offline

Joined: Sat Nov 30, 2019 4:53 pm
Posts: 1
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.


Top
 Profile  
 
 Post subject: Re: Raspberry Pi 1 Bare Bones & QEMU
PostPosted: Mon Dec 02, 2019 6:27 am 
Offline
Member
Member
User avatar

Joined: Fri Oct 03, 2008 4:13 am
Posts: 153
Location: Ogre, Latvia, EU
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.

_________________
If something looks overcomplicated, most likely it is.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 20 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group