Go to advanced search

by maldus
Sun Jan 13, 2019 9:13 am
Forum: Bare metal, Assembly language
Topic: mini uart transmit interrupt? ( RTEMS OS port )
Replies: 3
Views: 2238

Re: mini uart transmit interrupt? ( RTEMS OS port )

Do you know if there is a way to de-assert this interrupt ?
Did anyone ever find how to do it? The only way seems to disable it entirely...
by maldus
Thu Jan 03, 2019 5:05 pm
Forum: Bare metal, Assembly language
Topic: Question about reading the SD card and loading executables
Replies: 5
Views: 1531

Re: Question about reading the SD card and loading executables

Flat binary This is the simplest, the raw binary contains both machine code and initialized data in the file (storing rodata and bss segments and relocation records is not possible). Consider it as a combined text+data segment image. No parsing needed, but you must load the binary at a specific loc...
by maldus
Sat Dec 22, 2018 1:22 pm
Forum: Bare metal, Assembly language
Topic: Question about reading the SD card and loading executables
Replies: 5
Views: 1531

Re: Question about reading the SD card and loading executables

Hi, The best place to start to read the SD card (in my opinion at least) is bzt's examples repository: https://github.com/bztsrc/raspi3-tutorial Specifically examples number 0B, 0C and 0D. You can start pretty much immediately since integrating the sd functions is as simple as copying a single file,...
by maldus
Tue Nov 20, 2018 5:23 pm
Forum: Bare metal, Assembly language
Topic: Understanding AArch64 MMU
Replies: 11
Views: 4508

Re: Understanding AArch64 MMU

I have finally started writing some code myself and successfully activated the MMU with 4K granularity and 3 levels of indirection (the last pointing to 4K wide blocks instead of 2M ones). Everything works as long as I stay at EL1. When running at EL0 (still setting the MMU while in EL1 of course) I...
by maldus
Sun Nov 18, 2018 6:35 pm
Forum: Bare metal, Assembly language
Topic: Understanding AArch64 MMU
Replies: 11
Views: 4508

Re: Understanding AArch64 MMU

Many thanks for the clarifications; I believe I have a decent grasp on it now. Most of your last corrections were due to me not expressing my doubts properly. Some more questions: On TTBR1 it's counting bits backwards from the top starting at 0xFFFFFFFFFFFFFFFF and the address on the block is the ph...
by maldus
Sun Nov 18, 2018 8:36 am
Forum: Bare metal, Assembly language
Topic: Understanding AArch64 MMU
Replies: 11
Views: 4508

Re: Understanding AArch64 MMU

Thank you for your answer. I can confirm that I'm working in AArch64 (as the title says) and that I know AArch32 would be different. Even after looking at your code I still struggle to understand some details. So you can pretty much ignore TTBR1 at the start because you need to first deal with TTBR0...
by maldus
Sat Nov 17, 2018 4:17 pm
Forum: Bare metal, Assembly language
Topic: Understanding AArch64 MMU
Replies: 11
Views: 4508

Understanding AArch64 MMU

Hello everyone, I'm looking at https://github.com/bztsrc/raspi3-tutorial/blob/master/10_virtualmemory/mmu.c, trying to understand how the ARMv8 MMU works. I've never worked with an MMU before, even though I have a basic understanding of its principles. For reference I've been studing the ARM ARM (ht...
by maldus
Fri Nov 02, 2018 3:00 pm
Forum: Bare metal, Assembly language
Topic: Accessing stack pointer on AArch64
Replies: 3
Views: 1209

Re: Accessing stack pointer on AArch64

Using SP normally (e.g. mov X0, SP) will use the appropriate SP_ELn for exception level n unless SPSel.SP is 0 in which case SP_EL0 will be used. For some reason I was convinced sp could not be used in a normal mov operation (it is restricted I believe, but apparently not for reading). This is exac...
by maldus
Fri Nov 02, 2018 12:49 pm
Forum: Bare metal, Assembly language
Topic: Accessing stack pointer on AArch64
Replies: 3
Views: 1209

Accessing stack pointer on AArch64

Hello everyone, I need a quick confirmation. I wanted to read/write the stack pointer register while at exception level 1 with the instruction mrs x0, sp_el1 but it turns out I am unable to (a synchronous exception is fired upon executing the instruction). Is it not permitted to access directly the ...
by maldus
Sat Sep 01, 2018 7:14 am
Forum: Bare metal, Assembly language
Topic: Help understanding aarch64 interrupts
Replies: 4
Views: 1318

Re: Help understanding aarch64 interrupts

Many thanks, this is exactly what I needed.
If I understand correctly I can use whatever controller I see more fit to manage the interrupts that I need, either directly or cascated from the other (I'm going to need to check the proper cause registers)
by maldus
Fri Aug 31, 2018 10:12 am
Forum: Bare metal, Assembly language
Topic: Help understanding aarch64 interrupts
Replies: 4
Views: 1318

Help understanding aarch64 interrupts

Hello everyone, I find myself very confused about several topics concerning interrupt management on armv8. Specifically, I'm working on a bare metal OS for RPi3 on Aarch64. I've seen many examples about running interrupts for timers and UART, but I can't understand the difference between the interru...
by maldus
Tue Aug 21, 2018 2:57 pm
Forum: Bare metal, Assembly language
Topic: Is there any way to emulate timer interrupt in qemu?
Replies: 8
Views: 3185

Re: Is there any way to emulate timer interrupt in qemu?

Sorry if I barge in. I'm trying to work with raspberry pi, interrupts and Qemu as well, and I couldn't help but notice that you are talking about RPi3 while quoting a reference for the Quad-A7 core (https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2836/QA7_rev3.4.pdf). Doesn't RPi3 ...
by maldus
Thu Aug 02, 2018 8:22 pm
Forum: Bare metal, Assembly language
Topic: Yet Another Bare Metal Tutorial for the RPi3
Replies: 75
Views: 47779

Re: Yet Another Bare Metal Tutorial for the RPi3

Thank you, I'll try that asap. Meanwhile... I wrote the tutorials in a way to work on the default configuration I'm curious, could you elaborate on this? I was under the impression that config.txt was a strong requirement to boot an aarch64 kernel. What is the "default configuration" you are referri...
by maldus
Thu Aug 02, 2018 2:09 pm
Forum: Bare metal, Assembly language
Topic: Yet Another Bare Metal Tutorial for the RPi3
Replies: 75
Views: 47779

Re: Yet Another Bare Metal Tutorial for the RPi3

How should I proceed to run your examples on a real Rpi3? I'm trying with 03_uart with no success. It runs fine on qemu. This is the content of my sd card: bootcode.bin config.txt kernel8.img start.elf where kernel8.img is the example. These are the contents of config.txt arm_64bit=1 disable_command...
by maldus
Mon Jul 30, 2018 6:46 pm
Forum: Bare metal, Assembly language
Topic: Rpi zero and UART0
Replies: 4
Views: 1151

Re: Rpi zero and UART0

Thank you again for the clarification. I already knew most of the links you suggested and I was aware that raspberry pi 3 emulation (with arch64) is feasible, but I was looking for a confirmation.
by maldus
Sun Jul 29, 2018 4:05 pm
Forum: Bare metal, Assembly language
Topic: Rpi zero and UART0
Replies: 4
Views: 1151

Re: Rpi zero and UART0

If I'm not mistaken the clock rate can be read/modified using mailboxes, so I might explore in that direction. Thank you for the suggestion. Before doing that, however, I'm interested in finding out if there actually is a way to emulate a raspberry pi bare metal kernel on qemu. I've been looking aro...
by maldus
Sat Jul 28, 2018 3:28 pm
Forum: Bare metal, Assembly language
Topic: Rpi zero and UART0
Replies: 4
Views: 1151

Rpi zero and UART0

Hello everyone, I would like to run my bare metal kernel for raspberry pi zero on Qemu. If I understand correctly to receive serial output I need to use the UART0 device (opposed to the Mini UART, or UART1). I'm trying to run dwelch's UART0 https://github.com/dwelch67/raspberrypi/blob/master/uartx01...
by maldus
Fri Apr 06, 2018 10:02 am
Forum: Bare metal, Assembly language
Topic: raspberry pi zero program via USB
Replies: 7
Views: 1469

Re: raspberry pi zero program via USB

Just for completeness I'm going to share my clarifications. I was having trouble for two reasons: 1. The rpiboot tool is thought and described mainly for the compute module 2. The process to boot a custom kernel is simple but not directly documented Here's what I did: 1. Downloaded dwelch's repo for...
by maldus
Tue Apr 03, 2018 7:05 am
Forum: Bare metal, Assembly language
Topic: raspberry pi zero program via USB
Replies: 7
Views: 1469

Re: raspberry pi zero program via USB

ghans wrote:
Mon Apr 02, 2018 10:06 pm
The second link you posted yourself is full of positive testimonials of rpiboot in conjuction
with the Pi Zero ;). Just to be clear, i do not own a Pi Zero myself, i have to rely on the word of others too.

ghans
Ah yes, now I understand what they are talking about. Thanks for pointing it out!
by maldus
Mon Apr 02, 2018 4:51 pm
Forum: Bare metal, Assembly language
Topic: raspberry pi zero program via USB
Replies: 7
Views: 1469

Re: raspberry pi zero program via USB

The (standard) usbboot/rpiboot tool is being used by compute module users all the time. It seems to do exactly what you want. I don't know why it isn't more popular with Pi Zero users. Since I saw little to no reference to the pi Zero I thought it was something specific for the Compute Module. So i...
by maldus
Mon Apr 02, 2018 3:40 pm
Forum: Bare metal, Assembly language
Topic: raspberry pi zero program via USB
Replies: 7
Views: 1469

raspberry pi zero program via USB

Introduction: I am making mostly speculations at this time since I don't even have a raspberry pi zero. I have fiddled with bare metal on raspberry pi 3 and obtained a working UART. I would like to use some kind of bootloader for like many of the examples in dwelch's repository, loading the kernel t...
by maldus
Sun Dec 31, 2017 5:18 pm
Forum: Bare metal, Assembly language
Topic: malloc linker script requirements
Replies: 8
Views: 1633

Re: malloc linker script requirements

Ok, now I see what's wrong; the .map file does *not* reflect what is actually going into memory and I was missing an input section. I'll add the proper sections to my linker script, and I'll remember to check that out next time something does not work as expected.

Thank you for your patience!
by maldus
Sun Dec 31, 2017 8:20 am
Forum: Bare metal, Assembly language
Topic: malloc linker script requirements
Replies: 8
Views: 1633

Re: malloc linker script requirements

Pretty straight forward your first linker command only keeps sections that are called .data your second linker command keeps sections that are called .data or .data.* .data.__malloc_sbrk_base string matches the second wildcard .data.* it doesn't string match .data As they don't match any given sect...
by maldus
Sat Dec 30, 2017 7:59 pm
Forum: Bare metal, Assembly language
Topic: malloc linker script requirements
Replies: 8
Views: 1633

Re: malloc linker script requirements

Or I could solve my problem in the first place :) . The only significance of the script is Brian uses a label in the script for the malloc to start at after all the other stuff. Yes, I noticed that since the compilation fails if I don't add it, and you can see my linker script provides all the requi...
by maldus
Sat Dec 30, 2017 8:25 am
Forum: Bare metal, Assembly language
Topic: malloc linker script requirements
Replies: 8
Views: 1633

Re: malloc linker script requirements

I know how dynamic memory allocation works and I could add an entire implementation, I just want to keep the code as simple as possible. _sbrk is dependent on your compiler and specifically it's library. Most GCC implementations use newlib which you need to retarget. The fact you are getting the mes...

Go to advanced search