Go to advanced search

by bzt
Fri Apr 19, 2019 10:39 am
Forum: Bare metal, Assembly language
Topic: Low level RPI programming
Replies: 6
Views: 225

Re: Low level RPI programming

Welcome to the bare metal programming forum! So my question is this: is there a way to program a raspberry pi with assembler without installing an OS? Yes, that's exactly what this forum is about :-) You can find plenty of Assembly here, without any OS requirement. (I'd suggest to use the keywords "...
by bzt
Fri Apr 19, 2019 10:35 am
Forum: Bare metal, Assembly language
Topic: Best way to synchronize timers?
Replies: 1
Views: 65

Re: Best way to synchronize timers?

Hi, I think the most efficient solution is to issue WFE on the application cores, and use SEV in the local timer ISR on the main core. That's the solution with the smallest latency possible. The downside is, you can only use one randevous point like this, which is good if you have only this single 1...
by bzt
Thu Apr 11, 2019 10:34 am
Forum: Beginners
Topic: [Solved] How to turn off Raspberry with a keyboard ?
Replies: 9
Views: 397

Re: How to turn off Raspberry with a keyboard ?

Hi,

You could use [Alt]+[SysRq] and then [o].

If your keyboard does not provide a key with scancode for SysRq, you can try to configure the Magic SysRq. Chromebook keyboards use [Alt]+[VolumeUp] or [Alt]+[F10] for example.

Cheers,
bzt
by bzt
Tue Apr 09, 2019 10:36 pm
Forum: Bare metal, Assembly language
Topic: Why can't I run 32-bit kernels on QEMU's RPi3?
Replies: 6
Views: 205

Re: Why can't I run 32-bit kernels on QEMU's RPi3?

Hi, Thank you very much for your answer, everything is much clearer now. Do you think it would be possible to have the 32-bit boot process while still using cortex-A53 instead of downgrading to cortex-A7? I don't think it will be possible soon. When I first submited my patch, I've created a separate...
by bzt
Tue Apr 09, 2019 3:44 pm
Forum: Bare metal, Assembly language
Topic: Why can't I run 32-bit kernels on QEMU's RPi3?
Replies: 6
Views: 205

Re: Why can't I run 32-bit kernels on QEMU's RPi3?

Hi, Hello, On a real Raspberry Pi 3, you can run a 32-bit kernel thanks to aarch64 32-bit retrocompatibility. However when I run a 32-bit kernel using raspi3 machine on QEMU, it just doesn't run, I have to use the raspi2 machine. Any idea on why? Is there a problem with the retrocompatibility of QEM...
by bzt
Thu Apr 04, 2019 12:08 pm
Forum: Bare metal, Assembly language
Topic: Circle - C++ bare metal environment (with USB)
Replies: 175
Views: 42842

Re: Circle - C++ bare metal environment (with USB)

Hi First, Circle is getting better and better, well done! I've linked it from my tutorials just in case someone's looking for a bare metal C++ library. :-) But back when I tried to go from C to C++ (DOS C era) they started this thing called Hungarian notation, totally put me off C++. Of course, you ...
by bzt
Sun Mar 31, 2019 8:34 pm
Forum: C/C++
Topic: [TCP] Server/client non blocking: missing sys/event.h?
Replies: 1
Views: 1236

Re: [TCP] Server/client non blocking: missing sys/event.h?

Hi, Auch, that's a terrible example with lots of unecessary dependencies. TCP communication is a lot simpler than that, try one of these: http://my.fit.edu/~vkepuska/ece3551/ADI_Speedway_Golden/Blackfin%20Speedway%20Manuals/LwIP/socket-api/tcp-cli-serv.html (lwip lib) https://www.binarytides.com/ser...
by bzt
Fri Mar 29, 2019 11:47 am
Forum: Networking and servers
Topic: Clock Syncing Two Pi's
Replies: 2
Views: 124

Re: Clock Syncing Two Pi's

Hi, Since the RPi borad does not have an on-board RTC chip, you have two options: 1. if you have internet connection on your Pis, use ntpd and it's command line tool: "sudo apt-get install ntp ntpdate". After boot, issue ntpdate (probably from /etc/rc.local) which will force a sync, or wait a few se...
by bzt
Thu Mar 28, 2019 11:31 pm
Forum: Bare metal, Assembly language
Topic: Yet Another Bare Metal Tutorial for the RPi3
Replies: 74
Views: 40205

Re: Yet Another Bare Metal Tutorial for the RPi3

Thank you. My biggest fear is how to make the Pi "see and execute" my code, but I already saw that raspberrypi-os has that info. :) Now is the study time. :D Not sure what you mean by "see and execute", you simply create an elf, copy the text segment out into kernel.img and save that on the SD card...
by bzt
Thu Mar 28, 2019 11:12 pm
Forum: General programming discussion
Topic: What does your development/deployment environment look like?
Replies: 13
Views: 1143

Re: What does your development/deployment environment look like?

VNC is cool. But not much use when trying to commune with a headless, embedded system. Agreed! I'm 100% with you on this. SSH is much faster, more comfortable and responsive than VNC. It generates less traffic by several magitudes, and if you install gpm it can handle clicking, scrolling, copy'n'pa...
by bzt
Thu Mar 28, 2019 10:55 pm
Forum: General programming discussion
Topic: Read Pixel colour from screen.
Replies: 20
Views: 813

Re: Read Pixel colour from screen.

out of interest , would you know of a player that does the opposite of Mencoder ? That's is I give it jpegs and it plays them as a video ? Mplayer can do that. Both mencoder and mplayer use the same codecs and filters, all can be used as input and for output as well, the only difference is that men...
by bzt
Thu Mar 28, 2019 10:27 am
Forum: C/C++
Topic: Building a new OS/Kernel from scratch for the Raspberry Pi.
Replies: 12
Views: 1655

Re: Building a new OS/Kernel from scratch for the Raspberry Pi.

C certainly was the way to go. Starting from late 1970's. Only four decades ago! Time has shown that it's impossible to make a correct, secure, OS, in C. Or any other software for that matter. As a CS student perhaps you should be looking to the future. For example these guys, Redox OS, are trying ...
by bzt
Thu Mar 28, 2019 9:39 am
Forum: Bare metal, Assembly language
Topic: Yet Another Bare Metal Tutorial for the RPi3
Replies: 74
Views: 40205

Re: Yet Another Bare Metal Tutorial for the RPi3

Hi, Feel free if you want to say "that book is crap! Pick another!" or anything. :) Well, my question is: Do you think this tutorial is a good place to start? I already know C and C++. No, those books are great sources. I'd suggest to get Tanenbaum's and Bos' book too, it's called Modern Operating S...
by bzt
Thu Mar 28, 2019 9:13 am
Forum: General programming discussion
Topic: Read Pixel colour from screen.
Replies: 20
Views: 813

Re: Read Pixel colour from screen.

Hi, What about mplayer ? It's a standard raspbian package. It has the capability to play in a X11 window, but you can also use it on a Linux console framebuffer without any Xserver at all. It has a companion mencoder command which could be useful. With that you can convert each frame into a picture ...
by bzt
Tue Mar 26, 2019 2:24 pm
Forum: General programming discussion
Topic: Read Pixel colour from screen.
Replies: 20
Views: 813

Re: Read Pixel colour from screen.

Hi, To access the framebuffer read this . It's taking about plotting a pixel, all you need to do is to reverse that and read instead. There are many example C codes out there, for example this one has an fb_getpixel32() routine. But framebuffer is not the only way. If your video player is using X11,...
by bzt
Mon Mar 25, 2019 2:35 pm
Forum: General discussion
Topic: forcing app to stay on top
Replies: 2
Views: 119

Re: forcing app to stay on top

Hi, Don't start the app directly, instead start a small script. That script starts your app in the background (add & at the end of the command) then in a loop it can bring the app's window to the foreground using xdotool . That's a standard raspbian package, you can install it with "apt-get install ...
by bzt
Mon Mar 25, 2019 1:22 am
Forum: General programming discussion
Topic: What options do I have to issue commands remotely
Replies: 4
Views: 311

Re: What options do I have to issue commands remotely

Hi, Not sure why you need the VPN for SSH. If this is because of a networking issue, then you'll need the VPN for any other protocolls as well. Other than that, you should be able to call your Pi's webserver with a simple request from an Android or iPhone app. If you don't have a dynamic page, you c...
by bzt
Sat Mar 23, 2019 4:23 pm
Forum: Networking and servers
Topic: Run Shell srcript only once
Replies: 17
Views: 556

Re: Run Shell srcript only once CLOSER

Hi, To run your script without sourcing, add executable access to it ("chmod +x ranonce.sh") and start it with a shebang , "#!/bin/sh" in the first line. I usually add an empty line after that otherwise mcedit does not syntax highlight the file properly, but shouldn't needed. #!/bin/sh ping -c1 192....
by bzt
Sat Mar 23, 2019 3:57 pm
Forum: Networking and servers
Topic: How to get nginx to work
Replies: 7
Views: 253

Re: How to get nginx to work

Hi, You should use "<?php" because you cannot be sure short tags are enabled (usually they are not). Otherwise I have a detailed description here . It's a bit out of date (first written for jessie, then updated for stretch), but it's fine. I also have a full fastcgi param nginx configuration example...
by bzt
Sat Mar 23, 2019 3:23 pm
Forum: Bare metal, Assembly language
Topic: Trying Bare Metal on Raspberry Pi 3
Replies: 4
Views: 4143

Re: Trying Bare Metal on Raspberry Pi 3

Hi krom,

Thanks for sharing! And thanks for your tutorials, FASM is also my favourite assembler, for a good reason :-)

Cheers,
bzt
by bzt
Sat Mar 23, 2019 3:18 pm
Forum: Bare metal, Assembly language
Topic: Puzzled, Mem speed?
Replies: 30
Views: 1456

Re: Puzzled, Mem speed?

Those changes fixed one set of regression tests! But it still fails somewhere else. Have I got the above changes in correctly? Almost! The "add x1" line is at wrong place, it goes in the loop as the first instruction (in the line with the 0: label): /* copy large blocks, 256 bytes per iteration */ ...
by bzt
Thu Mar 21, 2019 4:49 pm
Forum: Bare metal, Assembly language
Topic: Puzzled, Mem speed?
Replies: 30
Views: 1456

Re: Puzzled, Mem speed?

Any compilation errors? No! What's the problem then? I've spotted a very rookie mistake (shame on me), and I've removed ! from []! and added "add x1, x1, #256" as the first instruction of the big block copy, and "add x0, x0, #256" before the "sub x3, x3, #1". Without this it didn't copy the last fe...
by bzt
Thu Mar 21, 2019 2:01 am
Forum: Bare metal, Assembly language
Topic: RPI3 QEMU
Replies: 50
Views: 34174

Re: RPI3 QEMU

Hi,

It took me about 2 hours to write and almost a month to get it merged, but the ARM Local Timer is finally in qemu mainline! :-)

Cheers,
bzt
by bzt
Thu Mar 21, 2019 1:42 am
Forum: Bare metal, Assembly language
Topic: Puzzled, Mem speed?
Replies: 30
Views: 1456

Re: Puzzled, Mem speed?

With the ARMv5 and earlier (and some ARMv6 implementations) it was/is a lot quicker to use unrolling tricks. Though with the ARM1176, Cortex-A7, and Cortex-A53 used in the Raspberry Pi series of computers it is a lot faster to bring it down to a single instruction when doing write only. This is goi...
by bzt
Thu Mar 21, 2019 1:12 am
Forum: Bare metal, Assembly language
Topic: Puzzled, Mem speed?
Replies: 30
Views: 1456

Re: Puzzled, Mem speed?

Thanks for posting this. I tried it by inlining it in a large C program, and sadly failed, 99.999999999% likely because my C inline stuff is wrong :( Any compilation errors? I'd recommend to put it in a separate .S file, it expects the input in a C calling convention, so you can easily call it from...

Go to advanced search