Go to advanced search

by lpoulain
Wed Jul 03, 2019 8:49 pm
Forum: Bare metal, Assembly language
Topic: How to access RAM and WIFI Bluetooth
Replies: 11
Views: 401

Re: How to access RAM and WIFI Bluetooth

It's definitely possible to start a hobby operating system on a RPi (that's what I'm doing right now), but you have to know you won't create a new Linux anytime soon and accept that your OS will be very humble. There are several tutorials out there that show how to set the display resolution, print ...
by lpoulain
Wed Jul 03, 2019 12:36 am
Forum: Bare metal, Assembly language
Topic: Raspbery Pi 3 Undefined instruction
Replies: 11
Views: 441

Re: Raspbery Pi 3 Undefined instruction

You might want to test your handler by causing an exception (like accessing a non-mapped address)

Otherwise you can find examples of handler on https://github.com/bztsrc/raspi3-tutori ... exceptions or https://github.com/LdB-ECM/Raspberry-Pi ... 3Interrupt
by lpoulain
Tue Jul 02, 2019 1:34 am
Forum: Bare metal, Assembly language
Topic: Raspbery Pi 3 Undefined instruction
Replies: 11
Views: 441

Re: Raspbery Pi 3 Undefined instruction

The ELR is the address where it crashes. And 0x200 seems too low for the code. Which would explain the "undefined instruction" if somehow the CPU's instruction pointer register is redirected to an invalid address. One possible root cause would be stack corruption caused by a wild write (which are a ...
by lpoulain
Fri Jun 28, 2019 7:02 pm
Forum: Bare metal, Assembly language
Topic: Raspberry Pi 4
Replies: 46
Views: 4142

Re: Raspberry Pi 4

That's a great description of OOO CPU operation. What I meant was more simple. If CPU X produces 5 watts of heat and runs a task in 10 minutes (say) and CPU Y produces 10 watts of heat and runs the same task in 5 minutes. Same heat output in joules. I guess thermal inertia will affect the real rise...
by lpoulain
Fri Jun 28, 2019 5:28 pm
Forum: Bare metal, Assembly language
Topic: Raspberry Pi 4
Replies: 46
Views: 4142

Re: Raspberry Pi 4

But the Pi4 gets it done in less time? Correct, because it's working more intelligently and thus not waiting as much for data from RAM. Think of two cooks in a kitchen following the exact same recipe: Cook #1 follows the recipe by the letter. If the recipe says to cook something in the oven for 30 ...
by lpoulain
Fri Jun 28, 2019 1:20 pm
Forum: Bare metal, Assembly language
Topic: Raspberry Pi 4
Replies: 46
Views: 4142

Re: Raspberry Pi 4

So probably the Pi4 will be cooler as the Pi3 has to work harder doing that browser stuff? Actually it's the other way around. The reason why the Cortex A72 (used in the RPi 4) is more performant than the Cortex A53 (used in the RPi 3) is because it is using out-of-order processing and branch predi...
by lpoulain
Fri Jun 28, 2019 2:25 am
Forum: Bare metal, Assembly language
Topic: Raspberry Pi 4
Replies: 46
Views: 4142

Re: Raspberry Pi 4

I heard that the Pi 4 generates much more heat than the Pi 3. I am curious to hear what people who have used both are saying.
by lpoulain
Wed Jun 26, 2019 4:49 pm
Forum: Bare metal, Assembly language
Topic: Build OS for rpi0
Replies: 5
Views: 462

Re: Build OS for rpi0

There are several ways you can get around this:
by lpoulain
Wed Jun 26, 2019 11:54 am
Forum: Bare metal, Assembly language
Topic: Build OS for rpi0
Replies: 5
Views: 462

Re: Build OS for rpi0

My advise is: start small and go incremental. Don't try to build a new Linux off the bat. Start with something that prints "Hello World". Then can you use graphics? Then can you implement interrupts? etc. Look for bare metal examples you can find on Github, understand them and tweak them. Also, http...
by lpoulain
Wed Jun 26, 2019 11:48 am
Forum: Bare metal, Assembly language
Topic: Raspberry Pi 4
Replies: 46
Views: 4142

Re: Raspberry Pi 4

Thanks, that's very kind of you! Unfortunately my PP account has been hacked as part of the scientologiest's "fair game", and I asked PP to block it for good. But thanks anyway, I appreciate your offer! Cheers, bzt That's too bad. If you can think of any other way let me know. And if it wasn't obvi...
by lpoulain
Wed Jun 26, 2019 1:44 am
Forum: Bare metal, Assembly language
Topic: Raspberry Pi 4
Replies: 46
Views: 4142

Re: Raspberry Pi 4

@bzt, @LdB, If that is OK with you, I would like to buy a RPi 4 for each of you. Not only both of you have great Rapsberry Pi tutorials on GitHub, but you seem to be two of the most prolific contributors on this forum. If you have a PayPal account I can send you the money (if you promise to use it t...
by lpoulain
Sun Jun 23, 2019 1:23 am
Forum: Bare metal, Assembly language
Topic: Loading DWARF info in the kernel memory
Replies: 3
Views: 482

Re: Loading DWARF info in the kernel memory

After some further coding, I found that the DWARF generated code is slightly different than what is expected. > aarch64-none-elf-readelf -wi kernel8.elf Contents of the .debug_info section: Compilation Unit @ offset 0x0: Length: 0x1e (32-bit) Version: 2 Abbrev Offset: 0x38c1e0 Pointer Size: 8 readel...
by lpoulain
Sun Jun 23, 2019 1:13 am
Forum: Bare metal, Assembly language
Topic: writing to terminal using gpu and asm
Replies: 8
Views: 1062

Re: writing to terminal using gpu and asm

The closest I can think of is the samples on https://github.com/bztsrc/raspi3-tutorial . Granted, they are using C instead of assembly, but you will find how to print to UART (05_uart0) and on the screen (0A_pcscreenfont) For the rest, any specific reason why you want to use assembly only? It's gene...
by lpoulain
Mon Jun 17, 2019 12:00 am
Forum: Bare metal, Assembly language
Topic: Loading DWARF info in the kernel memory
Replies: 3
Views: 482

Re: Loading DWARF info in the kernel memory

Thanks, it seems to work. Next step is to adapt my old code to read the DWARF info.
by lpoulain
Sun Jun 16, 2019 11:59 pm
Forum: Bare metal, Assembly language
Topic: Unexpected behaviour of arrays and switch statements
Replies: 10
Views: 785

Re: Unexpected behaviour of arrays and switch statements

What happens if you try the following scenarios: drawNum(&display, 0xFFFF0000); int cols[0] = { 0x1234ABCD }; drawNum(&display, cols[0]); Other things you can try: If you are using UART, print the array numbers there at various point of your program to see if they are defined properly at one point P...
by lpoulain
Sun Jun 16, 2019 4:37 am
Forum: Bare metal, Assembly language
Topic: Unexpected behaviour of arrays and switch statements
Replies: 10
Views: 785

Re: Unexpected behaviour of arrays and switch statements

One thing I notice is that you are using an int type (so signed integers), but have numbers in your array which are negative numbers. You might want to use unsigned integers instead.
by lpoulain
Sat Jun 15, 2019 4:17 am
Forum: Bare metal, Assembly language
Topic: Loading DWARF info in the kernel memory
Replies: 3
Views: 482

Loading DWARF info in the kernel memory

All, Does anybody know how to load debugging information in the kernel memory? I built my kernel to have debugging information, and running aarch64-none-elf-objdump --debugging kernel8.elf does display the DWARF information (.debug_str, .debug_abbrev, etc.) However, when loading the kernel, I cannot...
by lpoulain
Thu Jun 06, 2019 1:44 am
Forum: Bare metal, Assembly language
Topic: STICKY: Bare Metal resources
Replies: 26
Views: 106265

Re: STICKY: Bare Metal resources

As part of writing my own OS for RPi, I am interested in bare metal resources, but am also ready to contribute. Code samples are very useful, but sometimes you want a detailed explanation about how a particular piece of code is working, or how a particular piece of the RPi architecture works. I star...
by lpoulain
Sun Jun 02, 2019 3:54 pm
Forum: Bare metal, Assembly language
Topic: Loading the kernel without the SD card
Replies: 5
Views: 1729

Re: Loading the kernel without the SD card

If I connect the cable and open a terminal in the Raspbootin Java client, I see the UART output from the kernel. But sending characters is a good idea, I'll try that.
by lpoulain
Thu May 30, 2019 11:56 am
Forum: Bare metal, Assembly language
Topic: Loading the kernel without the SD card
Replies: 5
Views: 1729

Re: Loading the kernel without the SD card

My kernel works. When I install it on the SD card itself it is running properly. I also tried other kernels from other people that work, with the same result.
by lpoulain
Thu May 30, 2019 12:22 am
Forum: Bare metal, Assembly language
Topic: Loading the kernel without the SD card
Replies: 5
Views: 1729

Loading the kernel without the SD card

All, I've been trying to load my kernel without constantly updating the SD card, so far to no avail: I connected my RPi to my computer using a USB/TTL cable. Using the Raspbootin Java client from https://github.com/milanvidakovic/Raspbootin64Client and opening a terminal, I was able to catch the UAR...
by lpoulain
Tue May 21, 2019 2:23 am
Forum: Bare metal, Assembly language
Topic: FPU and Timer on RPi3 / Aarch64
Replies: 4
Views: 495

Re: FPU and Timer on RPi3 / Aarch64

If I copy the .S file (and associated .ld file) as is, then it works. OK, the timer doesn't work yet, but I run in EL1, get interrupt handling and can use the FPU. Thanks a lot.

Now, my next step is to try to understand the code ;-)
by lpoulain
Tue May 21, 2019 12:37 am
Forum: Bare metal, Assembly language
Topic: FPU and Timer on RPi3 / Aarch64
Replies: 4
Views: 495

Re: FPU and Timer on RPi3 / Aarch64

Thank you for your response. I tried adding both code sniplets in my start.S, but it's still starting in EL2. Am I missing something? As far as stacks, I set sp to _start]. I understand I will need to setup other stacks once I implement multiple processes (I wrote my hobby OS for x86 in the past so ...
by lpoulain
Mon May 20, 2019 1:35 am
Forum: Bare metal, Assembly language
Topic: FPU and Timer on RPi3 / Aarch64
Replies: 4
Views: 495

FPU and Timer on RPi3 / Aarch64

Hello all, I am trying to use both the FPU and a timer, but cannot get everything to work despite reading previous responses on these forums. My environment: emulating a RPi3 using QEMU and compiling with Aarch64. By default the Pi starts in EL2 (hypervisor mode). In this mode I can use the FPU, but...

Go to advanced search