Go to advanced search

by Tony201800
Sat Mar 16, 2019 8:31 am
Forum: Bare metal, Assembly language
Topic: Bare Metal - Blinking an LED
Replies: 41
Views: 3509

Re: Bare Metal - Blinking an LED

I guess I was confused again about what it is that I really want to do. That bit of assembly code had an output screen under it where I got it from. I don't know whether it was coded up for baremetal or it had an OS but it was aarch64 assembly and that was what that pulled me towards it to try and r...
by Tony201800
Sat Mar 16, 2019 4:35 am
Forum: Bare metal, Assembly language
Topic: Bare Metal - Blinking an LED
Replies: 41
Views: 3509

Re: Bare Metal - Blinking an LED

Hi there LdB, My apologies for this late reply. Just been caught up with work and I am now thinking of back tracking my learning objective to being an absolute beginner in assembly, c & aarch64. I was too quick to jump into the deep end. I will for now try to focus my strengths on aarch64 assembly t...
by Tony201800
Wed Feb 13, 2019 9:19 pm
Forum: Bare metal, Assembly language
Topic: Bare Metal - Blinking an LED
Replies: 41
Views: 3509

Re: Bare Metal - Blinking an LED

Good morning mate

Still working on getting an output from the aarch64 code to display in qemu.

I get a GTK warning at the command prompt but don’t see an output on the qemu console.

Any tips.

Cheers
by Tony201800
Tue Feb 12, 2019 3:55 am
Forum: Bare metal, Assembly language
Topic: Bare Metal - Blinking an LED
Replies: 41
Views: 3509

Re: Bare Metal - Blinking an LED

do i need to have the c code? do i need to edit the .ld file to not include any c file?

i tried to use qemu but kept getting a message about not specifying block size. I will send you the message shortly after I redo the simulation.

thx.
by Tony201800
Mon Feb 11, 2019 10:05 pm
Forum: Bare metal, Assembly language
Topic: Bare Metal - Blinking an LED
Replies: 41
Views: 3509

Re: Bare Metal - Blinking an LED

ofcourse i need to link the file with rpi64.ld?
by Tony201800
Mon Feb 11, 2019 9:56 pm
Forum: Bare metal, Assembly language
Topic: Bare Metal - Blinking an LED
Replies: 41
Views: 3509

Re: Bare Metal - Blinking an LED

Good Morning Mate, Could you please advise how I can run the above code via command line. Do I have to run it from a linux pc or can I do it from Windows This is what I did from command prompt... aarch64-elf-as D:\RPi\Tests\test.s -o D:\RPi\Tests\test.o test.s had your mpidr code in it. This command...
by Tony201800
Mon Feb 11, 2019 6:26 am
Forum: Bare metal, Assembly language
Topic: Bare Metal - Blinking an LED
Replies: 41
Views: 3509

Re: Bare Metal - Blinking an LED

ok maybe the last questions for today...

ofcourse it's MSR not MRS... for write..sorry my bad
why was there an mov instruction to mov 7 to x0

are the below lines standard for gcc assembler

.section ".init", "ax", %progbits
.globl _start
_start:

cheers
by Tony201800
Mon Feb 11, 2019 4:22 am
Forum: Bare metal, Assembly language
Topic: Bare Metal - Blinking an LED
Replies: 41
Views: 3509

Re: Bare Metal - Blinking an LED

treading very cautiously here since i want to understand what is going on intimately.

_start: .global _start
.global main

main:
mrs x0, VMPIDR_EL2
.end

is the above what you meant by saying set el2

thx
by Tony201800
Mon Feb 11, 2019 2:50 am
Forum: Bare metal, Assembly language
Topic: Bare Metal - Blinking an LED
Replies: 41
Views: 3509

Re: Bare Metal - Blinking an LED

ok got it to work :). line 27 in the make file had an extra '-gcc' in its directory path. trillions of thanks again!! if i were to just compile the 2 lines of code you mentioned in your post yesterday about MPIDR and get a result could you please advise how i can do that. my process would be to: cre...
by Tony201800
Mon Feb 11, 2019 2:25 am
Forum: Bare metal, Assembly language
Topic: Bare Metal - Blinking an LED
Replies: 41
Views: 3509

Re: Bare Metal - Blinking an LED

I am on Win 10 Pro.

Could you please advise how I can compile RTOS. The download files are .exe & .zip.

Thanks again.
by Tony201800
Sun Feb 10, 2019 11:58 pm
Forum: Bare metal, Assembly language
Topic: Bare Metal - Blinking an LED
Replies: 41
Views: 3509

Re: Bare Metal - Blinking an LED

Thx again LdB. Nothing to be sorry about. I am forever indebted to you for your help and guidance. I am on a different pc today and realized that I already had the aarch64 complier for windows in my path but from last year. I just needed to place make in the path. Unfortunately the same error is per...
by Tony201800
Sun Feb 10, 2019 7:04 am
Forum: Bare metal, Assembly language
Topic: Bare Metal - Blinking an LED
Replies: 41
Views: 3509

Re: Bare Metal - Blinking an LED

After following your steps I get an error as below C:/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-elf/bin/aarch64-elf-gcc -Wall -O3 -march=armv8-a+simd -mtune=cortex-a53 -mstrict-align -fno-tree-loop-vectorize -fno-tree-slp-vectorize -Wno-nonnull-compare -nostdlib -nodefaultlibs -nostartfiles -ffreestan...
by Tony201800
Sun Feb 10, 2019 2:49 am
Forum: Bare metal, Assembly language
Topic: Bare Metal - Blinking an LED
Replies: 41
Views: 3509

Re: Bare Metal - Blinking an LED

I am keen on running the code you posted above.

Could you please guide me how I can run it and check its output. Can it be done on my setup using code blocks. Do I need to install aarch64 compiler for windows?

thx again.
by Tony201800
Sat Feb 09, 2019 6:38 am
Forum: Bare metal, Assembly language
Topic: Bare Metal - Blinking an LED
Replies: 41
Views: 3509

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?
by Tony201800
Sat Feb 09, 2019 1:41 am
Forum: Bare metal, Assembly language
Topic: Bare Metal - Blinking an LED
Replies: 41
Views: 3509

Re: Bare Metal - Blinking an LED

Hi LdB I am in the very early stages of my bootstub by making use of the ARM docs and online material. I am seeing that there is liberal use of MPIDR_EL1 to start the boot code of. From my understanding this is a 64bit register that identifies the core number in a multicore cpu. There is also mentio...
by Tony201800
Fri Feb 08, 2019 12:56 am
Forum: Bare metal, Assembly language
Topic: Bare Metal - Blinking an LED
Replies: 41
Views: 3509

Re: Bare Metal - Blinking an LED

Thank again LdB. If I code up by own bootstub would you be able to have a look please. The contents of the code will only focus on the below... Initializing exceptions. Initializing registers. Configuring the MMU and caches. Enabling NEON and Floating Point. Changing Exception levels. Finally tellin...
by Tony201800
Wed Feb 06, 2019 2:45 am
Forum: Bare metal, Assembly language
Topic: Bare Metal - Blinking an LED
Replies: 41
Views: 3509

Re: Bare Metal - Blinking an LED

Roger that. I understood what you meant with many thanks again. Could you please guide me how I can create my own bootstub. I have the cortex a53 manual with me but the sea of information it contains is overwhelming to say the least. Hypothetically speaking let's say you or this forum wasn't around....
by Tony201800
Tue Feb 05, 2019 6:22 am
Forum: Bare metal, Assembly language
Topic: Bare Metal - Blinking an LED
Replies: 41
Views: 3509

Re: Bare Metal - Blinking an LED

ok this time a few errors. could it be my c code?
error1.PNG
error1.PNG (66.1 KiB) Viewed 1845 times
by Tony201800
Mon Feb 04, 2019 11:51 pm
Forum: Bare metal, Assembly language
Topic: Bare Metal - Blinking an LED
Replies: 41
Views: 3509

Re: Bare Metal - Blinking an LED

Hello again, LdB.

Please find a screen attached showing the error I receive when compiling/linking.

Thanks again
Tony
error.PNG
error.PNG (11.27 KiB) Viewed 1887 times
by Tony201800
Sun Feb 03, 2019 8:39 am
Forum: Bare metal, Assembly language
Topic: Bare Metal - Blinking an LED
Replies: 41
Views: 3509

Re: Bare Metal - Blinking an LED

Right I see what you mean. My problem is that I am also using code-blocks IDE which just compiles the code without my having to specify a linker or bootstub so in this case I don't have a bootstub or linker script. Let me work on this and I will return back. Could you please confirm if the compiler ...
by Tony201800
Sun Feb 03, 2019 4:13 am
Forum: Bare metal, Assembly language
Topic: Bare Metal - Blinking an LED
Replies: 41
Views: 3509

Re: Bare Metal - Blinking an LED

Hi LdB, Many thanks for your advise and help. I am trying to learn bare metal from the ground up so rather than borrowing code I want to do what you do myself; no matter how painful it is. I am taking minute steps instead of long strides :). At this stage I have some self brewed c code and I would l...
by Tony201800
Sat Feb 02, 2019 11:47 pm
Forum: Beginners
Topic: Making a Led Blink
Replies: 40
Views: 2029

Re: Making a Led Blink

Thank you David/LTolledo,

Posted my enquiry in the baremetal forum.
by Tony201800
Sat Feb 02, 2019 11:45 pm
Forum: Bare metal, Assembly language
Topic: Bare Metal - Blinking an LED
Replies: 41
Views: 3509

Bare Metal - Blinking an LED

Hi there folks, I have taken on a small but very endearing task of working close to the metal. My main aim is to learn as much about kernel development on the pi. I have a 3b+ with 4x cortex a53 core. I am starting out with trying to blink an LED using nothing but c. I compile the code using GNU Too...
by Tony201800
Sat Feb 02, 2019 8:57 am
Forum: Beginners
Topic: Making a Led Blink
Replies: 40
Views: 2029

Re: Making a Led Blink

Hello again, LTolledo, Your help went a very long way. I was able to correct the physical wiring on the breadboard. I tried to install Thonny but it kept failing to connect to the site. In the end I used python idle to blink the Led. The script that you posted gave me an EOF error so I resorted to u...
by Tony201800
Sat Feb 02, 2019 3:29 am
Forum: Beginners
Topic: Making a Led Blink
Replies: 40
Views: 2029

Re: Making a Led Blink

Hello LTolledo,

Many thanks for your quick response.

Please find a photo attached of my setup.

I tested the pi 3 by deleting my kernel.img and renaming the raspbian image back to the way it was and booted the board with no problems.
IMG_0373.JPG
IMG_0373.JPG (116.12 KiB) Viewed 381 times

Go to advanced search