zhak
Posts: 13
Joined: Wed Jul 03, 2019 5:18 pm

Re: Spider-OS a new operating system

Fri Jul 12, 2019 5:50 pm

Oh, man, this is really fascinating! I'm waiting for my RPi4 to arrive to start osdev in asm as well. I did some osdev for x86 in the past, now I wanna dive in to AArach64. Your demos are pretty cool. Will be waiting for updates! ;)

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: Spider-OS a new operating system

Fri Jul 12, 2019 8:37 pm

zhak wrote:
Fri Jul 12, 2019 5:50 pm
Oh, man, this is really fascinating! I'm waiting for my RPi4 to arrive to start osdev in asm as well. I did some osdev for x86 in the past, now I wanna dive in to AArach64. Your demos are pretty cool. Will be waiting for updates! ;)
You are in for an entirely new game. No BIOS text functions, no BIOS keyboard functions, etc, you are doing everything to get up and going.

It is way worth it though.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

Aran
Posts: 36
Joined: Fri Jan 25, 2019 5:55 pm

Re: Spider-OS a new operating system

Fri Jul 12, 2019 10:25 pm

Zhak, very happy to see your enthusiasm. :)

As DavidS says, in the beginning the task is difficult because you have to start from scratch.
Fortunately on the Internet, there are pionneers who have already been there and shared their work.

Aran
Posts: 36
Joined: Fri Jan 25, 2019 5:55 pm

Re: Spider-OS a new operating system

Sun Sep 15, 2019 8:27 pm

Hello everyone.
Well I'm a little sad. With the Raspberry Pi 4 we have some nasty surprises :( . My programs on Videocore or USB no longer work ! And then as usual it will take a long time before you can find all the technical information on the new components ...
In short, I decided to start from scratch. So I published a new post for those who discover assembler programming. So a tutorial to start the Pi without Linux, and also explanations to program the mailbox.
https://spider-os.com/commentaires.php?billet=12

Aran
Posts: 36
Joined: Fri Jan 25, 2019 5:55 pm

Re: Spider-OS a new operating system

Sun Sep 22, 2019 4:23 pm

I am prolific right now :idea:
I wrote a post on the programming of the GPIO and the UART on the Pi 4.
All that is needed to establish a serial communication with a USB port on the PC. With interrupt management please. https://spider-os.com/commentaires.php?billet=13
Image

pik33
Posts: 183
Joined: Thu Sep 10, 2015 4:26 pm

Re: Spider-OS a new operating system

Thu Oct 03, 2019 4:03 pm

I added your website to my bookmarks.

Is there this fasmarm assembler available on RPi? I don't want to use a PC for RPi programming :)

Aran
Posts: 36
Joined: Fri Jan 25, 2019 5:55 pm

Re: Spider-OS a new operating system

Thu Oct 03, 2019 6:00 pm

Hello pik33,

happy to be referenced and to see a new follower of the assembler :-)

To my knowledge FASMARM does not exist on Raspbian. You have to use GCC. A friendly guide to use it : http://www.microdigitaled.com/ARM/ASM_A ... ogramming.

pik33
Posts: 183
Joined: Thu Sep 10, 2015 4:26 pm

Re: Spider-OS a new operating system

Fri Oct 04, 2019 4:19 am

a new follower of the assembler
Not new :) Using asm for over 30 years :) But on RPi i use asm mixed with high level languages to speed up/make things possible.

I wrote (1) SID emulator (https://github.com/pik33/ultibo_retro_g ... malina.pas line 2423) (2) noise shaper for audio driver (https://github.com/pik33/SimpleAudio/bl ... eaudio.pas line 636) (3) some other procsdures using asm in Pascal code (using Ultibo to write/compile), for example drawing a filled rectangle or emulating 8-bit paletized screen with sprites on 32bit RPi framebuffer

Full asm programming from the start to the end... last time I did this in good old days of MS-DOS :)

bzt
Posts: 393
Joined: Sat Oct 14, 2017 9:57 pm

Re: Spider-OS a new operating system

Sat Oct 05, 2019 4:38 pm

Hi Aran,

I'd like to say you have a really amazing project here! Keep up the good work!
Aran wrote:
Thu Oct 03, 2019 6:00 pm
To my knowledge FASMARM does not exist on Raspbian
FASMARM by definition is a cross-assembler, it was designed to run on x86 generating ARM output. So you're right, you can't run it on Raspberry natively.

Cheers,
bzt

hippy
Posts: 6277
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Spider-OS a new operating system

Sat Oct 05, 2019 5:30 pm

bzt wrote:
Sat Oct 05, 2019 4:38 pm
Aran wrote:
Thu Oct 03, 2019 6:00 pm
To my knowledge FASMARM does not exist on Raspbian
FASMARM by definition is a cross-assembler, it was designed to run on x86 generating ARM output. So you're right, you can't run it on Raspberry natively.
It appears it is intended for X86 so won't run natively but it does seem it can be emulated ...

Code: Select all

[email protected]:~/fasmarm $ file fasmarm
fasmarm: ELF 32-bit LSB executable, Intel 80386, version 1 (GNU/Linux), statically linked, no section header

Code: Select all

[email protected]:~/fasmarm $ ./bin/fasmarm
flat assembler for ARM  version 1.43 (built on fasm 1.73.02)
usage: fasmarm <source> [output]
optional settings:
 -m <limit>         set the limit in kilobytes for the available memory
 -p <limit>         set the maximum allowed number of passes
 -d <name>=<value>  define symbolic variable
 -s <file>          dump symbolic information for debugging

Code: Select all

[email protected]:~/fasmarm $ ./bin/fasmarm borrowed.asm
flat assembler for ARM  version 1.43 (built on fasm 1.73.02)  (16384 kilobytes memory)
2 passes, 184 bytes.

Code: Select all

[email protected]:~/fasmarm $ file borrowed
borrowed: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, no section header
The ./borrowed binary segfaults when run, but at least it executed, didn't throw Exec format errors.

I am sure someone who knows more than I do could probably get it to work.

Has anyone got any "hello world" fasmarm source code which would run under Raspbian Buster when assembled ? I'm willing to try that.

Got it working with Dex's TinyServer code from this post and the FasmArm.inc in the post which follows -

https://www.raspberrypi.org/forums/view ... 19#p320919

Code: Select all

[email protected]:~/fasmarm $ ./fasmarm TinyServer.asm
flat assembler for ARM  version 1.43 (built on fasm 1.73.02)  (16384 kilobytes memory)
3 passes, 0.2 seconds, 4328 bytes.
[email protected]:~/fasmarm $ echo "Whoot from FASMARM!" > index.htm
[email protected]:~/fasmarm $ ./TinyServer 8080
 Server started...
192.168.0.204 - 200 OK - index.htm
"And that's a wrap".

Aran
Posts: 36
Joined: Fri Jan 25, 2019 5:55 pm

Re: Spider-OS a new operating system

Sat Oct 05, 2019 7:29 pm

Thank you for the compliment Bzt, it makes me really happy. :)

Hippy, regarding the compilation, it seems not very easy to go through emulation.
For my part I prefer to have two computers : one to code and compile (the PC with FASMARM), and another (the Raspberry Pi) to test the program.
When I was programming the Videocore, I also used Raspbian to test OpenGL programs in C with Geany. Because in this case, we can test the code directly on the Raspberry Pi.

hippy
Posts: 6277
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Spider-OS a new operating system

Sat Oct 05, 2019 8:05 pm

Aran wrote:
Sat Oct 05, 2019 7:29 pm
Hippy, regarding the compilation, it seems not very easy to go through emulation.
Seems to me it's pretty transparent; allows the FASMARM assembler to be run on a Pi just as one would run it on a PC or X86 Linux. Just an extra step and it can be invoked with "fasmarm file.ext" from anywhere.

As to whether anyone thinks developing and assembling the code is best done on a PC, X86 Linux box or a Pi before deploying the resulting binaries to the target; I would guess that's a matter of personal preference.

I don't really have any skin in this game; I just happened to note the comments ( here and elsewhere ) which tend towards "FASMARM is the best assembler, ever", with the caveat, "but doesn't run on a Pi :(" expressing some disappointment. I was sure it could and thought I could figure a way to do that.

I'm happy for people to take it or leave it, but, if someone wants to run FASMARM on a Pi, at least it's now proven possible. I'll create a How To for that and post it somewhere appropriate rather than side-tracking this thread. Apologies if it's intruded.

Aran
Posts: 36
Joined: Fri Jan 25, 2019 5:55 pm

Re: Spider-OS a new operating system

Sun Oct 06, 2019 7:59 am

You are welcome on this thread. Thanks for the method to run Fasmarm on Pi, I did not take the time to test, sorry.

Aran
Posts: 36
Joined: Fri Jan 25, 2019 5:55 pm

Re: Spider-OS a new operating system

Sun Oct 13, 2019 6:02 pm

Hello,
to get a little closer to home automation, I tackled the i2c bus programming. A fairly simple protocol compared to Videocore or USB :-)
I chose a well-documented RTC clock on the DS3231. In this post, you will find all the steps to connect it with the Pi 4, and program it.
The time is recovered on the serial link, and display on the screen via the hdmi, as in the screenshots below.

Image Image

Return to “Bare metal, Assembly language”