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

1 messages · Page 5 of 1

gritty osprey
#

you can also try setting the alignment to 32

#

which will also force clang to realign to test this

willow ginkgo
#

asm stub -> fred_ring0_entry -> IRQ() -> fxstor -> *bang*

light ice
#

Yes because the stack isn’t aligned

willow ginkgo
#

im trying 64, i'll let you know (i'd already put 64 in before you suggested)

gritty osprey
#

when you are in the middle of a function, rsp ≡ 0 (mod 16)
right after a call, rsp ≡ 8 (mod 16)
then the compiler pushes something (rbp or whatever else) and rsp ≡ 0 (mod 16) again

#

if you offset everything by 8 bytes the compiler doesnt know and will maintain the (wrong) alignment

willow ginkgo
#

i think we're having some luck with 64

#

will let you all know for sure shortly on next run

#

btw its really great to see multiple people chatting in here 😄

#

i guess deep technical FRED stuff gets peoples blood pumping lol

#

it works 🙂

light ice
#

I think this is just because SIMICS don’t have the same network card?

willow ginkgo
#

it does but its a different revision or something

#

so it finds the driver, the driver issues a hard pass on that

#

and i didnt put init handling in for that lol

#

i'll add it now

#

we're FREDDED

#

multi-fredded? haha

light ice
#

GG

willow ginkgo
#

hmmm i broke IDT

#

howwwww

light ice
#

💀

#

Lmfao how

willow ginkgo
#

something to do with timer interrupt, idk yet

willow ginkgo
#

all working!

willow ginkgo
#

@light ice was the blue role only for you as the first fredder?

#

tidying up all the code a bit now 😄

light ice
#

And now it is my mission to infect the world with FRED

willow ginkgo
#

BEGIN THE INFECTION

#

no chance i could become blue to help infect? lol

#
/**
 * @file fred.c                                                   ~~~~
 * @author Craig Edwards ([email protected])              []
 * @copyright Copyright (c) 2012-2026                            []
 * FRED: Flexible Return and Event Delivery                      []
 *                                                               []
 * Like Fred Dibnah at the foot of a mill chimney, this only    [  ]
 * works if every stack is there, upright, and built before     [  ]
 * lighting it!                                                [_n__]
 * -- https://en.wikipedia.org/wiki/Fred_Dibnah
 */
#

i decided on this instead of fred flintstone

willow ginkgo
#

aw

light ice
#

FRED is alot cleaner though isn’t it

#

It will also allow for more than 256 interrupts too

#

Given you demultiplex it

willow ginkgo
#

yup fred is the GOAT

#

i think i owe you a thanks in the code tbh

light ice
#

Feel free to drop a link to my implementation and blog post if you want

#

Being fred.c fred.h and fred.asm

willow ginkgo
#

sure! please give urls

willow ginkgo
#
/**
 * @file fred.c                                                   ~~~~
 * @author Craig Edwards ([email protected])              []
 * @copyright Copyright (c) 2012-2026                            []
 * FRED: Flexible Return and Event Delivery                      []
 *                                                               []
 * Like Fred Dibnah at the foot of a mill chimney, this only    [  ]
 * works if every stack is there, upright, and built before     [  ]
 * lighting it!                                                [_n__]
 * -- https://en.wikipedia.org/wiki/Fred_Dibnah
 *
 * Implemented with lots of assistance from Evalyn Goemer!
 * References:
 * https://evalyngoemer.com/blog/2026/04/11/implementing-fred/
 * https://git.evalyngoemer.com/evalynOS/evalynOS/src/branch/main/kernel/src/arch/x86_64/drivers/fred/fred.c
 * https://git.evalyngoemer.com/evalynOS/evalynOS/src/branch/main/kernel/src/arch/x86_64/drivers/fred/fred.h
 * https://git.evalyngoemer.com/evalynOS/evalynOS/src/branch/main/kernel/src/arch/x86_64/drivers/fred/fred.asm
 */
#

there, good? 😄

light ice
#

Yes ^^

#

Ty

willow ginkgo
#

yw 🙂 thank you!

light ice
#

Btw @willow ginkgo do you post on the OSDev Reddit?

#

I could have sworn I’ve seen some of your stuff there?

willow ginkgo
light ice
#

I’ve considered posting about my FRED stuff on there

#

But id just get mogged by shrekOS 😭

willow ginkgo
#

meh thats just an image loader

#

i dont understand what amuses people over on that sub

#

233 upvotes for a shrek image, but i struggle to get 40

light ice
#

Slop. They don’t understand anything technical so they just see oo shrek and like it

willow ginkgo
#

like how does a pic of of shrek beat astral

light ice
#

It’s shrek and it’s Reddit

willow ginkgo
#

its a 16 bit real mode os using vga mode 13h made in 100% assembly. this took me a very long time and I just wanted to share my accomplishment uh...

willow ginkgo
#

you should write an osdev wiki page on it

light ice
#

maybe

#

i still need to fix my syscall/sysret page

willow ginkgo
#

or edit the idt page to be a fred page

latent tendon
willow ginkgo
#

who cares about porting

willow ginkgo
#

not png

serene stirrup
light ice
serene stirrup
#

first os to run bash on FRED

light ice
#

just be warned

#

i run bash on FRED

#

:p

willow ginkgo
#

fred is quite nice

light ice
#

I just don’t have a fork in my old kernel lol

light ice
#

And I don’t wana hack more shit together

#

Which is why I did a rewrite

serene stirrup
light ice
#

Just be warned @serene stirrup

serene stirrup
#

You run bash --version

light ice
#

No?

serene stirrup
#

oh no fork

light ice
#

its still bash

#

:p

serene stirrup
willow ginkgo
light ice
willow ginkgo
#

exactly lol

serene stirrup
#

Do you run Python?

light ice
#

I have doom

#

And bad apple

#

I run stuff on FRED

#

Omg 😭

#

It’s not nothing

serene stirrup
#

Ohh ima be the first one to run x11 on FRED

#

Just need to port x11 and FRED first

light ice
#

@ infy quick port fred

serene stirrup
#

Which one of us does it first 🙏

light ice
#

You ere considering it

light ice
#

🥀

serene stirrup
light ice
serene stirrup
#

Wat os did infy run now

serene stirrup
#

i just know its something that you port

light ice
#

It’s just a new interrupt mechanism

serene stirrup
#

but have no idea what it actually is

light ice
#

That’s it

willow ginkgo
light ice
#

Not routing

#

Just the delivery etc

willow ginkgo
#

yeah perhaps wrong word

light ice
#

It also takes in syscalls too

willow ginkgo
#

it replaces IDT

serene stirrup
willow ginkgo
#

its a lot simpler tbh

serene stirrup
#

that is easy

light ice
serene stirrup
#

just create a interrupt.c file thats a wrapper

willow ginkgo
#

only one huge downside, rn only the very latest INTEL cpus support it

serene stirrup
#

and then fred.c

willow ginkgo
#

not AMD yet but theyve pledged to join in

light ice
#

or look at my old impl for userspace & syscall stuff integrated

willow ginkgo
#

yeah the only downside really is

serene stirrup
#

is it just that

#

i could do that today

light ice
#

its really basic

willow ginkgo
#

if you want to add it to your OS you gotta use a clanker patch to qemu, have a very very new intel cpu, or use SIMICS

serene stirrup
#

but how tf do i test it

light ice
#

And the only option when I made it was SIMICS

#

And well SIMICS

willow ginkgo
#

the only option i had patience for was simics 😄

willow ginkgo
light ice
#

Trueeee

serene stirrup
#

or well easier

light ice
#

It would need some edits to make it square tho

serene stirrup
#

i dont want to compile qemu from source

light ice
#

It’s not bad

serene stirrup
light ice
#

My PC can do it very fast

serene stirrup
#

In your system still?

light ice
#

Yes but you need to build from source with clanker patches

#

And it’s dependent on my system

#

I update arch

#

I have to rebuild

#

💀

willow ginkgo
#

you use arch btw

#

😄

light ice
#
#

@serene stirrup you will need this tho

latent tendon
#

I think I understand the Fred spec

#

Its pretty damn simple

light ice
#

now implement it before wicks

#

Honestly if it were on more CPUs it could make it less of a hastle to get into OSDev

#

Because I know like so many people who got tripped up on the idt

latent tendon
#

Yeah the only reason I haven't yet is because there's basically nothing to properly test on

light ice
#

SIMICS & Vibe coded QEMU or new intel laptops

#

worst case you patch it when sombody tests irl

#

Btw @latent tendon can you get that ISO. I got IRL stuff to do later and don’t wana have to wait when I’m tired etc

willow ginkgo
#

IOAPIC and routing

light ice
willow ginkgo
#

you can get by without that for the simplest of onboard stuff like keyboard, mouse

#

but the minute you start dealing with PCI(e) devices, you need it, AND also MSI(X)

#

we were all n00b once

light ice
#

IOAPIC isn’t too bad. It’s basically saying send this external IRQ to this internal one to this LAPIC making sure you read ACPI for any overrides

willow ginkgo
#

no the bad part is finding out where to tell ioapic to send it

#

which you need ACPI for

#

good job we have uacpi

light ice
#

I managed to parse it myself mmLol

#

It worked on all the hardware I tested it on atleast

willow ginkgo
#

sure, you can

light ice
#

AML is the hard part

serene stirrup
pearl gyro
#

or if the device has a quirky msi but those weird devices aside

willow ginkgo
#

yeah, then there's the tons of different ways to do a timer

#

that one trips up newbies because so many PIT tutorials

pearl gyro
#

yeah the timer situation on x86 is a mess

willow ginkgo
#

in the end i went with local apic timer

#

the only question left when you choose that path is what to calibrate it with

light ice
serene stirrup
light ice
#

And saying I don’t have bash ported

light ice
#

Fuck

#

😭

willow ginkgo
#

quick get them before evalyn deletes the message

serene stirrup
light ice
willow ginkgo
#

ik lol

light ice
#

@serene stirrup Your gonna wana test SIMICS anyways

serene stirrup
light ice
#

As it’s the source of truth

serene stirrup
#

ima also try and get bochs running

light ice
#

Hope

#

Nope

#

Won’t work

serene stirrup
#

or how tf do you spell that

light ice
#

I’ve tried it

#

Don’t do it

#

💀

#

Bochs is botched

willow ginkgo
#

it always bochs stuff up?

#

😄

#

i think we're supposed to pronounce it "bocks" (box) but ive always read it in my head as "botch-es"

#

the way its written is too german for my english mind

serene stirrup
#

but you don't have any functional bash ported

willow ginkgo
#

hmmm, people have been chatting about FRED since 2021

#

i didnt realise it was part of the X86-S spec

light ice
light ice
serene stirrup
light ice
#

😭

serene stirrup
#

👈 😆 kernel shell

#

imagine not using a real shell

light ice
#

My new kernel will show you

#

I will make a proper VFS

#

And make fork work

#

It’s not that bad

serene stirrup
#

have fun

#

jk

#

not gonna be mean

light ice
#

I’m gonna make paging code and slab allocator soon

#

and vmem

#

Then I can whip up AP init and scheduler stuff and then crap our a VFS

#

And then I’m like 80% the way there

willow ginkgo
#

a kernel language true

willow ginkgo
#

many retrorocket

light ice
#

🔥

#

Now just pay 1 grand for a new laptop to test FRED

gritty osprey
#

lol

sharp crag
light ice
#

:p

sharp crag
light ice
#

You

sharp crag
#

prob from some dedi-server provider

light ice
#

Still need a laptop

#

I don’t think any server cpus have it yet

sharp crag
#

oh

willow ginkgo
#

now with dump command 😄

light ice
#

And would be more expensive than a laptop

sharp crag
light ice
#

Your not getting a server with FRED for 20 euros lol

#

Good fucking luck

sharp crag
#

it depends

light ice
#

Diamond rapids isn’t even out yet lol

#

There are no server CPUs with it

#

Only laptop ones

#

Being pantherlske

willow ginkgo
#

what chipsets support it

#

or cpus

light ice
#

Panther lake

#

That’s it

#

Third gen core ultra Intel

#

So like 3XX iirc

willow ginkgo
#

updatd my interrupt docs page

willow ginkgo
#

i think if i had one of these i'd likely be doing mucn more than osdev on it

light ice
#

That should support it

#

I mean yeah you would do more

willow ginkgo
#

cant exactly afford one lol

#

not even at normal pricing

light ice
#

There are cheaper models

#

I’ve seen go down to 800 USD

#

On Best Buy

#

Thinkpads are just hella expensive

willow ginkgo
#

my current thinkpad is old, but overspecced for what i do

#

i do most of my osdev on my home server, thats why you see it via tightvnc

serene stirrup
willow ginkgo
#

hmm just had a crazy thought, wouldit be possible to run one CPU of an SMP system with an IDT and another with FRED

serene stirrup
willow ginkgo
#

at the same time

serene stirrup
willow ginkgo
#

retro rocket doesnt run native programs, so it cant virtualise

#

but it can start its own shell from within its shell

#

😄

willow ginkgo
#

idk why anyone would want to

light ice
#

Though I don’t know why

willow ginkgo
#

yeah lol

light ice
#

Unless it’s a big.little design

willow ginkgo
#

for shits and giggles

light ice
#

That for some reason dropped FRED on some cores

willow ginkgo
#

i get the feeling FRED is one of these things where some point in the future intel or amd will declare theyre deprecating IDT (not removing) and the word 'deprecating' will get everyone in a flap "but my os doesnt do this yet"

light ice
#

It is behind a feature bit

#

So it’s honestly fine

#

They don’t need to deprecate it

#

Just put it on the slow paths after a few generations

#

Same with real mode etc

willow ginkgo
#

IDT is already the slow path

#

lol theres a pattern in my thread subscriptions

#

wide name, narrow name, wide name....

heavy linden
willow ginkgo
#

lmao qemu-basic

#

that would suck

uncut quiver
willow ginkgo
#

that would be silly, like a doom module

#

"because I can"

light ice
#

You could implement the doom engine in BASIC and then just have that run the WAD

uncut quiver
willow ginkgo
uncut quiver
willow ginkgo
willow ginkgo
#

I need to stop getting side tracked with new shiny and get a 1.0 stabilised

willow ginkgo
#

BBC BASIC detokeniser!

willow ginkgo
willow ginkgo
#

fixing up the irc client

willow ginkgo
willow ginkgo
#

IRC client docs page

#

connected to the osdev irc channel on libera and had a long chat

tacit slate
#

That's cool, nice work

willow ginkgo
#

ty 🙂

still hearth
#

there are a problem when i try to launch in the web retro rocket os

light ice
#

Will you manage to beat shrekOS

#

😭 🙏

willow ginkgo
willow ginkgo
#

ah there we go, fixed

#

I had left my own copy running and it was holding the lock on the harddisk0 file

willow ginkgo
#

the next retro rocket project:

a web browser

going to be called Voyager and of course it will be written in Retro Rocket BASIC.

still hearth
#

is it possible to rewrite retro rocket OS in basic or this is impossible

uncut quiver
still hearth
#

oh ok

heavy linden
willow ginkgo
#

nah, http, https with tls 1.3, images, enhanced text browser

#

think like elinks with images and forms

#

I'm going to convert html to an enhanced form of markdown then render that

#

this will let the browser render html, markdown, text

#

no js, no css, not really a "chrome like" browser

#

because that's a time sink and a cause of frustration and an impossible mountain to climb alone

willow ginkgo
#

yeah you'd need an llvm frontend or something

heavy linden
#

Basic JIT when troll

willow ginkgo
#

I'm not making one lol it's already fast

willow ginkgo
#

made a nicer cpuid system for detecting Fred, ERMS etc

willow ginkgo
#

and added a new memcpy variant for screen backbuffer copying on systems that don't have ERMS, they fall back to SSE2

willow ginkgo
#

added ARRSORT and ARRSORTBY to BASIC and now using them in the 3D demos 😄

willow ginkgo
#

adding map types. basically a basic-accessible hashmap

willow ginkgo
willow ginkgo
#

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

#

I'm sick of virtue signalling about AI. ^ This title change should be enough here.

serene stirrup
willow ginkgo
#

just didn't have the started 2009 in

#

I decided it better to put that than stick any pro or a anti AI label in here. I do use AI, for docs, analysis, reverse engineering drivers, searching standards etc, but obviously if the project has been about since 2009 it can't really be vibe coded true

willow ginkgo
#

added:

  • MEMREALLOC
  • MEMCOPY
  • MEMMOVE
  • MEMSET

as BASIC calls

also fixed:

SOCKBINREAD keyword offered no way of returning the actual number of bytes read, so now:

SOCKBINREAD integer-socket, integer-buffer, integer-length [, length-read-variable]
buf = MEMALLOC(4096)
SOCKBINREAD client, buf, 4096, amount_read
REM ... process buffer ...
MEMRELEASE buf
willow ginkgo
#

ive come up with a way to make my string representation binary safe, without migrating everything from C strings to counted strings

#

i'm using this to escape binary inputs 'at the border' for socket functions

#

which will be needed when it comes to downloading images to memory to display them

willow ginkgo
#

colour list and libraries/http improvements!

willow ginkgo
#

made quite a few under the hood improvements to how I concatenate BASIC strings and how I fill them into the arena

#

it's a ton faster now again

narrow elbow
willow ginkgo
willow ginkgo
#

cpu percentages now in proclist 🙂

willow ginkgo
#

made dir use human readable sizes

willow ginkgo
#

adding better detection of BASIC programs without needing execute attributes or mime types

narrow elbow
willow ginkgo
#

it's a bit different and a bit odd compared to how you'd do it with interrupts because the task switching isn't timer driven

#

it's done on a rolling average of the last 32 samples with samples taken every 150ms

willow ginkgo
#
static void proc_update_cpu_usage(void) {

    uint32_t runnable = 0;
    const uint8_t cpu = logical_cpu_id();

    for (process_t* cur = proc_list[cpu]; cur; cur = cur->sched_next) {
        if (cur->state == PROC_RUNNING) {
            runnable++;
        }
    }

    for (process_t* cur = proc_list[cpu]; cur; cur = cur->sched_next) {
        uint32_t sample = 0;

        if (runnable && cur->state == PROC_RUNNING) {
            sample = 100 / runnable;
        }

        cur->cpu_percent = ((cur->cpu_percent * 31) + sample) / 32;
    }
}

uint32_t proc_cpu_percent(pid_t pid)
{
    uint32_t perc = 0;
    process_t* proc = NULL;
    lock_spinlock(&combined_proc_lock);
    proc_id_t* id = hashmap_get(process_by_pid, &(proc_id_t){ .id = pid });
    if (id) {
        proc = id->proc;
    }
    if (proc) {
        perc = proc->cpu_percent;
    }
    unlock_spinlock(&combined_proc_lock);
    return perc;
}
#

proc_update_cpu_usage runs off a 150hz timer attached to the 1khz interrupt, task switches do not, they can run a lot faster

#

proc_cpu_percent is the helper BASIC uses

willow ginkgo
#

added TCP fast retransmit, and send now honours peer MSS

willow ginkgo
#

added window scaling to TCP

willow ginkgo
#

ive finally made it so that TCP errors can surface up to BASIC

#

also improved how i find free FDs in the FD table:

int tcp_allocate_fd(tcp_conn_t* conn) {
    __m128i all_ones = _mm_set1_epi32(-1);
    for (size_t word = 0; word < FD_WORD_COUNT; word += 2) {
        __m128i v = _mm_load_si128((const __m128i*)&fd_used[word]);
        __m128i eq = _mm_cmpeq_epi32(v, all_ones);
        int mask = _mm_movemask_ps(_mm_castsi128_ps(eq));
        if (mask != 0xf) {
            uint64_t free_bits = ~fd_used[word];
            if (free_bits != 0) {
                unsigned bit = __builtin_ctzll(free_bits);
                size_t index = (word << 6) + bit;
                fd_used[word] |= 1ULL << bit;
                fd[index] = conn;
                return (int)index;
            }
            free_bits = ~fd_used[word + 1];
            if (free_bits != 0) {
                unsigned bit = __builtin_ctzll(free_bits);
                size_t index = ((word + 1) << 6) + bit;
                fd_used[word + 1] |= 1ULL << bit;
                fd[index] = conn;
                return (int)index;
            }
        }
    }
    return -1;
}
#

uses SSE2 and a bitmask of available fd slots:

_Static_assert((FD_MAX & (FD_MAX - 1)) == 0, "FD_MAX must be a power of two");
#define FD_WORD_BITS (sizeof(uint64_t) * 8)
#define FD_WORD_COUNT (FD_MAX / FD_WORD_BITS)

static tcp_conn_t* fd[FD_MAX] __attribute__((aligned(16))) = { 0 };
static uint64_t fd_used[FD_WORD_COUNT] __attribute__((aligned(16))) = { 0 };
#

can search 128 slots at a time

#

once its found a value with a free bit it uses CTZLL to find out which bit, and allocates there

#

if youre curious, FD_MAX is currently 1024.

willow ginkgo
willow ginkgo
#

can now directly use this as a shell builtin to sandbox a program against anything that can change the system

#

but i should have called it sudont kekeke

#

like sudo but in reverse

uncut quiver
willow ginkgo
uncut quiver
#

(I need to convert this to an array of char pointers)

willow ginkgo
uncut quiver
willow ginkgo
#
  • ask your doctor if Serpyntyne is right for you
  • side effects may include loss of scalp and penis
  • I'm gonna make my own os! with blackjack! and hookers!
  • try new berry flavour
#

@uncut quiver ^ trl

#
  • this kernel error is an off duty Bolivian traffic warden
#
  • so long, and thanks for all the fish
#
  • ring 0 to rule them and in the darkness bind them
narrow elbow
#

only allow some keywords

uncut quiver
willow ginkgo
#

theres only a small handful of "unsafe" keywords/functions, and a slightly larger set of "change" functions/keywords (MKDIR, DELETE etc)

narrow elbow
willow ginkgo
#

i wont forget 😄

#

i dont think i need any more unsafe keywords now tbh

#

99% of what im making now is basic libs, in basic, instead of new keywords

willow ginkgo
#

added support for uefi boot from cdrom

#

and csm boot from usb

#

also added a new BASIC lib called multidim

willow ginkgo
#

😄

willow ginkgo
#

ive improved the performance of symbolication, and profiling

#

it is now fast enough that for many functions i can run it with profiling on and the performance difference is maybe 2x to 3x speed decrease instead of 20x to 30x

#

it can even profile interrupts 😄

willow ginkgo
#

added docs for profiling

willow ginkgo
#

managed to make retro rocket basic 10x faster

#

literally ten times

#

😄

#

every time around the scheduler loop i was checking for pending DPCs and timers

#

it only needs to happen once per millisecond

willow ginkgo
#

added support for the £ symbol on en-GB keymap (or any othe symbol anyone may want) - keymaps now let you redefine glyphs

willow ginkgo
willow ginkgo
#

lots of new keymaps

willow ginkgo
#

How to shoot yourself in the foot with Retro Rocket BASIC (Inspired by: https://www-users.york.ac.uk/~ss44/joke/foot.htm)
You CHAIN a program called GUN, dynamically LIBRARY in ballistic maths, and draw a perfectly animated foot sprite while a multitasking routine calculates the trajectory in real time. Halfway through, you RESTRICT yourself from using anything dangerous, forget to DERESTRICT, and the shot silently fails. You spend an hour debugging before realising the gun worked perfectly—you just sandboxed the bullet.

willow ginkgo
#

making two joke keymaps for klingon and aerebesh

willow ginkgo
willow ginkgo
willow ginkgo
#

voyager has begun.

willow ginkgo
#

ive removed Retro Rocket BASIC's hard cap of MAX_STRINGLEN on strings. now a string can be in theory as long as the allocator will allow at any given time

#

during testing i managed to make a string nearly 3mb long

willow ginkgo
#

combined with automatic scaling of the temp arena, managed to generate a 17mb string 😄

cyan depot
#

That is sick

light ice
willow ginkgo
uncut quiver
willow ginkgo
#

well technically not. the list command will dump that file just fine

#

but if you want to PRINT it in one instruction... lol

willow ginkgo
#

I've added support for different memory models when you start a program

#

CHAIN "program" MEMORY HUGE|LARGE|MEDIUM|SMALL

It affects the size of the buddy allocator default arena basically how big any one object like an array or string can be. defaults to 64mb (what it was before), this is MEDIUM.

SMALL = 32MB
MEDIUM = 64MB
LARGE = 128MB
HUGE= 256MB

buddy allocator can always grow more arenas, always has been able to do that but this lets you raise the size for big scalars and arrays in a program.

light ice
cyan depot
willow ginkgo
#

good luck even filling 64mb with BASIC lol

#

i have to make massive arrays and stuff to fill it

light ice
willow ginkgo
#

thats small fry data

#

a few dozen libraries of congress is what you need

light ice
willow ginkgo
#

you will have to make sure to write it to disk though if its the bible

#

because jesus saves

light ice
#

I do wonder if I could try and port my kgz library to RR basic and do the decompression there, wonder how slow it would be given you have to read of a bit stream and do a bunch of tree magic and shit

willow ginkgo
#

that would be fun

#

but your fastest approach is likely MEMALLOC, PEEK and POKE

#

although numeric arrays are really quick

light ice
#

There is a lot of fancy bit shifting stuff to get stuff out of the streak and flip endianess where needed

#

Because some stuff has to be read one way or the other

willow ginkgo
#

this is a direct port of a benchmark written for a 2mhz 6502 running BBC BASIC

#

i had to adjust the sample sizes because it was completing in under 1ms and causing divide by zero

light ice
#

Oooo neat

willow ginkgo
#

this is on a Ryzen 7 5800X on windows with WHPX under qemu

#

this ones my own benchmark, i use it to compare old vs new when i make an interpreter change to make sure i havent made anything worse

#

a bunch of loops and allocations and string growth and floating point ops, ran 5 times and averaged

#

for that one smaller is better

willow ginkgo
#

lol 96mb string

cyan depot
#

Do u have any doc? I am curios abt it

willow ginkgo
#
REM This is supposed to crash.
A$ = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
A$ = A$ + A$
A$ = A$ + A$
A$ = A$ + A$
A$ = A$ + A$
A$ = A$ + A$
A$ = A$ + A$
A$ = A$ + A$
A$ = A$ + A$
A$ = A$ + A$
A$ = A$ + A$
A$ = A$ + A$
A$ = A$ + A$
B$ = A$
MB = 0
ON ERROR PROCfail
REPEAT
    B$ = B$ + A$
UNTIL FALSE
END

DEF PROCfail
    PRINT "Grow reached its limit at a "; LEN(B$) / 1024 / 1024; " MB string"
    PRINT "Memory use: "; MEMPROGRAM
    PRINT "Memory peak: "; MEMPEAK
    END
ENDPROC
#

it just does that until it cant any more 😄

willow ginkgo
cyan depot
willow ginkgo
#

oh.... one sec 😄

cyan depot
#

If possible

cyan depot
willow ginkgo
#

i got this

#

but as for source code, everything has doxygen blocks

cyan depot
willow ginkgo
#

lots of good examples in here

narrow elbow
willow ginkgo
#

started work on a memory tracer, allows for leak checking and will give be backtraces to leaking callers

willow ginkgo
#

got it working, got some small memory leaks to solve maybe.

willow ginkgo
#

added BIGNUM support, uses mbedtls bignum under the hood

willow ginkgo
#

voyager now converting html to markdown ready for parse 🙂

willow ginkgo
#

added font scaling/flipping to GRAPHPRINT

willow ginkgo
#

testing something ive not tried before.... one copy of retro rocket connecting to the web server of another 😄

willow ginkgo
#

nice...

willow ginkgo
#

currently adding simple path mtu discovery, adding icmp error handlers, and actually validating the ipv4 checksum of inbound packets

#

icmp error handlers are simple callback where the tcp system can be told by icmp if a port or host is unreachable to bubble errors up the stack

#

basically this

void tcp_handle_icmp_unreachable(ip_packet_t *quoted_ip, uint8_t code, uint16_t mtu)
{
    tcp_segment_t *quoted_tcp = (tcp_segment_t *)((uint8_t *)quoted_ip + quoted_ip->ihl * 4);
    tcp_byte_order_in(quoted_tcp);

    tcp_conn_t *conn = tcp_find(*((uint32_t *)&quoted_ip->src_ip), *((uint32_t *)&quoted_ip->dst_ip), quoted_tcp->src_port, quoted_tcp->dst_port);
    if (!conn) {
        return;
    }

    switch (code) {
        case ICMP_NET_UNREACHABLE:
        case ICMP_HOST_UNREACHABLE:
            tcp_set_close_code(conn, TCP_CONNECTION_LOST);
            break;

        case ICMP_PROTOCOL_UNREACHABLE:
            tcp_set_close_code(conn, TCP_CONNECTION_ABORTED);
            break;

        case ICMP_PORT_UNREACHABLE:
            tcp_set_close_code(conn, TCP_CONNECTION_REFUSED);
            break;

        case ICMP_FRAGMENTATION_NEEDED:
            if (mtu > sizeof(ip_packet_t) + sizeof(tcp_segment_t)) {
                uint16_t path_mss = mtu - sizeof(ip_packet_t) - sizeof(tcp_segment_t);

                if (path_mss < conn->peer_mss) {
                    conn->peer_mss = path_mss;
                }
            }
            break;

        default:
            break;
    }
}

...

icmp_register_unreachable_handler(PROTOCOL_TCP, tcp_handle_icmp_unreachable);
willow ginkgo
#

finally removed LGETLASTCPUID and LCPUID

willow ginkgo
tepid orbit
#

Are you joking? BASIC is an interpreted language, how you gonna do this

#

🫪🫪🫪

slow glen
#

??

willow ginkgo
#

😄

#

the kernel is a lightweight C kernel that runs a ring 0 BASIC interpreter built for systems level work

#

welcome to the crazy thread

#

currently adding spectrum analyser to the audio system so BASIC can do VU meters and visualisations

willow ginkgo
cyan depot
#

Dude OS is older than me

willow ginkgo
willow ginkgo
#

I'm currently working on a new thing where in the RESTRICT keyword if you put RESTRICT MEMORY you can only do memory primitives within regions you allocated with MEMALLOC, and, you can only MEMRELEASE a region you allocated with MEMALLOC

#

basically enables memory safety for raw memory operations

willow ginkgo
#

i decided to keep the MEMRELEASE check regardless of if RESTRICT MEMORY is on or not

#

theres never any benefit to freeing memory that doesnt match a previous allocation exactly, its a bug at best, and a heap corruption at worst.

#

it also helps catch double frees

willow ginkgo
willow ginkgo
#

https://youtu.be/6BwroY3ZJCY

finally some common sense

Colorado’s proposed OS-level age verification bill - SB26-051 has triggered an unexpected backlash from the Linux and open-source community.

Developers warned that the original wording appeared broad enough to potentially affect Linux distributions, public code repositories like GitHub, and even container systems such as Docker.

Now lawmaker...

▶ Play video
willow ginkgo
#

decided to add a read-only ext2 driver

#

will be yet another foreign file system it will be able to read files from

willow ginkgo
#

woooo ext2!

willow ginkgo
#

added new keyword to enumerate registered devices from BASIC

willow ginkgo
#

that lets me make a devices command like this, and/or enumerate the device list to check if a sound device is loaded before trying to load one instead of needing on-error chains.

willow ginkgo
#

can finally, 16 years late, specify partitions to mount specific partition ids 😄

willow ginkgo
#

now added support for LINUX LVM2 volumes when mounting ext2/3!

#

not sure ive seen this anywhere else yet in hobby OSes

#

apart from ofc those that are linux forks

willow ginkgo
#

improved how i handle GUIDs in LVM2 and GPT partition tables/volumes

#

and also added a walk callback for volume walk which i'll use to expose a list of volumes on a device to BASIC

#

but that can wait till tomorrow. its late.

willow ginkgo
#

added vols command, VOL$() and VOLCOUNT() functions for enumerating available volumes on a block device

still hearth
#

bro continue like this and your the next linux i swear

willow ginkgo
still hearth
#

do pub and you will find users

willow ginkgo
#

the plan is to get to 1.0 then do that

still hearth
#

noice 👍

#

but good luck for the drivers of modern things

willow ginkgo
#

1.0 just needs the package manager and a basic web browser

#

by not being a 'desktop' OS, i hopefully wont be competing in the same space for gfx drivers

#

most of what retro rocket does, it can do effectively with just VESA/GOP

#

one good reason to eventually go to native graphics though is multi monitor

willow ginkgo
#

waiting on a new replacement SSD for my raid array, until I've got that I'm not compiling much

broken ivy
willow ginkgo
broken ivy
#

i may be able to do a raid on a 20 year old machine nuke3

willow ginkgo
#

but I take no risks

broken ivy
#

2 80 GiB IDE HDDs

willow ginkgo
#

if it degrades I shut down noisy services and wait till it's got replacement disks

#

lol, epic autocorrect
... services I shit down

broken ivy
#

interesting, i've never had a disk degrade on me really

#

only one but speed wise only

#

it works fine its just slow as hell

#

its not that old either tho

#

it just sucks

willow ginkgo
#

I have 4x 512gb sff SSD. I get through maybe one a year

broken ivy
#

yeah, on my main pc i have my main 480GiB SSD and a 4tb hdd

#

i can't really raid them

#

on that 20 year old machine tho

#

i think it does support raids

#

iirc it had something about that on the bios

willow ginkgo
#

yeah older machines usually can raid sata

#

they expose the sata array as one disk via ahci usually

broken ivy
#

this is IDE tho

willow ginkgo
#

interesting

#

🤔

broken ivy
#

raids should implement checksums like cd roms ngl

willow ginkgo
#

do you still have easy access to working ide disks? or do you use an ide CF adaptor

broken ivy
#

actually its not that easy

#

the IDE cables are basically stone

#

28 years of crust ig

willow ginkgo
#

move them too much and they snap?

broken ivy
#

no but they need a lot of force for removal

#

i have to get an extra fan for that pc tho

#

it has one intake and no outgoing fans

willow ginkgo
#

I have my server for compiling and running qemu on, and a spare pc that has retro rocket permanently installed, that is about 15 years old

broken ivy
#

i have my main pc and a 2 laptops made into servers

#

i use them for holding my web page and occasional minecraft servers for friends

#

thinking about it all my devices have ssh installed

#

even my phone

willow ginkgo
#

I shut my MC server down until I have replacement disk

#

it loves to continually write

broken ivy
#

i run a fabric server with some optimization mods

#

still runs like crap

willow ginkgo
#

I run mostly vanilla paper with dynmap and a custom anti grief module

willow ginkgo
#

well on the way to making most string access in the BASIC interpreter uses counted strings

willow ginkgo
#

a ton of stuff is now length counted strings

#

a few more bits to do there

willow ginkgo
#

yay, new drive is in

#
root@neuron:/home/brain# ssacli ctrl slot=0 ld all show status

   logicaldrive 1 (953.82 GB, RAID 6): Recovering, 67.67% complete
wild sedge
#

interesting raid

willow ginkgo
#

it's a hp410i raid controller

willow ginkgo
#

ive removed tons and tons of strlen calls from basic, moving to counted spans. the idea is that pretty much any string is immutable, if you change it you make a copy.

#

this has sped up the interpreter by about 16%

willow ginkgo
#

gonna spend some time testing the new basic sfuff

#

then I am a bit closer to 1.0

#

raid is repaired now, so one less issue to fight

nova quartz
#

haven't checked in here in a while, how goes it?

willow ginkgo
nova quartz
#

ahhh
fair

willow ginkgo
nova quartz
#

Oooo

#

Finally found someone that likes C++

#

I like parts of C++ and hate other parts

willow ginkgo
#

I use c++ pragmatically,I don't consider it an "oop" language

#

when I see over use of objects and classes and inheritence where templates or just namespaces will do, it grinds my gears

novel terrace
#

I started this field 1 month ago.i Wana to study more about it

willow ginkgo
novel terrace
#

I don't know the roadmap of it.can you guide me