Go to advanced search

by LdB
Fri Feb 15, 2019 7:28 am
Forum: Bare metal, Assembly language
Topic: Mini UART eats some characters
Replies: 8
Views: 119

Re: Mini UART eats some characters

The only part you got wrong was missing out the roll of the bootstubs The initial parts of the GPU boot are correct but you miss that the ARM starts at 0x0 but the GPU positions a bootstub that runs on entry .. the bootstub code is open source and in the user library https://github.com/raspberrypi/t...
by LdB
Thu Feb 14, 2019 4:33 pm
Forum: Bare metal, Assembly language
Topic: Mini UART eats some characters
Replies: 8
Views: 119

Re: Mini UART eats some characters

If you turn the optimizer on I expect half your status code will probably optimize away. Think very carefully about this code when probably inlined and optimized in the loop shown next. int uart_canwrite(void) { const uint32_t value = mem_read32(BASE_ADDR + AUX_MU_LSR_REG); return (value & 0x20) != ...
by LdB
Thu Feb 14, 2019 1:37 am
Forum: Bare metal, Assembly language
Topic: Bare Metal - Blinking an LED
Replies: 37
Views: 924

Re: Bare Metal - Blinking an LED

Open a github account or similar and throw your work directory up .. be much easier if I could see everything to advise you.
by LdB
Wed Feb 13, 2019 3:06 pm
Forum: Bare metal, Assembly language
Topic: DMA Transfers
Replies: 7
Views: 2836

Re: DMA Transfers

Don't apologize we can see what you are trying to do and yes that page shows the alias to a coherent block. Looking at the linux driver it seems to do something similar to create a buffer address from a bus address buf = dma_alloc_coherent(fw->cl.dev, PAGE_ALIGN(size), &bus_addr, GFP_ATOMIC); . Howe...
by LdB
Wed Feb 13, 2019 4:54 am
Forum: Bare metal, Assembly language
Topic: Spider-OS a new operating system
Replies: 63
Views: 2145

Re: Spider-OS a new operating system

I would like to use the hardware acceleration of Videocore, but I can not understand how pixel depth works. There will be two triangles per square area you can either organize them slightly at different Z depth on the physical triangle vertexes or simply change the order of the indexed array as eit...
by LdB
Wed Feb 13, 2019 1:49 am
Forum: Bare metal, Assembly language
Topic: DMA Transfers
Replies: 7
Views: 2836

Re: DMA Transfers

You may need to ask this in a linux forum those are linux functions and the answer is specific to it.

What I will say is under baremetal (no linux) we have to alias the address by an OR or a value (0x40000000 on BCM2835 0xC0000000 on BCM 2836, BCM2837), whether it is the same in linux I can't say.
by LdB
Wed Feb 13, 2019 1:37 am
Forum: Bare metal, Assembly language
Topic: Writing to the framebuffer is slow
Replies: 23
Views: 3779

Re: Writing to the framebuffer is slow

He is working baremetal there is no such thing as /dev/fb0 which is a linux O/S construct and you need linux for it to work.

You need to be careful in this section historically it was just baremetal no linux or O/S at all.
by LdB
Wed Feb 13, 2019 1:36 am
Forum: Bare metal, Assembly language
Topic: RPi ARM boot problem
Replies: 7
Views: 179

Re: RPi ARM boot problem

Your link is the old dead one Paeryn
https://github.com/raspberrypi/tools/tr ... r/armstubs
by LdB
Tue Feb 12, 2019 3:20 am
Forum: Bare metal, Assembly language
Topic: Bare Metal - Blinking an LED
Replies: 37
Views: 924

Re: Bare Metal - Blinking an LED

You do :-) The easy cheat is just copy the makefile and linker file (rpi64.ld) from myblinker and edit the makefile to reflect your start.S. For now just make an minimal main.c with int main(void) { return 0; } You can also use qemu for the Raspberry Pi on Windows if you wish to debug and play with ...
by LdB
Mon Feb 11, 2019 7:30 am
Forum: Bare metal, Assembly language
Topic: Bare Metal - Blinking an LED
Replies: 37
Views: 924

Re: Bare Metal - Blinking an LED

I thought that is what you wanted to write some virtual core id (I chose 7 as an example) into the EL2 level and check you got it back at EL1? The only reason to write to that register is that :-) Those lines are standard to both GCC and any aarch64 assembler In the section line the name may vary th...
by LdB
Mon Feb 11, 2019 5:44 am
Forum: Bare metal, Assembly language
Topic: Bare Metal - Blinking an LED
Replies: 37
Views: 924

Re: Bare Metal - Blinking an LED

You must have a section descriptor first then the global declaration which has a strange spelling ... I think correct spelling works these days but I am old school. mrs is read from a register, msr is write to a register ... second letter r = read s = store is way to remember you might want to read ...
by LdB
Mon Feb 11, 2019 3:05 am
Forum: Bare metal, Assembly language
Topic: Bare Metal - Blinking an LED
Replies: 37
Views: 924

Re: Bare Metal - Blinking an LED

Woot .. good news you are away.

Just set the EL2 register straight after the label _start:

After you do the drop to EL1 do the second part read EL1 and see what you have.
by LdB
Mon Feb 11, 2019 2:34 am
Forum: Bare metal, Assembly language
Topic: Bare Metal - Blinking an LED
Replies: 37
Views: 924

Re: Bare Metal - Blinking an LED

I am on same windows so that can't be problem. You don't need to download FreeRTos it is on the repository :-) https://github.com/LdB-ECM/Raspberry-Pi/tree/master/FreeRTOSv10.1.1 You just needed to change directory and do make Pi3-64 However given I have already made the new makefile for myBlinker t...
by LdB
Mon Feb 11, 2019 1:58 am
Forum: Bare metal, Assembly language
Topic: Bare Metal - Blinking an LED
Replies: 37
Views: 924

Re: Bare Metal - Blinking an LED

There should have been a whole lot of compiling before that and it can't find the kernel.elf file can you try make clean then make Pi3-64 So i have downloaded the exact same files as you let me show you what it should do D:\Leon\Raspberry-Pi\myBlinker>make Pi3-64 d:/gcc-linaro-7.4.1-2019.02-i686-min...
by LdB
Sun Feb 10, 2019 9:21 am
Forum: Bare metal, Assembly language
Topic: Bare Metal - Blinking an LED
Replies: 37
Views: 924

Re: Bare Metal - Blinking an LED

Forgive my stupidity .. the file I said is a linux executables which is the error :-) Try gcc-linaro-7.4.1-2019.02-i686-mingw32_aarch64-elf.tar.xz For future reference its the largest one ... doh. The linux path directory slashes are correct "make" deals with that and the fact you get the make error...
by LdB
Sun Feb 10, 2019 3:18 am
Forum: Bare metal, Assembly language
Topic: Bare Metal - Blinking an LED
Replies: 37
Views: 924

Re: Bare Metal - Blinking an LED

You can cross compile on a linux machine (including the Pi itself) or windows that is completely up to you. Now on Windows I don't know anything about codeblocks I use Visual Studio so I will do it on command line and you can work out how to integrate to codeblocks (as it states you can use makefile...
by LdB
Sun Feb 10, 2019 2:50 am
Forum: Bare metal, Assembly language
Topic: RPi3 - start cores and spinlock sync code needed
Replies: 11
Views: 395

Re: RPi3 - start cores and spinlock sync code needed

Why it is where it is is given by linux aarch64 specification the decompressed kernel is expected to fill the space.

https://github.com/torvalds/linux/blob/ ... ooting.txt
by LdB
Sat Feb 09, 2019 7:25 am
Forum: Bare metal, Assembly language
Topic: Bare Metal - Blinking an LED
Replies: 37
Views: 924

Re: Bare Metal - Blinking an LED

So am I correct in saying that MPIDR_EL1 is needed because it tells me that the ARM cpu is a cluster of 4 cores. The AFF0 field in this register holds the bits that when set will have the ID of 4 cores. Essentially bits 7:0 must be 1? Nope AFF0 is the default affinity and as we have no virtualizati...
by LdB
Sat Feb 09, 2019 5:04 am
Forum: Bare metal, Assembly language
Topic: RPi3 - start cores and spinlock sync code needed
Replies: 11
Views: 395

Re: RPi3 - start cores and spinlock sync code needed

Also, why did you say that synchronization interferes with memory allocation ? If everything is cached, it should be OK, or is it something I don't yet see ? The L1 internal state machine locks if you don't adhere to the restrictions and it just punches a data abort exception . http://infocenter.ar...
by LdB
Sat Feb 09, 2019 3:25 am
Forum: Bare metal, Assembly language
Topic: Bare Metal - Blinking an LED
Replies: 37
Views: 924

Re: Bare Metal - Blinking an LED

Okay I am not sure how much to tell you here it is sort of one of those deep end things that if you think about it too much when starting you get lost. So I am going to take some liberties to simplify this, so you are warned there are some complications I am simply going to omit as it makes it even ...
by LdB
Fri Feb 08, 2019 2:17 pm
Forum: Bare metal, Assembly language
Topic: RPi3 - start cores and spinlock sync code needed
Replies: 11
Views: 395

Re: RPi3 - start cores and spinlock sync code needed

But I do not understand the writing protocol Core 1 jump address mailbox is at 0xe0 Core 2 jump address mailbox is at 0xe8 Core 3 jump address mailbox is at 0xf0 Okay the cores in 64bit mode don't get parked on the physical mailbox .. I have no idea why only the Pi devs could answer that. Look at t...
by LdB
Fri Feb 08, 2019 1:33 am
Forum: Bare metal, Assembly language
Topic: Bare Metal - Blinking an LED
Replies: 37
Views: 924

Re: Bare Metal - Blinking an LED

Yes no worries at all.
by LdB
Thu Feb 07, 2019 5:37 pm
Forum: Bare metal, Assembly language
Topic: Spider-OS a new operating system
Replies: 63
Views: 2145

Re: Spider-OS a new operating system

You get the compiler to create the versions .. write them in C ... you just said it you won't beat the compiler :-) https://courses.cs.vt.edu/~cs1104/Division/ShiftSubtract/Shift.Subtract.html uint32_t udiv64_32(uint64_t *n, uint32_t base) { uint64_t rem = *n; uint64_t b = base; uint64_t res, d = 1;...
by LdB
Thu Feb 07, 2019 4:45 pm
Forum: Bare metal, Assembly language
Topic: Spider-OS a new operating system
Replies: 63
Views: 2145

Re: Spider-OS a new operating system

The code is contained in the library file that GCC is package with libgcc, newlib, bionic, musl or whatever. This is exactly what GCC does ... line 2552 https://github.com/gcc-mirror/gcc/blob/master/gcc/config/arm/arm.c set_optab_libfunc (udivmod_optab, DImode, "__aeabi_uldivmod"); It links the func...
by LdB
Thu Feb 07, 2019 1:05 pm
Forum: Bare metal, Assembly language
Topic: Spider-OS a new operating system
Replies: 63
Views: 2145

Re: Spider-OS a new operating system

It isn't a bug you are compiling for ARM6 which is an ARM with no divide instruction .. it can't opcode what it doesn't have https://community.arm.com/processors/b/blog/posts/divide-and-conquer I can also tell you that you also have inlining turned off or else it would inline the calls rather than m...

Go to advanced search