#Retro Rocket OS - A BASIC powered Operating System (started 2009!)

1 messages ยท Page 3 of 1

willow ginkgo
#

i mean its not modern enough to game

#

but it isnt a crappy computer i run retro rocket on

#

its old, sure, but its more than good enough to run windows 10, or linux

#

i even used to do unreal engine dev on it, thats why it has 32gb ram lol

#

i just have no need for it to run windows or linux rn so os dev test rig it is

true ridge
willow ginkgo
#

anything newer than cyberpunk 2077 is too new for it really

willow ginkgo
#

hah, standalone listen() test is horrible

    load_module("e1000");
    unsigned char ip[4];
    dprintf("Waiting for net to be ready\n");
    while (!gethostaddr(ip)) {
        __asm__ volatile("pause");
    };
    dprintf("listening 2000\n");
    int server = tcp_listen(0, 2000, 5);
    int client = -1;
    if (server < 0) {
        dprintf("Listen failure\n");
    } else {
        dprintf("waiting for client connection\n");
        while ((client = tcp_accept(server)) < 0) {
            __asm__ volatile("pause");
        };
        dprintf("Sending reply\n");
        send(client, "HELLORLD", 8);
        uint64_t ticks = get_ticks();
        while (get_ticks() - ticks < 3000) {
            tcp_idle();
            __asm__ volatile("pause");
        }
        dprintf("Closing client\n");
        closesocket(client);
        dprintf("Closing server\n");
        closesocket(server);
    }
willow ginkgo
#

going to add BASIC support for LISTEN and ACCEPT today.

#

then, first connection into it remotely

#

i might make a telnet server, for shits and giggles.

true ridge
willow ginkgo
#

yeah

#

lol

#

ive changed the font to the BBC Micro 8x8 font

#

can fit a lot more vertically on screen now but i have another reason for this, VDU 23, x support

#

it looks very different to IBM 8x16 and might take some getting used to for some people

true ridge
willow ginkgo
#

it was because it was bbc 8x8 stretched double height

#

this is the same font but at the aspect its supposed to be

true ridge
#

oh

#

dont stretch fonts again they look like poo afterwards :/

willow ginkgo
#

zoomed in a bit

#

because discord's scaling of the image makes it unreadable without clicking

#

but you can see how the shape is right now?

#

they dont look so ass, obviously retro/oldschool but not ass

true ridge
#

this one's better

willow ginkgo
#

yeah

#

its exact match of mode 1 font

true ridge
#

this palette hurts my eyes

true ridge
#

can there be licensing issues though

heavy linden
#

(or howevery you spell that; min system requirement includes a i5 8400, a hexacore cpu)

willow ginkgo
willow ginkgo
#

they're just part of the os binary itself but not something anyone is asserting rights over

#

acorn went bust decades ago

willow ginkgo
true ridge
#

tcp server is insane

willow ginkgo
#

it is basic, see how simple a tcp server is?

#

its like 10 lines lol

#

admittedly that can only serve one request at a time, but its possible to make it scale simply by splitting the program in two, like a fork() model

#
server = SOCKLISTEN(NETINFO$("ip"), 2000, 5)
PRINT "Socket server listening on port 2000"
REPEAT
    client = SOCKACCEPT(server)
    IF client >= 0 THEN PROChandleConnection(client)
UNTIL INKEY$ <> ""
SOCKCLOSE server
END

DEF PROChandleConnection(client)
    PRINT "Handling connection, HELLORLD!"
    SOCKWRITE client, "HELLORLD!" + CHR$(10) + CHR$(13)
    SLEEP 1 ' Give the write time to finish
    SOCKCLOSE client
ENDPROC
willow ginkgo
#

i need to fix that need to do SLEEP 1

#

because SOCKWRITE does not block, it isnt guaranteed the data is sent to the client before you SOCKCLOSE without it

willow ginkgo
#
server = SOCKLISTEN(NETINFO$("ip"), 2000, 5)
PRINT "Socket server listening on port 2000"
REPEAT
    client = SOCKACCEPT(server)
    IF client >= 0 THEN PROChandleConnection(client)
UNTIL INKEY$ <> ""
SOCKCLOSE server
END

DEF PROChandleConnection(client)
    PRINT "Handling connection, HELLORLD!"
    SOCKWRITE client, "HELLORLD!" + CHR$(10) + CHR$(13)
    SOCKFLUSH client ' Ensure data has been sent
    SOCKCLOSE client
ENDPROC
#

there, new keyword SOCKFLUSH, thats better

true ridge
#

do drivers need to add support for the keyword?

#

keywords

#

Ebtgernet

willow ginkgo
#

drivers don't implement the TCP stack if that's what you mean, a network driver only has a function pointer to send an ethernet frame and sends incoming ethernet packets to ethernet_handle_frame()

hot hound
#

@willow ginkgo can you add some kind of compatibility mode or emulator or something for microsofts ms basic? They've open sourced it under MIT a couple days ago.

#

Well at least I think that'd be pretty cool

willow ginkgo
#

and Microsoft basic, the one they released, makes a lot of assumptions that it's in a 6502 environment with a 64k memory map

#

looks like it doesn't even have a divide operator lol

#

idk why you'd want to "emulate" it apart from as historical curiosity

hot hound
#

Mostly that

willow ginkgo
#

just optimised BASIC keyword dispatch to make it O(1), eliminate a huge switch statement, and mean theres one point where you have to go when adding a new keyword rather than about 3 different call points

glad hemlock
willow ginkgo
willow ginkgo
#

just done a ton of optimisations to the hot paths in BASIC

willow ginkgo
#

a webserver!

IF EXISTSVARI("client_socket") THEN
    PROCprocessRequest
    END
ENDIF

server = SOCKLISTEN(NETINFO$("ip"), 80, 5)
PRINT "Web server running. Press any key to terminate."
REPEAT
    client = SOCKACCEPT(server)
    IF client >= 0 THEN PROCspawnChild(client)
UNTIL INKEY$ <> ""
SOCKCLOSE server
END

DEF PROCspawnChild(client)
    GLOBAL client_socket = client
    CHAIN PROGRAM$, TRUE ' Spawn an async background instance
ENDPROC

DEF PROCprocessRequest
    SOCKREAD client_socket, REQUEST$
    VERB$ = TOKENIZE$(REQUEST$, " ") ' Get the request details
    FILEPATH$ = TOKENIZE$(REQUEST$, " ")
    IF FILEPATH$ = "/" THEN FILEPATH$ = "/index.html"
    PRINT FILEPATH$
    VERSION$ = REQUEST$
    FILEPATH$ = "/system/webserver" + FILEPATH$
    FH = OPENIN(FILEPATH$)
    IF FH > -1 THEN
        SOCKWRITE client_socket, "HTTP/1.0 200 OK"; CHR$(13); CHR$(10);
        size = FILESIZE(FILEPATH$)
        buffer = MEMALLOC(size)
        SOCKWRITE client_socket, "Content-Length: "; size; CHR$(13); CHR$(10);
        SOCKWRITE client_socket, "Connection: close"; CHR$(13); CHR$(10); CHR$(13); CHR$(10);
        BINREAD FH, buffer, size
        SOCKBINWRITE client_socket, buffer, size
        SOCKFLUSH client_socket
        MEMRELEASE buffer
        SOCKCLOSE client_socket
        CLOSE FH
    ELSE
        SOCKWRITE client_socket, "HTTP/1.0 404 Not Found"; CHR$(13); CHR$(10);
        SOCKWRITE client_socket, "Content-Length: 0"; CHR$(13); CHR$(10);
        SOCKWRITE client_socket, "Connection: close"; CHR$(13); CHR$(10); CHR$(13); CHR$(10);
        SOCKFLUSH client_socket
        SOCKCLOSE client_socket
    ENDIF
ENDPROC
#

less than 50 lines of BASIC

true ridge
#

hellorld?

tall wedge
willow ginkgo
willow ginkgo
#

added a ton of new BASIC functions/keywords:

  • FILESIZE - get size of a file by name without opening it
  • MEMALLOC - allocate memory from the basic program's pool
  • MEMRELEASE - release memory
  • BINREAD - read raw binary buffer from file
  • BINWRITE - write raw binary buffer from file
  • SOCKBINREAD - read raw binary buffer from socket
  • SOCKBINWRITE - write raw binary buffer to socket
willow ginkgo
#

hmm this is actually quickly becoming "the OS where making network software is easy"

fierce swallow
#

that's hot work!

true ridge
#

the os where making multiplayer shooters is easy trl

willow ginkgo
#

rendering a cube is far from rendering an animating models

#

but its a start!

willow ginkgo
#

working on a way to be able to redefine characters (VDU23,X) and draw text at any arbitrary graphics coordinate bypassing flanterms grid

true ridge
#

everyone in the universe is using flanterm now

willow ginkgo
#

nor can it report it's dirty-rect, which I use to improve graphics drawing performance

willow ginkgo
#

it didnt go crazy... i redefined character 32 ๐Ÿ˜„

wild sedge
#

lol

willow ginkgo
#

im adding support for the BBC Micro VDU keyword

#

its like ANSI, but Acorn's own rules

#

allows you to do crazy things like redefine character bitmaps

willow ginkgo
rich scroll
willow ginkgo
timber dawn
#

oh thats cool :p

latent tendon
#

lol nice

true ridge
#

audio

willow ginkgo
#

im still working on the BASIC interface and driver interface for it

#

but it will be done soon

timber dawn
#

chop chop

willow ginkgo
#

whats the usual thing to do.... something to do with an apple and black and white animation?

plush estuary
#

Bad Apple in Retro Rocket?!?!

#

in this economy?!

timber dawn
#

no no no, its Black and White Apple Animation, not Bad Apple!

willow ginkgo
#

lol yeah, generic copyright free witch and apple music

timber dawn
#

perfect!

willow ginkgo
#
    load_module("ac97");

    fs_directory_entry_t* entry = fs_get_file_info("/system/webserver/test.raw");
    int16_t* data = kmalloc(entry->size);
    fs_read_file(entry, 0, entry->size, (unsigned char*)data);

    mixer_channel_t *music = mixer_open_channel();
    mixer_set_gain(music, 64);
    mixer_push(music, data, entry->size / sizeof(int16_t) / 2);

    kfree(data);
#

^ my test code for the mixer

willow ginkgo
#

really getting into the code now ๐Ÿ˜„

    void* wav_buffer;
    size_t wav_size;
    if (audio_wav_load("/system/webserver/test.wav", &wav_buffer, &wav_size)) {
        mixer_stream_t *music = mixer_create_stream();
        mixer_set_gain(music, 64);
        mixer_push(music, wav_buffer, wav_size_to_samples(wav_size));
        kfree(wav_buffer);
    }
willow ginkgo
#

IT WORKS!!!

willow ginkgo
tacit slate
#

oh nice

#

and nice documentation btw

willow ginkgo
#

ty ๐Ÿ™‚

willow ginkgo
#

this is one deep rabbit hole

willow ginkgo
true ridge
willow ginkgo
true ridge
#

oop

manic ridge
#

aac, ogg/vorbis, and opus?

maiden kiln
#

awesome

willow ginkgo
#

ii tried first to get stb_vorbis working before mp3, but it wouldnt compile, it does stupid shit like #including a c file instead of a header file, not letting me override the allocator properly

willow ginkgo
#

wont be adding AAC for now, it isnt a good fit for a kernel module. huge libs only like libfaac and the format is patent encumbered

heavy linden
willow ginkgo
#

I'm adding adsr envelopes next with square, sine, sawtooth and triangle waves

#

for those who like it oldschool

willow ginkgo
willow ginkgo
#

these tests dont really do the power of it justice; im not a musician

true ridge
#

its really cool tho

#

there should be like a tracker or something

willow ginkgo
#

yeah it's doable

#

I'm not musically talented enough to make it nice

#

or demonstrate it

#

really need a way to pitch bend samples for a proper tracker

maiden kiln
#

you could try to convert never gonna give you up

willow ginkgo
#

hahaha

#

i just converted the first few bars of bach

#

you know the famous church organ theme

#
REM The introduction to Bach's Tocatta and Fuges
REM Demonstration of ENVELOPE and SOUND TONE

ON ERROR PROCcontinue
MODLOAD "ac97"
ON ERROR OFF

REM Streams
STREAM CREATE lead1
STREAM CREATE lead2
STREAM CREATE lead3

REM ADSR envelopes
ENVELOPE CREATE 2, 1, 255, 128, 25,120, 220, 800, 0, 0, 0, 0, 0
ENVELOPE CREATE 3, 0, 220, 128, 10, 60, 180, 320, 0, 0, 0, 3,12
ENVELOPE CREATE 63, 0, 0, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0

REM tune
PROCchord(880, 20, 3)
PROCchord(784, 20, 3)
PROCchord(880, 100, 3)
PROCchord(100, 40, 63)
PROCchord(100, 40, 63)
PROCchord(784, 20, 2)
PROCchord(698, 20, 2)
PROCchord(659, 20, 2)
PROCchord(587, 20, 2)
PROCchord(554, 90, 2)
PROCchord(587, 90, 2)

REM wait for tune to leave buffer
SLEEP 6000
END

DEF PROCcontinue
ENDPROC

DEF PROCchord(rootHz, durCs, env)
    SOUND TONE lead1, rootHz, durCs, env
    SOUND TONE lead2, rootHz * 1.2599, durCs, env   ' major 3rd
    SOUND TONE lead3, rootHz * 1.4983, durCs, env   ' perfect 5th
ENDPROC
#

youre welcome to try, im not musically inclined

#

i found the notes

#

gonna give it a go

#

never gonna give it up

#

never gonna let you down

#

๐Ÿ˜„

willow ginkgo
#

hmmm i cant do it ๐Ÿ™

#

i suck at music

#

this can be a job for someone else

true ridge
rich scroll
true ridge
#

passport.mid on retro rocket

#

๐Ÿ”ฅ

rich scroll
willow ginkgo
#

hah

#

i looked into this, because i did find a midi of never gonna give you up

rich scroll
willow ginkgo
#

lol

#

nah im just going to add .mod support

#

midi is far too complex

willow ginkgo
#

mods ahoy! anyone for a rickroll?

willow ginkgo
#

i found a rickroll .mod in protracker format ๐Ÿ˜„

maiden kiln
willow ginkgo
#

its actually even better at 140ms per image

#

as thats the speed of the song in bpm

willow ginkgo
#

thats HDA driver support added, should cover most non-usb, non-hdmi audio devices out there

true ridge
#

144p 2fps

willow ginkgo
#

lol

#

thats intentional

#

i could run the frames at like 90fps

#

but it would just give people seizures

#

its not a video, its just 5 frames taken from the video

#

and i intentionally pixelated the frames

willow ginkgo
true ridge
true ridge
willow ginkgo
willow ginkgo
#

fix hda driver bugs, was playing everything at 48000hz not 44100hz

#

now works perfectly

true ridge
#

to be fair if you are listening to music even the slightest change will feel weird

willow ginkgo
#

it makes a huge difference to audio

#

its 8.84% faster and higher pitch

#

if you confuse the two

willow ginkgo
#

fixed all my maths primitives, log, pow, etc.

These are way beyond my ability to understand, the concepts are closer to "pure maths" than even comp sci. I used a combination of freebsd sources, libm, and chatgpt to figure out better solutions, because XM playback was skewing pitches of notes high due to assumptions i made in my simple implementation of pow, exp and log. theyre closer to the bsd and libm impl now, lots of floating point bit twiddling, little of it is understand. but, if bsd does it... means its battle hardened.

#

also, where i can, i used builtins.

humble bison
digital leaf
#

if you know what i mean

#

meaning a 200hz tone will sound significantly higher than a 100hz tone, but a 10100hz tone will not sound significantly higher than a 10000hz tone

#
  • you have to multiply a frequency by 2 to go up one octave instead of adding to it
humble bison
#

fair

Theres definitely an audible difference between 500Hz and 505Hz tone but tbh i wouldnโ€™t know if I wasnโ€™t presented both variants

digital leaf
#

audible, yes, significant, no

true ridge
willow ginkgo
digital leaf
#

I'm thinking of frequencies

#

But that too is a logarithmic scale

willow ginkgo
#

44100 to 48000 is hugely noticeable though and then add on top another bug that pegged all the notes up the top of the scale in the xm player

#

it was like the naff recorder version lol

digital leaf
#

It's about a 4khz difference so probably

willow ginkgo
#

currently integrating mbedtls, so i can make ssl connections

#

once i have that my proof of concept will be to send a discord webhook!

willow ginkgo
#

well, it's integrated! I "just" need to test it now and debug any oofs

willow ginkgo
#

SSL works!!!

REM Socket test
HOST$ = "yahoo.com"
PRINT "Connecting to "; HOST$; " ";
IP$ = DNS$(HOST$)
PRINT " (IP: "; IP$; ")... ";

SSLCONNECT FD, IP$, 443, HOST$
PRINT "Connected! Socket descriptor="; FD

PRINT "Writing..."
SOCKWRITE FD, "GET / HTTP/1.0"; CHR$(13); CHR$(10); "Host: "; HOST$; CHR$(13); CHR$(10); CHR$(13); CHR$(10);
PRINT "Reading..."
SOCKREAD FD, TEST$
PRINT TEST$
PRINT "CLOSING"
SOCKCLOSE FD

PRINT "CLOSED"
willow ginkgo
#

it was so secret, too!

willow ginkgo
#

taking a bit of a break from the really mind bending tls stuff, to add something simple

willow ginkgo
#

tree program!

narrow elbow
narrow elbow
tacit slate
narrow elbow
tacit slate
#

Well that was poorly worded, but cp437 fonts can support then too

willow ginkgo
#

but in this os you can redefine font glyphs too

willow ginkgo
#

now changed the efi.fat image to a gzip compressed one. now the installer takes much less space, cuts the entire iso down to 24mb!

#

just needed to include zlib to decompress it

#

or rather, a subset of zlib

willow ginkgo
#
PRINT "Loading... ";
SPRITELOAD bad_apple, "/images/bad-apple.gif"
CLS
AUTOFLIP FALSE

GCOL &888888
RECTANGLE 0, 0, GRAPHICS_WIDTH - 1, GRAPHICS_HEIGHT - 1

REPEAT
    PLOT bad_apple, GRAPHICS_CENTRE_X - 160, GRAPHICS_CENTRE_Y - 100
    FLIP
    SLEEP 66
    ANIMATE NEXT bad_apple
UNTIL INKEY$ <> ""

AUTOFLIP TRUE
CLS
END
wild sedge
#

Hell yeah

tacit slate
#

nice lol

willow ginkgo
#

i was going to do the music too but there are copyright issues of embedding the mp3 for bad apple in retro rocket's iso

digital leaf
#
  • including the gif is already just as dicey legally speaking as the music
willow ginkgo
#

that was an art project someone did much later

digital leaf
willow ginkgo
#

it is a grey area

true ridge
#

"generic girl with apple video"

willow ginkgo
#

sleep can go as low as 5 or even be removed

true ridge
#

fair

willow ginkgo
#

currently trying to make HDA work on real hardware

#

seems the firmware leaves it in a weird state

heavy linden
#

FW devs do be doing that

willow ginkgo
willow ginkgo
#

HARVESTING APPLES

willow ginkgo
#

lol, innit

true ridge
#

gdt innit trl

willow ginkgo
willow ginkgo
#

it's funny that I added a sound mixer and 3d graphics to retro rocket before paging functions. backwards lol. never needed them

true ridge
willow ginkgo
#

so I was fine just deep copying limines cr3, until now

true ridge
#

ah

#

fairโ„ข

#

vmm's are just kinda scary idk

#

thats probably another problem but yeah idk address spaces look evil

willow ginkgo
#

nvme support works! needs some testing, and has some weird crashes. dont risk it on real devices yet.

true ridge
#

its some old one idk

#

or new

willow ginkgo
willow ginkgo
#

virtio support is now added!

true ridge
willow ginkgo
#

[1829]: xhci.dbg: device VID:PID=0627:0001 class=03/01/01 mps=64 (port=5 speed=3)

nice, thats a usb keyboard!

willow ginkgo
#

I've had enough of USB, it isn't working quite right. it's a job for Ron

willow ginkgo
#

fixed FOR to support double STEP/TO

willow ginkgo
#

currently adding REGEX SUPPORT to BASIC

#

which required my libc to have wide char stuff

willow ginkgo
fossil pagoda
#

I don't think your website should look like this...

willow ginkgo
#

it used to be github wiki, i guess that didnt convert right to doxygen

#

omg, thats 10,000 lines

#

let me make a new one

willow ginkgo
willow ginkgo
#

i didnt write that all myself btw, i passed the old page thru chatgpt and told it to sumamrise, convert to markdown, and convert the values to decimals (cpuid command take decimal not hex)

#

no way i can write that quick lol

#

this is exactly what LLMs are good at imho, parsing and converting text from one form to another

willow ginkgo
#

added support for captures, so the i can finally write a HTTP lib using REGEX to process URL!

willow ginkgo
#

so ive spent like 4 days spelunking into the old code.

i wanted to make a BASIC library so i can PROCget a URL and then get the HTTP(S) content.

  • to do that i needed a HTTP library. wrote it with LEFT$, RIGHT$, etc, it was awful.
  • so i decided to integrate a regex lib
  • tried 3 different regex libs until i found one that worked
  • just to be able to parse urls better and split them!
  • to find that my http lib doesnt work because i'd put a blank line in the BASIC and my parser was being a dick
  • fixed that, to find that my http lib doesnt work because a REM statement with brackets and : in the text kills the parser (couldnt make this shit up)
  • fixed THAT, so now at least i can split urls!
#

before that, ive had to integrate a TLS lib so i can make https connections

true ridge
#

like make screenshot in the system

willow ginkgo
#

only on an installed system

true ridge
#

oh

true ridge
willow ginkgo
#

gonna start development of a package manager very soon!

willow ginkgo
willow ginkgo
#
LIBRARY LIB$ + "/http"

PROChttp_get("http://neuron.brainbox.cc/test.txt")
PRINT "HTTP status code: "; FNhttp_result$("code")
PRINT "Response body:"
PRINT FNhttp_result$("body")
#

easy to use lib ๐Ÿ˜„

tacit slate
#

Lol nice

willow ginkgo
#

currently working on a way to initialise and format a ramdisk from BASIC without an existing FS, so that there can be a ramdisk initialised when you start the live cd, giving you a place to save files and experiment properly.

#
REM Create a 1GB RetroFS ramdisk
RD$ = EMPTYRAMDISK$(1024)
MOUNT "/ramdisk", RD$, "rfs"
PRINT "Created RAM disk"
#

i mean what use is a live cd of an os designed for programming and tinkering, if you cant change anything

#

this will also give us somewhere to fetch http requested files to

willow ginkgo
#

decided we need a bootup mascot image ๐Ÿ˜„

heavy linden
#

what's its name?

latent tendon
#

Gdt initter

willow ginkgo
#

he's an owl because the bbc micro logo was an owl

willow ginkgo
willow ginkgo
#

should i put retro rocket into #1341905166907215954 ?

glad hemlock
#

The fact you can make drivers within your userspace is fucking insane

rich scroll
#

Yes

latent tendon
#

^

glad hemlock
#

Itโ€™s one of the most impressive feats Iโ€™ve seen here

#

Like thatโ€™s way higher level than almost everyone

#

Even the seasoned devs donโ€™t have that yet

#

I mean some have self hosting which I guess could count but still

willow ginkgo
#

this is because the userspace isnt a ring 3 userspace, and the security is handled by the language runtime

#

it lets me sidestep some stuff and do things that usually are the realm of microkernels

#

i'll cook up a submission later then ๐Ÿ˜„

glad hemlock
#

I wasnโ€™t necessarily talking about ring3

#

Imo thereโ€™s nothing wrong with running things in the kernel

willow ginkgo
#

really glad to see you got a place by the way, was worried for you

glad hemlock
glad hemlock
#

Love u guys

#

This is the only community I feel welcome and cared for in

#

Not even people at school or in my family are this supportive

#

Only you guys, my close friends irl, and my fiancee

#

Even tho my os is shit ๐Ÿ˜ญ๐Ÿ˜ญ๐Ÿ˜ญ

rich scroll
glad hemlock
#

Given the way he made the operating system Iโ€™m assuming it would be a simple process

#

Just another GDT entry

willow ginkgo
rich scroll
willow ginkgo
#

basically, you'd set the option, and it would build a page table for each or something

glad hemlock
#

Ahh

#

Like an argument

willow ginkgo
#

would be a lot more finicky to code for though

#

yup

glad hemlock
#

Command line argument Iโ€™m assuming?

willow ginkgo
#

like right now you have CHAIN "filename", booleanval and the booleanval is true if you want to background the process, false or missing if you want to basically waitpid on it

glad hemlock
#

Wait are the basic files executable after theyโ€™re ran

#

Like do they become elfโ€™s?

#

Or are they just done in real time

#

Do you have an executable format you use?

#

Or is it just interpreted basic

willow ginkgo
#

BASIC files are BASIC files, theyre interpreted

glad hemlock
#

I see

willow ginkgo
#

compiled basic would be .... challenging

glad hemlock
#

Yeah

#

Do you plan on supporting soemthing like a C compiler? Potentially self hosting?

willow ginkgo
#

if you want compiled code, the only option rn is kernel modules, dynamically loaded

#

unlikely i'd do that

#

self hosting means too close to posix/unix

#

which isnt really my goal

glad hemlock
#

Yeah

#

That was my goal initially but

#

My process subsystem is posix compatible

willow ginkgo
#

still havent decided how or if i'll allow kernel modules to extend basic, would be nice, but also means you have programs that dont run unless you load specific ko's

glad hemlock
#

file descriptors and stuff too

willow ginkgo
#

file descriptors are the only thing thats posix-ish

#

in retro rocket

#

under basic is a posix-like libc-like open(), read(), write(), close()

glad hemlock
#

Itโ€™s kinda hard to do a lot of things without file descriptors

#

Yeah my syscalls are posix compat

rich scroll
#

and most kernels have them

#

even if they aren't always called fds

glad hemlock
#

Yeah itโ€™ll use an equivalent

rich scroll
#

like, NT handles are basically the same thing

willow ginkgo
#

there really isnt any sane way to do files without some kind of handles/descriptors, even the BBC Micro had them

rich scroll
#

ditto on classic Mac OS

glad hemlock
#

My file descriptors are hella basic ๐Ÿ˜ญ

tall wedge
#

Is your basic jit

willow ginkgo
#

i have shortcut functions in retro rocket's low level stuff, where i can give a file lookup result, which is a direct ptr to a vfs node, and then call a method to get a piece of a file.

#

so instead of opening a file, i hold a reference to it and say "give me x kilobytes from offset y"

#

its the same thing i guess, sorta, except theres no reference count

glad hemlock
#

you will run into many issues at somepoint without it

willow ginkgo
#

not for the low level file read

glad hemlock
#

your fs WILL leak memory at some point if you dont have ref counting

willow ginkgo
#

low level file read is for stuff like early boot

glad hemlock
#

yeah but you can still leak memory which isnt preferable

#

especially since memory is precious in early boot

willow ginkgo
#

nah you cant leak it

glad hemlock
#

idk maybe im wrong

willow ginkgo
#

its not a hadle you open, its a vfs node, it exists while the file exists

#

heres an example from my installer

#
    fs_directory_entry_t* info = fs_get_file_info(source);
    if (info && !(info->flags & FS_DIRECTORY) && info->size > 0) {
        void *file_contents = kmalloc(info->size);
        if (!file_contents) {
            return false;
        }
        bool read_success = fs_read_file(info, 0, info->size, file_contents);
        if (!read_success) {
            error_page("Error reading '%s' (%s)\n", source, fs_strerror(fs_get_error()));
            kfree_null(&file_contents);
            return false;
        }
        int fh = _open(destination, _O_APPEND);
        if (fh < 0) {
            error_page("Error opening '%s' for writing (%s)\n", destination, fs_strerror(fs_get_error()));
            kfree_null(&file_contents);
            return false;
        }
        if (_write(fh, file_contents, info->size) == -1) {
            error_page("Error writing to '%s' (%s)\n", destination, fs_strerror(fs_get_error()));
            kfree_null(&file_contents);
            return false;
        }
        _close(fh);
        kfree_null(&file_contents);

        char message[MAX_STRINGLEN];
        snprintf(message, MAX_STRINGLEN, "Copying '%s' -> '%s' (%lu bytes)\n", source, destination, info->size);
        display_progress(message, progress + ((block_progress++) / 3));

        return true;
    }
#

the low level fs_get_file_info() and fs_read_file() are used to read the whole file in one slurp from source

#

and then posix-like handles to write it to destination

glad hemlock
#

ohh then yeah youre fine

willow ginkgo
#

because i never made an fs_write_file()

glad hemlock
willow ginkgo
#

kinda

#

fs_read_file() was made when all i had was iso9660

glad hemlock
#

my file data just points to a list of page pointers

#

lmao

willow ginkgo
#

by the time i got to fat32, retrofs, ram disks, i had the posix style open(... , O_CREAT)

glad hemlock
#

yeah fair enough

willow ginkgo
#

they map to a low level analog of fs_write_file but it made sense to just not make it a public api

glad hemlock
#

yeah thats a decent rationale

#

given you have the posix-like open()

willow ginkgo
#

open(), read() and write() and close() map to BASIC: OPENIN, OPENOUT, OPENUP, READ$(), BINREAD, BINWRITE etc

glad hemlock
#

very nice design actually

#

good stuff

willow ginkgo
#

did you venture into vfs yet

#

the vfs for me was one of the most fun things

glad hemlock
glad hemlock
#

THAT SHIT WAS SO FUN

#

FELT SO GOOD

willow ginkgo
#

especially because im not really following any spec or standard, so i didnt feel like i was just writing out a script

glad hemlock
#

that is probably my fav subsystem

glad hemlock
#

the op table, everything

#

it was lots of dopamine

#

very very fun

rich scroll
#

I love function pointers

willow ginkgo
#

my entire driver system is a bunch of function ptrs

glad hemlock
#

Top 5 C feature

#

i mean every lang has it but

willow ginkgo
#

basically:

typedef void* (*get_directory)(void*);
typedef int (*mount_volume)(const char*, const char*);
typedef bool (*read_file)(void*, uint64_t, uint32_t, unsigned char*);
typedef bool (*write_file)(void*, uint64_t, uint32_t, unsigned char*);
typedef uint64_t (*create_file)(void*, const char*, size_t);
typedef bool (*truncate_file)(void*, size_t);
typedef uint64_t (*create_dir)(void*, const char*);
typedef bool (*delete_file)(void*, const char*);
typedef bool (*delete_dir)(void*, const char*);
typedef uint64_t (*get_free_space)(void*);

/* Prototypes for block storage device drivers (see storage_device_t) */
typedef int (*block_read)(void*, uint64_t, uint32_t, unsigned char*);
typedef int (*block_write)(void*, uint64_t, uint32_t, const unsigned char*);
typedef bool (*block_clear)(void*, uint64_t, uint32_t);

typedef struct filesystem_t {
    char name[32];
    mount_volume mount;
    get_directory getdir;
    read_file readfile;
    write_file writefile;
    create_file createfile;
    truncate_file truncatefile;
    create_dir createdir;
    delete_file rm;    
    delete_dir rmdir;
    get_free_space freespace;
    struct filesystem_t* next;
} filesystem_t;
#

this is what i do

#

unerneath that, is a set of block device drivers, they just have read blocks, write blocks, trim blocks, get geometry

glad hemlock
glad hemlock
#

what do u think of mine

#

@willow ginkgo

#

sorry for ping lol

willow ginkgo
#

it's nice

#

but I would typedef the functions

#

just makes it a bit less symbol soup

glad hemlock
willow ginkgo
#

yup

willow ginkgo
#

really old screenshot lol

#

its interesting that ive started measuring kernel complexity by symbol count now

#

back then it had 381 symbols, now it has 5596 ๐Ÿ˜ฎ

glad hemlock
willow ginkgo
#

i do have lots of third party stuff in the kernel though

#

TRE, mbedtls, zlib, etc

glad hemlock
#

Nothing is third party in my OS besides Flanterm

#

I like suffering

wild sedge
#

256 symbols on x86-64 are just the idt sooo

willow ginkgo
#

hah, same

#

i dont know if theyre exported symbols though

#

likely are

#

i need the third party stuff - no way im implementing my own compression, and definitely never my own TLS/SSL

#

then theres stb_image too

willow ginkgo
#

found a 16 year old bug in retro rocket last night

#

if you run the os for long enough, the keyboard buffer pointer wraps around

#

when it wraps around producer < consumer, and it thinks the buffer is full

#

because some things were treating it as a circular buffer when it wasnt quite

#

fix was simple enough, change some < to != in kgetc and kpeek etc. but, that went unnoticed for longer than some people on this server have been alive lol

wild sedge
#

dang that kernel is old

digital leaf
#

how long ago did you start this thing

willow ginkgo
#

...16 years ago kekeke

#

the bug was in the ps2 keyboard driver

#

i only noticed it when i started mapping hci usb inputs to ps2 make/break codes

#

because i was hammering in kilobytes of garbage by keyboard mashing

digital leaf
willow ginkgo
#

wow that long ago

willow ginkgo
#

working on usb stick boot right now

#

been too long that I've had to say "lol use this obsolete metal pizza to boot the os"

willow ginkgo
#

UEFI USB BOOT!

timber dawn
#

does that say toilet extensions

#

the red square is kind of blocking some text i think

wild sedge
timber dawn
#

ohhh

#

well it couldve been anything yk

willow ginkgo
timber dawn
#

genius :D

willow ginkgo
#

need to actually write docs now on how to burn the os to usb, and boot from usb

willow ginkgo
#

usb boot support noiw fully documented!

void phoenix
#

is it any easier to make an OS in baaic than in C?

willow ginkgo
#

well, you cant make a whole OS in any dialect of BASIC im aware of

#

ive still had to make the kernel in C and make a BASIC interpreter

void phoenix
#

ahh okay that makes more sense, i thought this whole thing was written in basic i was wondering how you did it ๐Ÿ˜ญ

willow ginkgo
#

lol, that would be interesting to attempt

#

some of the BASICs support compilation to standalone executables (e.g. no separate runtime lib) but, they only compile for linux or windows, not freestanding environments

#

in retro rocket the entire userland is BASIC, right from the very first 'init' program

#

and you can even write drivers in BASIC if you want

void phoenix
#

that is cool as hell, im probably gonna do a similar thing with my kernel when i get the motivation to work on it again (maybe not with basic though), impressive as hell well done

willow ginkgo
#

thanks, what language would you use

#

i almost chose to use javascript because of people saying "you cant write an OS in javascript", was going to integrate libduktape

void phoenix
#

go seems pretty nice, i know it better than C at the very least and it can be freestanding with gcc

willow ginkgo
#

ah nice

void phoenix
willow ginkgo
#

go is interesting.

haksell has monads. go has gonads

#

if you ever get the urge to help me out, i welcome PRs and especially userland programs, writing retro rocket BASIC is easy af

void phoenix
willow ginkgo
#

luckily for everyone i took time to document the language an theres like 60 different examples already in /programs

#

BASIC was the beginners language before python

void phoenix
#

ill have a read through all this when im at my PC next, ill definitely be giving it a go asap

willow ginkgo
#

nice ๐Ÿ˜„

willow ginkgo
willow ginkgo
#

symbol file is now gzipped, its 40k instead of 205k

#

means its faster to load off usb/iso, and means that little less to download from github

willow ginkgo
#

fixed my msi support, so devices can at last enable msi and msi-x!

#

one bitmask value was wrong

willow ginkgo
#

added pci_setup_multiple_interrupts, have plans for it at a later date

willow ginkgo
#

now have support for S5 sleep/power button shutdown ๐Ÿ™‚

narrow elbow
willow ginkgo
narrow elbow
#

the mascot

willow ginkgo
#

probably because he is? you offering your amazing art skills?

willow ginkgo
#

I'm a developer not an artist and I refuse to use "programmer art" in anything I present to the world. I commission, or I generate

narrow elbow
#

the only problem

#

is that using an AI generated mascot people tend more to thing the entire thing is low effort (which obviously your OS isen't)

willow ginkgo
#

meh, I think those people might get left behind as the world changes around them

#

LLMs and generative models are a tool like any other

#

and while some are harping on about "they be stealing my data" (but were never concerned when Google were making profiles of their entire lives and selling it to any bidder) others are innovating. I'm not sure the future is in openAI and spending trillions on destroying the world, but long term this research will bring benefits to development

narrow elbow
willow ginkgo
# narrow elbow well it's that this people might think you use AI in your code and well AI coded...

ai found a bug in my code nobody here could,
it's oddly good at static analysis and analysing for issues. my IDT was off by one, and my ahci structs were misaligned, I had asked for help so many times and in the end I gave up and put my project away for a while. I was bored one afternoon and asked GPT if it could find the issue in the code stopping it booting on real hardware, pasted in the c files, boom, a couple hours later (it didn't work first time, had to iterate some) I had my os working for the first time on real machines

#

many people just outright dismiss LLMs as useless, hallucinatory, or plagiarism, but if you feed them your own content they are very powerful

willow ginkgo
#

but the code in my os pre dates LLMs by a decade, that gives it some weight too as not just "AI generated"

narrow elbow
#

they just read the readme or look at bit at thing and if they find something that look AI generated they call the whole thing AI ๐Ÿ˜”

#

i mean i can understand that you don't care about that kind of people

#

that probably what you should do actually

willow ginkgo
#

we create because we enjoy it

#

not to please someone who's got a stick up their ass and truly believes AI will take our jobs

#

I mean if you really think it will take your job, you were already replaceable by cheap foreign labour, or, you misunderstand the limits of LLMs and AI, there's always going to be a need for human creativity

#

and most importantly human review of generated output

#

because it messes up so often

humble bison
#

like I know exactly what I want and need to do, just not the syntax of the language
idk if thatโ€™s considered vibecoding

willow ginkgo
humble bison
#

I was doing that with GitHub copilot before it was cool
before chatgippity even existed that is
over time I found myself less and less reliant on it to build things, I guess thatโ€™s how I accidentally learned how to code

#

also your os looks really cool
might see if I can contribute something :p maybe some random userland thing
(my own project is kinda stuck with a very intermittent and annoying bug)

#

if my basic skillz from being bored with a calculator in math class arenโ€™t too rusty

willow ginkgo
#

I'm sure you're not too rusty

#

and thanks for the compliment ๐Ÿ™‚

willow ginkgo
#

now working on a virtio-net driver... but alongside it I now need a way to select a driver on a per subsystem basis with priority, so I can say like "load me a network driver compatible with my detected hardware" without having to load every single network driver and try them all

willow ginkgo
#

added a load order system, now you can go MODLOAD "net" and it will examine all network modules and load the ones you have

#

its fed from /system/config/loadorder.conf that looks like this:

[net]
1AF4    1041    *       virtio_net
8086    100E    *       e1000
8086    107C    *       e1000
8086    153A    *       e1000
8086    10EA    *       e1000
10EC    8139    *       rtl8139

[sound]
*       *       0403    hda
*       *       0401    ac97

[codecs]
*       *       *       flac,mod,mp3,ogg,xm
true ridge
willow ginkgo
true ridge
#

its a stupid powerpoint i made in 8th grade

#

absolute peak

willow ginkgo
#

have you seen the unicorn poopy potty ad?

true ridge
willow ginkgo
willow ginkgo
#

need to return to the roadmap! i got a bunch of stuff added in to make a package manager so people can download/upload their BASIC programs! will be working on this

true ridge
#

when the rocket is retro

true ridge
#

i mean this might actually be somewhat good but the problem is that there might be a lot of bad software on it

#

no quality control

willow ginkgo
#

I wasn't going to have strict review of uploads to it yet

#

basically just user ratings and reviews

#

more like an app store

#

there's no point blocking people's contributions, it's not big enough for that to make sense and all contributions are good for the project

#

the plan isn't a linux distro or anything like apt with it's internal politics

willow ginkgo
true ridge
#

i wish i could but i still dunno basic

#

i still have that core 2 duo laptop what if i actually install rr on there

willow ginkgo
#

you could write drivers instead, thats C

true ridge
willow ginkgo
#

idk, network drivers are always useful

#

i got e1000, rtl8139, and virtio-net-pci

true ridge
#

i think 99% of the stuff in my dell is proprietary and the non proprietary stuff you prolly made already

#

depression

willow ginkgo
#

network card might be realtek

#

8169 or such

true ridge
#

lemme check on it

#

windows 7 taking long on an ssd

#

or maybe modern tech brainrotted me

#

"intel 82567LM gigabit network connection"

#

fancy

willow ginkgo
#

hmmmm its an e1000 similar

#

my e1000 driver wont work on it, but i bet its not far off

true ridge
#

mayb

#

i wanna learn basic though im not gonna write drivers for an os idk how to navigate in

#

i think you made a documentation

#

absolute Docs

willow ginkgo
#

just added support for a ton of extra e1000 derived cards in the e1000 driver

#
[net]
1AF4    1041    *       virtio_net
8086    100E    *       e1000
8086    107C    *       e1000
8086    153A    *       e1000
8086    10EA    *       e1000
8086    10F5    *       e1000
8086    10CC    *       e1000
8086    10DE    *       e1000
8086    10D3    *       e1000
8086    1502    *       e1000
8086    150C    *       e1000
8086    15A2    *       e1000
8086    15E3    *       e1000
10EC    8139    *       rtl8139

thats quite significant coverage

#

i cant test all these, only own one of them and emulate the other via qemu

#

so YMMV

glad hemlock
#

Bro is a prodigy

true ridge
#

i need to check if my core2 laptops card is in the list

willow ginkgo
#

been too mentally exhausted to progress the past few days. just been gaming instead.

willow ginkgo
#

i need to improve my logger tbh

#

add log levels and categories

#

right now everything is just dumped to a dprintf ringbuffer

humble bison
#

is there an actual iso download for this or do i have to compile it myself

willow ginkgo
#

there is, or usb image

#

go to the github actions and grab it from the artifacts

#

the run.sh may need adjustments for your own use e.g. remove -vnc and the harddisk0

humble bison
#

ah neat

willow ginkgo
#

massively improved the speed of pci scanning ๐Ÿ˜„

true ridge
#

fire

willow ginkgo
#

fiiiire

#

๐Ÿ”ฅ

willow ginkgo
#

really need to get around to my package management system

true ridge
willow ginkgo
true ridge
#

idk

#

why is this so difficult

willow ginkgo
#

take a look at the os

#

nothing userland is compiled, or in C, perl, python, bash

humble bison
#

it in the title

true ridge
willow ginkgo
#

the package manager has to be written in BASIC like the rest of the OS and download/install BASIC programs, and also allow submissions of new packages

true ridge
willow ginkgo
#

it isn't actually very complicated client side I've just been lazy and a bit exhausted with dev

#

server side I need to make use of my day job skills, PHP, mysql, laravel

#

I already have client side support for https

true ridge
willow ginkgo
#

you been working on an os?

true ridge
willow ginkgo
#

ah yes lol

#

the kilovolts ass for the win

true ridge
#

i wanna rewrite it in c++ for some reason

willow ginkgo
#

I keep getting the urge to add c++ support to my kernel, things like templates and containers make a lot of things nicer

true ridge
#

terminal emulator had a heart attack

true ridge
willow ginkgo
#

yeah namespaces are awesome

#

my bigger more popular projects are c++

true ridge
#

my dad taught me classes but i forgor

willow ginkgo
#

like this one

true ridge
true ridge
true ridge
willow ginkgo
#

yeah it's only when you want stdlibc++ or exceptions things can get hairy

serene stirrup
willow ginkgo
serene stirrup
#

I use it a lot.

willow ginkgo
#

nice! its a small world ๐Ÿ˜„

serene stirrup
#

This is such an niche server but still has so many creators of libraries that I use

willow ginkgo
#

yeah lol we all gravitate to making OSes in he end

#

idk if thats something youll have used or heard of though

#

i havent contributed to that in decades though, i stepped back and let others take over

true ridge
#

no offense i was a 10 year old or smth

willow ginkgo
#

lol

#

maybe you also used winbot then, if you were on irc?

hot hound
willow ginkgo
#

lol ikr

#

but you can just use a stool (pun very much intended) and save money

true ridge
#

or you can move your toilet to be higher to like the point where its close to the ceiling, crap on the floor, and proceed to practice basketball throws

#

and/or not do the basketball part and not move the toilet and not crap on the floor

willow ginkgo
#

"missed... let's try that again*

#

when did this channel become discussion of how to poop, is this a subtle hint to do something so there's new technical chat

#

lol

willow ginkgo
#

I've improved the rendering time of sprites significantly by pre-swizzling the sprite buffer to the backbuffer/framebuffer pixel format, and also using traditional AND/OR with precalculated masks for transparent regions. makes things a LOT faster.

#

thinking of migrating the entire kernel/basic interpreter to strings with a length on the start (32 bit length) instead of null terminated. but this is a big thing, it will give me significant performance improvements in BASIC, but means a lot of changes. i dont need to really have null terminated strings everywhere as im not dealing with C at the user level

broken ivy
#

idk if it fits the project but what about a compressed BASIC mode, something like a bytecode or similar?

#

that could be cool

#

not like true bytecode tho

#

just the same BASIC code but for example 1 char per function

willow ginkgo
#

pretty soon tokens will need to be 16 bits

#

that wouldnt fit even just to represent keywords and operators, but I get the idea

true ridge
willow ginkgo
willow ginkgo
#

thinking of something like this to quickly make constant string types from c strings

#define S(lit) \
({ \
    _Static_assert(!__builtin_types_compatible_p(__typeof__(lit), char *), "S() requires a string literal"); \
    _Static_assert(!__builtin_types_compatible_p(__typeof__(lit), const char *), "S() requires a string literal"); \
    static const struct { \
        uint32_t len; \
        char data[sizeof(lit)]; \
    } s = { (uint32_t)(sizeof(lit) - 1), (lit) }; \
    (const string *)&s; \
})
#

then I can S("foo") and it will create an anonymous static struct containing the counted string

digital leaf
#

Because the struct is only in the scope of your macro

willow ginkgo
#

no, the struct is static

#

if I didnt use static you'd be right

golden stag
#

It might return a bad pointer or cause undefined behavior because of aliasing shenanigans though (struct string and the anonymous type of the hidden variable s may or may not be allowed to alias).

#

In C, they are probably allowed to alias. In C++ I'm not so sure though.

willow ginkgo
#

it is fine in C

#

but in C++ would be UB because it's type punning

#

in practice it's fine on x64 which is my only target now and forever. but, I don't have to worry about it. the kernel is only C

willow ginkgo
#

my plan for the start of 2026 is to release a proper 1.0

#

i need to get package management working, and perhaps have a 'try now' on the website that launches a qemu instance and webscockify

willow ginkgo
true ridge
#

wait it's name is rocky?

#

stickerโ„ข

willow ginkgo
#

yup

#

rocky the retro rocket owl ๐Ÿ˜„

true ridge
#

it owl

willow ginkgo
willow ginkgo
serene stirrup
#

You don't get famous by building an OS.

willow ginkgo
#

famous pfff, I'm not famous lol

#

and I guess you can get famous by writing an os if you're billions to one lucky and right place right time like Linus torvalds

willow ginkgo
#

im making a try it now page where you can just click and get a short lived vm session to try it online

#

running from a snapshot, so you can change the drive contents etc

#

im going to make this system a separate foss project, so other hobby OS projects can benefit from it

true ridge
#

26 minutes

#

is the time 30 minutes?

willow ginkgo
#

and boots you after 2 mins idle

willow ginkgo
willow ginkgo
#

this is the first version

#

it will likely change a lot

willow ginkgo
#

im thinking of making this the front page blurb of retrorocket.dev


Do you remember when a computer was justโ€ฆ a computer?

You turned it on, got a prompt, and typed what you wanted to do. No assistants listening in. No ads popping up. No endless background services sending telemetry somewhere you never agreed to.

Just you and the machine.

Computing used to feel direct. If you wanted something done, you told the computer exactly what to do and it did it. Fast, predictable, and under your control.

Retro Rocket brings that feeling back.

Itโ€™s a modern system inspired by the straightforward machines many of us grew up with. Simple, responsive, and focused on the joy of actually using a computer rather than fighting with it.

No AI hype.
No subscriptions.
No nonsense.

Just a computer that does what you tell it.

Welcome back to computing.

humble bison
#

sounds a bit too professional/hypeful, idk. If I saw that in the wild i might assume it to be vibe coded

just something about the writing style/paragraphs

digital leaf
#

it makes me think this was written with AI

tall wedge
#

Its not X its Y is a very ai style writing

willow ginkgo
#

those are the things we want NO of lol

willow ginkgo
#

seems to be too much "yeah it's my os idgaf if anyone uses it, they won't so why bother"

humble bison
willow ginkgo
#

I want to buck that trend, like I do with my other projects, put effort into SEO and visibility even if nobody cares

humble bison
#

totally subjective but nowadays SEO effort almost feels like a negative to me?

#

like it feels like it takes away credibility

willow ginkgo
#

like how people said don't bother promoting a discord lib... then got butthurt because I did, and all their users came to my project kekeke

humble bison
#

what is the library in question?

willow ginkgo
humble bison
#

neat

willow ginkgo
#

there were about 8 C++ libs when I started now there's only one active and popular

#

I think part of it is that I put effort into making it visible

#

the other part is, it's just well maintained and kept active

humble bison
#

personally Iโ€™m a discord.js user, idk if some string operation heavy thing like a discord bot could be fun in c++
then again I only have c experience and no c++

willow ginkgo
#

discord.js is like the standard

#

I'm not a big fan of js, it's not my favourite language

humble bison
#

got its fair share of flaws but js is my guilty pleasure lmao

willow ginkgo
#

if I have to I will use it for web frontend

#

but I don't like react, Vue etc

#

they all feel over engineered

hardy plover
#

oh my god

#

it's literally in basic

#

๐Ÿ˜ญ

#

I'm laughing so hard omg ๐Ÿ˜ญ

willow ginkgo
#

and making a good basic interpreter with tons of features from scratch was a fun challenge

willow ginkgo
#

been putting some thought into how to do event driven programs in BASIC.

BASICally (pun intended) you could register an interest in an event by name, the os will implement some names or you could broadcast your own to specific pids or broadcast to all or a group.... so you could do like

ON EVENT "something" PROCfoo

#

then you can e.g. just stick an infinite loop at the end of your program so it waits and triggers the events when they happen

#

would be cool to be able to register for socket readiness as EVENT like this.

humble bison
#

async basic, waow

#

sounds reasonable to me

willow ginkgo
#

sockets is first target of this, gonna be able to do epoll like events

willow ginkgo
willow ginkgo
#

now with support for e1000e ๐Ÿ˜„

willow ginkgo
#

Now with a sound driver for ASUS Xonar D1 sound device! i have no way to test it yet though. Got a card on order ๐Ÿ™‚

willow ginkgo
#

for now the driver is guesswork and staring at how linux does it

#

but i wanted to make a driver for a sound device that isnt hda, and isnt ac97 and still works on modern machines

#

and isnt usb

true ridge
#

fair

willow ginkgo
#

being as i got a driver for 8168 too, i could get my onboard networking running at last on my test machine so i dont have to rely on a pci e1000 network card

#

if i can get that working perfect, i have a spare pci slot i can put the sound card in

willow ginkgo
#

added support for DPCs ๐Ÿ˜„

willow ginkgo
#

so, i have 3 programs for retro rocket that i'd like to make, in no particular order:

  • Dragonfly - A side scrolling fast paced shoot-em-up inspired by R-Type
  • Voyager - A text mode web browser, with graphical enhancements powered by Retro Rocket's graphical terminal
  • Crypt Paint III - A full screen paint program

I'll get to each one when motivation takes me, or perhaps even work on all 3 at once and flit between them. Now getting to the point where what Retro Rockt needs are two things only:
User facing programs, and drivers.

Kernel features can wait!

#

When i say 'graphical enhancements' for the text mode browser, what i mean is forms that actually behave like forms, instead of showing an input box like:
[_________]
it will actuall show an input box etc. Can do this by the ability to redefine characters on the fly, plus the ability to draw primitives to the screen.

#

and yes, https will be supported, as TLS is already something Retro Rocket BASIC can do

#

crypt paint II is a reimagining of this, but with modern 32 bit colour, proper modern file loading etc:
https://www.youtube.com/watch?v=YrRIlAWKgvg

This was one of my first ever distributed and released programs back in 1997. Developed on the BBC Master 128K and available on one double-density double-sided 640K ADFS disk, It was available to the 8 Bit Software users group (8BS) where i released many of my earliest works before finding my way to PC development.

This program was pretty advan...

โ–ถ Play video
#

if anyone else has any ideas for any programs they'd like to make, feel free! i'll happily make them part of the OS, just send a PR ๐Ÿ™‚ check what you made works first though!

willow ginkgo
willow ginkgo
willow ginkgo
white shadow
#

Open Gl?

white shadow
willow ginkgo
willow ginkgo
white shadow
#

Oh

#

Itโ€™s pretty fast

willow ginkgo
#

yeah it is isn't it

#

I spent a lot of time optimising the graphics stuff

#

gonna add enemies to it later

#

but I noticed an interpreter bug I should fix first

#
FOR X = 0 TO 500
PROCfoo
NEXT
END

DEF PROCfoo()
    FOR Y = 0 TO 500
        ENDPROC
    NEXT
ENDPROC 

this exhausts the FOR stack

#

when I do ENDPROC or end a function with = while inside a loop it doesn't clear the loop from the stack

digital leaf
willow ginkgo
#

it does make the parser easier and it is much easier to read else you have the question of for example;

foo(j)

"am I looking at a call to foo function with parameter j, or am I looking at a reference to array foo fetching index j"

#

basically it forces variables and functions and procedures to all have their own individual namespaces

willow ginkgo
willow ginkgo
#

fixed, this also fixes a bug older than I am

#

BBC BASIC had this bug:

5 GOSUB 10
10 FOR X = 0 TO 10
20 RETURN
30 NEXT 

BBC BASIC has undefined behaviour. some programs on some MOS versions run out of space (No room) others crash the interpreter

Retro Rocket BASIC programs have defined behaviour. this one is RETURN without GOSUB

#

that bug is 50 years old, not joking

#

and yeah I had to think about what it would do kekeke

digital leaf
willow ginkgo
willow ginkgo
#

gonna add enemies to dragonfly next, I keep getting the urge to do unrelated stuff like parallax background, but, gotta stay on track!

willow ginkgo
#

now with multi line shell repl!

willow ginkgo
#

multiple entry PATH$ POGGERS

willow ginkgo
#

decided on a solution to california and colorado's bullshit

digital leaf
#

my solution: just ignore it

#

they can't sue me in romania for laws elsewhere

willow ginkgo
#

basically, show the Apache 2.0 license during installation, because why not? and have a bit at the bottom that says 'i confirm im legally old enough to agree to this license' which makes you over 18, or a liar (and if you lie, that isnt my problem according to the silly regulation, and what they gonna do, im in the uk)

willow ginkgo
#

but they could sieze my domain names, hosting, etc

digital leaf
#

but can they really

#

if they somehow pull that off you can always just get a .uk tld

willow ginkgo
#

yes, if they wanted to, if you were a big enough financial pain in the ass, or they wanted to make an example of you sure

digital leaf
#

they cant seize that one

willow ginkgo
#

unlikely, but possible

#

i happen to like my .dev tld ๐Ÿ˜„

#

besides, its nothing i shouldnt do anyway, as i didnt even place the apache license txt into my iso before

#

which i really DO need to do

#

and if im placing it on the iso, may as well show it at install time

#

(then nobody can say they didnt know what license the project is under)

willow ginkgo
#

added push and pop to rocketsh, to push and pop the current directory ๐Ÿ™‚

limber mica
#

unfortunately I live in the US, so I am slightly more worried pepepray but I do think the chances they go after a hobby project are slim to none

willow ginkgo
#

working on the assumption that the thing you're doing needs you to be over 18 (agreeing to software terms) while also acknowledging how silly the concept is

willow ginkgo
#

adding history to show the command history

willow ginkgo
#

if you tell the truth or not is not my concern, same as every other piece of software you agreed to the license to ๐Ÿ˜‰

#

i did make the wording a bit less strict, too

#
        centre_text("This software is licensed under the %sApache License 2.0%s\n", VGA_FG_YELLOW, VGA_RESET);
        centre_text("You must review the license before continuing\n");
        kprintf("\n");

        size_t next_offset = render_license_page(license, fsi->size, offset, box_x, box_y, box_w, box_h);

        gotoxy(0, box_y + box_h + 2);
        centre_text("By continuing, you confirm that you are able to accept this agreement\n");
        centre_text("and agree to the %sApache 2.0 license%s as shown above\n", VGA_FG_YELLOW, VGA_RESET);
#

its a lot less legalese ๐Ÿ˜„

narrow elbow
willow ginkgo
willow ginkgo
broken ivy
#

does it support binaries?

#

also does the basic code run in userspace

willow ginkgo
#

so you can poke around and do anything you want

broken ivy
#

me when i poke the APICtrl

willow ginkgo
#

technically, you can run a binary if its a kernel module, but thats not really 'a user facing executable'

broken ivy
#

i mean yeah

willow ginkgo
#

and BASIC can load and unload those modules

broken ivy
#

most home computers of the 80s had binary support

#

still makes sense to not support it

willow ginkgo
#

yeah

#

i didnt add an assembler though

#

considered it, but its not something i want to support because x86_64 asm is a nightmare

broken ivy
#

only support flat binaries๐Ÿ”ฅ

willow ginkgo
#

hah

willow ginkgo
#

kernel modules are ET_REL elf binaries

broken ivy
#

what about some sort of vm tho?

#

like an intermediary

#

something like RISC-V for example

willow ginkgo
#

hmm, i mean yeah, i could make a 6502 assembler for the luls

#

"heres your 64k of vm ram, go go go" ๐Ÿ˜„

#

not sure i have the time to make a risc-v emulator lol

broken ivy
#

i am on a quest to make a vm that interacts fully with the whole ram lmao

#

sort of a side project

willow ginkgo
#

lol sounds fun

broken ivy
#

for some of my projects

willow ginkgo
#

btw you can PEEK/POKE ram from BASIC

broken ivy
willow ginkgo
#

only one restriction: you cant POKE ram that isnt paged in and writeable, you cant POKE ram that isnt paged in and readable

#

you can also read and write IO ports

broken ivy
#

tho you can PEEK and POKE the page table?

willow ginkgo
#

i guess, but youd have to find it

broken ivy
#

dayum

willow ginkgo
#

i suppose if someone exported a pointer variable into every basic program.... from a module... lol

#

have you tried the web version btw

broken ivy
#

but i will try it on qemu

#

tomorrow

willow ginkgo
#

ah, yeah typing on phone is hard

#

the web version is a remote qemu

broken ivy
willow ginkgo
#

lol

#

phone ftl

broken ivy
#

i want to distribute my doohickey OS some day

#

tho its totally not finished

#

heck on the new rewrite i haven't got to the kernel yet

#

im still finishing the bootloader

willow ginkgo
#

technically im not at 1.0 yet

broken ivy
#

im not even at a version yet๐Ÿ˜ญ

willow ginkgo
#

but thats why im making more and more example programs, fun things, making the site nice and stuff

#

well, been at 0.0.1 for 17 years now

#

lol

#

just never bumped the version number

willow ginkgo
fervent nimbus
#

that's so cool

willow ginkgo
#

thanks ๐Ÿ™‚

#

it has music and sfx too but not in that video

willow ginkgo
narrow elbow
willow ginkgo
#

with sprite blitting and scaling

narrow elbow
willow ginkgo
#

whpx is CPU virtualization like kvm on linux

#

so without it software rendering sucks balls

willow ginkgo
#

added a pixel perfect SPRITECOLLIDE function ๐Ÿ˜„

#

also SPRITEWIDTH and SPRITEHEIGHT functions so i dont have to have an array of sprite sizes defined by hand

willow ginkgo
#

along with some optimisations to the hot path for sprite rendering, sprite render is now visibly faster (and it wasnt slow to start with)

willow ginkgo
#

added support for DATA, RESTORE, DATASET, DATAREAD, DATAREAD$, and DATAREADR, going to use these to store enemy timings ๐Ÿ™‚

tall wedge
#

It was similar but using text mode

#

and also lacked like almost all the features

willow ginkgo
#

lol, i think i'd like to see that

digital leaf
willow ginkgo
#

it was a pain to get it to work

#
c:\qemu\qemu-system-x86_64 -machine q35,accel=whpx -monitor stdio -smp 4 -cpu Westmere -m 4096  -drive id=disk,file=../../harddisk0,format=raw,if=none  -device ahci,id=ahci  -device ide-hd,drive=disk,bus=ahci.0  -drive file=rr.iso,media=cdrom,if=none,id=sata-cdrom  -device ide-cd,drive=sata-cdrom,bus=ahci.1 -boot d  -debugcon file:CON -netdev user,id=netuser,hostfwd=tcp::2000-:2000,hostfwd=tcp::2080-:80  -object filter-dump,id=dump,netdev=netuser,file=dump.dat  -device e1000,netdev=netuser -audiodev dsound,id=snd0 -device intel-hda -device hda-output,audiodev=snd0  -drive id=nvme1,file=../../harddisk3,format=raw,if=none -device nvme,drive=nvme1,serial=nvme-rr0
#

the important bits are obviously accel=whpx and not so obviously -cpu Westmere

digital leaf
#

Im sure it was

willow ginkgo
#

if you do -cpu max it just refuses to start

digital leaf
#

I decided not to bother

willow ginkgo
#

i spent hours on it a few months back and gave up, then came back to it recently and got it working in minutes

digital leaf
#

I just run it in TCG and thats usually good enough for me; when I need more performance I boot up a VM

willow ginkgo
#

i usually run it remotely and vnc in, from a linux machine with kvm

#

but that doesnt let me test sound, and it really cant cope with fast moving graphics well

#

so for this i boot the iso image over a samba share

willow ginkgo
#

im adding a custom language definition for hljs on the retrorocket.dev website

heavy linden
#

does Retro Rocket OS support multi processing?

willow ginkgo
#

it brings up APs and starts schedulers on them but the schedulers dont receive tasks

#

the IPI to hand them a task isnt implemented yet

willow ginkgo
#

feedback welcome on this ^ its aimed at people whove never programmed before

latent tendon
#

Cool

willow ginkgo
#

hljs's syntax highlight and language definition system is actually quite primitive

#

its just a bunch of arrays of keywords, and some regexes

#

so its 99% copy and pasting in the keyword lists from C

narrow elbow
willow ginkgo
#

added MIN, MAX, MINR, MAXR, TICKS to BASIC and used it for precise frame timing in Dragonfly ๐Ÿ˜„

#
LIBRARY LIB$ + "/dragonfly/loading"
LIBRARY LIB$ + "/dragonfly/player_bullets"
LIBRARY LIB$ + "/dragonfly/enemy_bullets"
LIBRARY LIB$ + "/dragonfly/player_ship"
LIBRARY LIB$ + "/dragonfly/enemies"
LIBRARY LIB$ + "/dragonfly/parallax"
LIBRARY LIB$ + "/dragonfly/explosions"
LIBRARY LIB$ + "/dragonfly/hud"
LIBRARY LIB$ + "/dragonfly/audio"

CLS
GCOL 0
AUTOFLIP FALSE

game_ticks = 0
frame_len = 0
PROCl1_parallax()
PROCmusic_start()
REPEAT
    game_ticks = FNframe(game_ticks)
UNTIL (INKEY$(CHR$(27)) <> "") OR (INKEY$("") = CHR$(27))
CLS
END

DEF FNframe(game_ticks)
    start = TICKS
    PROCl1_scroll_parallax()
    PROCl1_draw_parallax_rear()
    PROCmove_player_ship()
    PROCmove_bullets()
    PROCmove_enemies()
    PROCmove_enemy_bullets()
    PROCmove_explosions()
    PROCcheck_enemy_bullet_collision_with_player()
    PROCcheck_enemies_collision_with_player()
    PROCdraw_bullets()
    PROCdraw_enemy_bullets()
    PROCdraw_enemies()
    PROCdraw_player_ship()
    PROCdraw_explosions()
    PROCl1_draw_parallax_front()
    PROCdraw_hud()
    frame_len = TICKS - start
    FLIP
    SLEEP MAX(0, 16 - frame_len)
= game_ticks + 1
willow ginkgo
#

added a whole new bunch of keywords to retro rocket BASIC. they have wide reaching use, but i needed them for the shoot-em up:

I can use these to represent my level data as PNG files like the one below. doesn't look like much, but zoom in on desktop.

Once loaded, it can be rotated 90 degrees so each row represents a game tick, like those tapes in old automatic pipe organs where it had holes for notes. Using SPRITEROW gets me that row, i then call ARRAYFIND on that row for each colour representing enemy types. currently red, green and blue:

DEF PROCdo_spawns(moment)
    row = moment / 4
    IF row <= last_moment THEN ENDPROC
    IF row >= SPRITEHEIGHT(level_data) THEN ENDPROC
    SPRITEROW level_data, row, rowdata
    last_moment = row
    FOR e_type = 1 TO ENEMY_TYPE_COUNT
        ARRAYFIND rowdata, enemy_colours(e_type), found_spawns, spawn_count
        IF spawn_count > 0 THEN
            FOR I = 0 TO spawn_count - 1
                PROCalloc_enemy(e_type, GRAPHICS_WIDTH, found_spawns(I))
            NEXT
        ENDIF
    NEXT
ENDPROC
narrow elbow
willow ginkgo
willow ginkgo
wild sedge
#

gaming

narrow elbow
tacit slate
willow ginkgo
#

thanks, yeah ๐Ÿ™‚

#

its very very hard to play via novnc though lol

#

the fact that it CAN be played there though?

willow ginkgo
#

should just use memset and rdtsc()

willow ginkgo
#

also to-do: add csprng_random to return uniform distribution in range and fill buffer of arbitrary size

willow ginkgo
round sparrow
#

didn't realise retro rocket was on here. i think it's awesome! ๐Ÿ˜„ when i was at school, almost all the computers were bbc micros or masters. they hardly let me code on them though. ๐Ÿ™ but in 2014 or so, i got bbc basic for sdl on my phone and was blown away by the teletext sim, including the demo/test pages exactly as they were in the 80s, and the BBC COW graphical earth which was so awesome on tv in the 80s, some graphics demos i'd seen in the 80s plus 1 or 2 which needed GLSL shaders all done with BBC BASIC. oh and sky baby which i've actually used a few times. maybe you should import some of its example programs. ๐Ÿ˜„ i'm not sure how their licenses look these days, especially sky baby's, unfortunately. i much prefer sb to modern glitzy stargazing apps

willow ginkgo
#

hah, nice, a fellow beeb fan

#

unfortunately many programs wont work right

#

we do support 90% or so of BBC BASIC's behaviour, but we have different syntax for variable types

round sparrow
#

ohh yeah, % for floats. i did see that

willow ginkgo
#

BBC BASIC:
integer: % e.g. FOO% with special behaviour of A% through Z% stored below PAGE
float: no suffix
string: $ e.g. STRING$

RETRO ROCKET:
integer: no prefix
float: '#' e.g. 'PI#'
string: $

#

so where BBC BASIC defaults to real/float, we default to integer, as its saner

#

and suffix reals

round sparrow
#

right

willow ginkgo
#

also retro rocket basic has a more modern view of the way things should work, line numbers are discouraged

#

modularisation by LIBRARY is strongly encouraged too

round sparrow
#

bb4sdl doesn't even support line numbers iirc. modularization is pretty old-school though

willow ginkgo
#

i didnt go for full on classes and objects

#

never thought it very BASIC

round sparrow
#

no, me either

willow ginkgo
#

also ? and ! operators are not in retro rocket basic, i went for explicit PEEK/POKE instead

#

i did like ? and !, but they really complicate expression parsing and make for expressions that might accidentally poke ram, instead PEEK/POKE are explicit

round sparrow
#

ooh... i forgot about those. didn't like them either, i like explicit poke. unless it's forth where all stores go via !, but that's consistent and it doesn't complexify parsing