#EvalynOS

1 messages Ā· Page 20 of 1

hazy saddle
#

Well yes

#

But people have gotten mad at me for using it in 64 bit contexts

#

Even though I think vector is a much better term regatdless

fiery tangle
#

:wahhgone:

#

bru

kindred stirrup
#

I use this term when talking about the number of the interrupt

fiery tangle
#

its not in thes sver šŸ˜”

hazy saddle
#

Yeah interrupt is a general term and vector is the number

hazy saddle
#

Ha ha my GDB stub works!!!

#

The IRQLs make it work so nice

#

I just have to add a bit more

#

And it’s ready to push

hazy saddle
#

And being able to mask everything except a few things

#

Is like very good

hazy saddle
#

Holy crap

#

Like genuinely

#

IRQLs make the debugger smooth as shit

#

Maybe because serial actualy has proper priority mmLol

peak cloak
#

also did i somehow cause you to use meme

hazy saddle
hazy saddle
#

Hmmm

#

It appears everything works

#

except

#

When a breakpoint is hit

#

Single stepping fails

peak cloak
hazy saddle
#

ONLY

#

if i do si

#

and it breaks inside printf vargs

#

for normal stepping

#

??????

hazy saddle
#

yes!!!

peak cloak
#

what does si do again pain

hazy saddle
#

single instruction step

#

vs multi instrution step

peak cloak
#

oh

#

do you en/disable that with an instruction

hazy saddle
peak cloak
#

it better allow meme

hazy saddle
peak cloak
#

oh

hazy saddle
peak cloak
#

i still wanna ask tho

hazy saddle
#

no idea

#

dont think so

peak cloak
#

oh

hazy saddle
#

Okay so

#

GDB is now asking for straight up bogus memory

#

This is what I got so far

#

This combines two commits

#

Tomorrow I’m gonna try to clean it up

#

And push what I have

#

And mark it ā€œunstableā€

#

Or whatever

peak cloak
hazy saddle
#

I may of found it

#

I don’t support

#

Changing registers

peak cloak
#

What

#

why would you need to change registers from debugger

cold barn
#

or I guess like

#

if you notice that a register value is bad, you can change it to verify that execution would be correct with the expected value

peak cloak
#

ohok

hazy saddle
#

And to read and write memory

#

And it keeps asking for BS

hazy saddle
#

I have a theory

#

I literally explicitly told GDB

#

I do not support software breakpoints

#

But it keeps fucking sending them

#

XD

#

So

#

I need to implement them

#

I should also try lldb

#

Because gdb may not like llvm compiled code

floral kettle
#

idk why wouldn't gdb like llvm compiled code, it works just fine most of the times

hazy saddle
#

I do know whenever I use the wrong addr2line it complains about dwarf errors

#
 evalyn@EvalynPC ī‚° ~/Documents/Programming/evalynOS/evalynOS ī‚° ↱ dev ±✚ ī‚° addr2line -e ./bin-x86_64/kernel.elf ffffffff8000ca4f
addr2line: DWARF error: mangled line number section (bad file number)
addr2line: DWARF error: mangled line number section (bad file number)
addr2line: DWARF error: mangled line number section (bad file number)
...
addr2line: DWARF error: mangled line number section (bad file number)
addr2line: DWARF error: mangled line number section (bad file number)
addr2line: DWARF error: mangled line number section (bad file number)
addr2line: DWARF error: mangled line number section (bad file number)
addr2line: DWARF error: mangled line number section (bad file number)
/home/evalyn/Documents/Programming/evalynOS/evalynOS/src/kernel/libc/stdio.c:48
#

This is a lot more than normal

#

I don’t normally addr2line inside of printf/va args

floral kettle
#

I think that is a dwarf 5 issue, with -gdwarf-4 it works fine

hazy saddle
#

i wonder if its also due to my use of clang spesific things tripping up gdb? i was not able to run addr2line with that sadly

#

though whats strange is lldb cannot connect over serial

#
floral kettle
hazy saddle
#

ahh its a compile flag yaaar

floral kettle
#

like tcp (or in qemu -serial tcp where the guest can use serial but the host can connect using tcp)

hazy saddle
#

it seems lldb is working now

#

and i got it over serial

#

and it properly steps through

floral kettle
#

nice

hazy saddle
#

i am gonna try and rework my stuff to compile with gcc

#

it was being strange before

#

triple fauling before even being able to flanterm PSP1G_pspTrollar

#

process connect --plugin gdb-remote serial:///dev/ttyUSB0?baud=115200

hazy saddle
#

for addr2line

#

gdb is still angry

hazy saddle
#

it seems somwhere on here its trying to debug the stub its self

#

cusuing an issue

#

i wonder

#

is it giving bad data making the stub call printf?

#

causing issues?

#

though i did remove that lock temp

#

somthing inside irql is toching IRQL??????

#

or some other interupt is coming in??

#

so it seems to lock up before this spot.

#

then if i press s it manages to get back in

#

lmfao the debugger debugging its self being useful

#

I’m actualy getting a stack frame of it dying

#

It’s going serial ISR -> debug ISR -> raise IRQL -> panic

#

It seems somthing within printf is fucking up?

#

Or it’s getting a serial ISR when it shouldn’t

#

AHA

#

nanoprintf must not like printf being recussirve??

#

when i process a packet its going inside of npf

#

Not for a printf but to format some data

#

I’m not sure if nanoprintfs internals are thread safe for this?

#

Somthing is triggering a dbg exception inside of it atleast

#

Wait what if

#

The debugger is putting a breakpoint inside of there

#

I could do a basic recursion check

#

If you enter it after raising IRQL

#

It will set a flag

#

If the flag is set it will not attempt another exception try

clear bison
hazy saddle
#

this fixed it

#

who could of guessed this code was bad

#

It works now!!!

#

Now

#

Time for real hardware

#

After I clean this up a bit more

hazy saddle
#

As a reference to windows

clear bison
#

Maybe idk trl

hazy saddle
#

Somthing is dereferencing a null pointer

#

Only on real hardware

#

And it’s after serial setup it seems

#

im gonna presume my build env was wonky

#

because i did not copy everything to other laptop

#

and im gonna harden serial driver

#

good thing my smb server is fast

#

Okay it’s working now

#

Just looks like it got bad symbols ?

#

It was reading addresses wrong

#

But like

#

Not fully

#

AHA

#

I set the wrong parameters

#

I needed to set no parity bits and 1 stop bit

#

LLDB seemed to be picking other things as default?

#

It’s working!!!

#

A working GDB remote protocol server over serial (using LLDB because GDB was being stupid PSP1G_pspTrollar)

gentle quest
#

Thats cool

hazy saddle
#

I will have to add and refactor a bit more later

#

Esp once I get SMP

#

But it shouldn’t be too bad

cyan bison
#

trademark owned by Nike pls dont sue me nike

hazy saddle
#

Nah it was GDB just being dumb

#

Idk why but LLDB works fine

#

Talk is cheap send patches

cyan bison
hazy saddle
cyan bison
#

now its not my code now is it

hazy saddle
#

But your talking about it

cyan bison
#

then I wont

hazy saddle
#

I’m just messing with ya

#

Software breakpoints are on my todo

#

But I’m content with the 4 hardware ones

cyan bison
#

hmhm

#

im not

hazy saddle
#

Il add them later

#

The file is already 400loc

#

I wana refactor it to make it cleaner before adding anymore

#
  • I pre allocate all buffers so il have to do some magic for this potentially
hazy saddle
hazy saddle
#

What is strange is the PS2 driver is now kind of wonky inside QEMU

#

But fine on my desktop

#

Good thing I was gonna rework it anyways

peak cloak
hazy saddle
#

Nah it’s also slightly buggy in real hardware PSP1G_pspTrollar

#

Considerably less so though

peak cloak
#

you should find a better PS2 emulator

#

theres a bunch of open source ones i hope

#

playstation jokes aside good luck

hazy saddle
#

it legit has a fucking lock inside of it

peak cloak
#

😭

hazy saddle
#

the commitā„¢ is all ready

hazy saddle
#

Can confirm a build off the main branch works perfectly still

#

I honestly cannot believe it’s working this well now

hazy saddle
#

It was trying to read and write to bogus memory

#

Whole LLDB was just fine XD

soft snow
hazy saddle
#

Though I may change it to sage funcs

hazy saddle
#

VFS is tomorrow

#

I wokeup at 1pm today and I am unfit to work

#

But I may submit the ps2 driver patches

hazy saddle
#

tried to update my mlibc patch just a little

#

uhhhhhhh

#

(trying again to port bash)

#

well the other patch is fine idk

hazy saddle
hazy saddle
clear bison
#

CR4 instead of CR0

hazy saddle
#

And I fucking forgot

#

šŸ„€

#

😭

clear bison
#

Biggest fuckup of mine of this kind has been cr2 instead of cr3

hazy saddle
#

Damn 😭

hazy saddle
#

dawg the tiny ass bugs im finding

#

how is this not breaking real machines XD

kindred stirrup
#

isn't cr2 read-only

clear bison
floral kettle
#

yeah you can write anything you want to there

kindred stirrup
#

lol thats crazy

#

i deliberately chose not to restore cr2 in my interrupt handlers

hazy saddle
#

I’m sending EOIs here when I shouldn’t

#

Because with IRQLs I send them right away etc

hazy saddle
#

So like you shouldn’t need to really restore it unless you are using it as a GPR

#

Though wouldn’t that mean you can use CR2 as a cpu local?

#

Like that actually dosnt seem like a fully bad idea if that’s consistent across amd and intel

kindred stirrup
#

No, because cr2 would be overwritten on page fault

hazy saddle
#

Oh wait yeah

#

šŸ’€

#

I forgot that’s what CR2 was for

#

Tbf why don’t they do somthing like that with the unused control registers :p

#

Like yes there’s GSbase

#

But having extra can’t hurt

magic saffron
#

iirc there is a kernel here that briefly uses cr2 as storage

magic saffron
gentle quest
#

There is

magic saffron
#

if you know, you know

gentle quest
#

Revolutionary tech

hazy saddle
#

Ahh I miss read that reply yaaar

hazy saddle
#

why is my debug stub now like ever so slightly out of sync

#

let me try the physical cable again

#

and not qemus PTS thing

#

why is pressing b on that like making a breakpoint there??

#

ahh

#

it was -O2

#

Of course that’s gonna make debugging a PITA

#

Because it’s not gonna align with the source code as much

#

okay yeah the patch works as expected

#

and dosnt break the debugger

#

@magic saffron this should fix that TSS stuff and properly give #DB/#DB its own stack along with #DF (I just chuck #NMI into the generic unhandled IRQ stuff for me to deal with laterā„¢ and have it panic)

#

I am also considering making my flanterm lock not block IRQs

#

Because in real hardware the framebuffer can be slow in intensive sections

#

And I’d rather keep preemption going and allow tasks to run when not printing

#

Rather than having it spin a bit under contention which I can fix with better scheduling later

hazy saddle
#

Wait my scheduler takes spinlocks

#

😭

#

So much of my crap is cursed rn

#

Actualy not sure why that isn’t breaking my shit somewhat if external things can take it technically ;p

#

Same for the reaper queue

#

I’m not even sure a good solution to fix that

#

Well if it’s not breaking for now it’s fine

#

Even if it’s technically breaking IRQLs in some way?

#

Though since I’m at dispatch it technically won’t crash

#

Oh wait no I’m just dumb šŸ„€

#

It’s a spinlock

#

You can’t preempt durring that

#

It’s fine wahhgone

#

The scheduler shouldn’t even need to take locks given it’s already at dispatch?

hazy saddle
#

its still triple faulting on @rotund furnace's old desktop lmfao tho

#

i even attempted to add some delays

magic saffron
#

just mark it as unsupported hardware šŸ˜›

hazy saddle
#

and then the delays caused it

#

šŸ’€

#

I do want to mark it as unsupported but his kernel can run just fine

magic saffron
#

hmm have you tried disabling features of the kernel until it stops faulting? that might give you some insight

hazy saddle
#

And the problem is so strange

hazy saddle
#

And if you remove all waits it still crashes

#

It just gets angry at some point after printing everything

magic saffron
#

how narrow is this "some point"?

#

also I forget, do you have smp support?

hazy saddle
#

This is what happens right before reset

hazy saddle
#

And this is the code minus stuff not being commented

#

though the good thing is i found a ton of teensy bugs from this

magic saffron
hazy saddle
#

i was gonna add smp after i get everything for bash and get my major rewrite done to get the codebase up to standards

rotund furnace
#

until they add smp support and everything breaks :P

hazy saddle
magic saffron
#

yeah ngl adding smp to a kernel this late is going to suck, but you'll learn a lot of things I'm sure

rotund furnace
#

not wrong

magic saffron
#

but its one less thing to diagnose now

hazy saddle
#

I possibly would of given up if SMP was added in the mix then

#

Being able to make it better without SMP is quite useful

magic saffron
#

I think thats an entirely reasonable decision, better that than giving up šŸ™‚

hazy saddle
#

Yup :3

#

I also will try and go for my own 16 bit trampoline

#

Verses using the linine request

magic saffron
#

linine

hazy saddle
urban vale
hazy saddle
#

Oh btw did I tell you about the time I tried to compile the limine test kernel and it ended up trying to copy my / drive into it šŸ’€

hazy saddle
#

And atleast now I am way more competent at this so

hazy saddle
#

Not like it’s impossible to end up working out

#

It will work eventualt

#

Heck my kernel has already had 2 major rewrites

#

What’s another

#

Oh and then an extra for architecture ports heh

urban vale
#

by worse outcome i mean worse smp support since like

hazy saddle
#

Plus heck if I have to do a rewrite if I got to a decent point with bash and no SMP good chance I can just steal a fuck ton from the current codebase

urban vale
#

youll be more tempted to use huge locks and stuff

#

that cover vast amounts of things

#

rather than be forced to redesign tons of code you already wrote

#

to make it work with fine grained locking

hazy saddle
#

I already have a global PMM lock PSP1G_pspTrollar

#

And I was planning to rewrite that anyways

#

And I have to redo my heap

#

And my VMA could use some more work after my initial revision

#

I want to rework a lot anyways eventually so :p

hazy saddle
#

I even wanted to attempt some lock free algorithms

hazy saddle
magic saffron
#

isnt it just a make target?

hazy saddle
#

i tried the make file part of it and its missing tons of env stuff

#

and i did not see it in ./configure

#

and i did a full all target build

#

even mkdir needs a ENV šŸ’€

hazy saddle
#

This kernel used to be held up with so much duct tape I’m shocked I even got to this point

#

Well it still is but a good bit of that tape is now super super glue

#

Very good improvement

#

It will become good at some point

#

Atleast I have fun along the way tinkering on this stuff

magic saffron
hazy saddle
#

limine the bootloader builds

#

not the test kernel

magic saffron
#

I just tried a fresh clone of limine, then ./bootstrap and configure --enable-uefi-x86-64 and make test-uefi-x86-64 and it just worked (tm)

#

I did have to install autoconf though šŸ˜”

#

hmm ok

hazy saddle
#

./configure --enable-all
make -j16

#

this is from my fuckery of attempts lol

#

it managed to yoink that much crap

magic saffron
#

maybe start again, that looks fucked

hazy saddle
#

I don’t wana risk it again

#

And I CBA to find all the ENV things I set again

#

It was @rotund furnace Who needed it to test on the fuck ass PC

#

Because APs cannot start until you press a key on PS2

#

šŸ’€

magic saffron
#

ok interesting

hazy saddle
#

also my UBSAN did this

rotund furnace
#

but like

#

my code will get to the "waiting for aps"

#

and then just nothing

hazy saddle
rotund furnace
#

until I press a key šŸ„€

hazy saddle
#

šŸ„€

rotund furnace
rotund furnace
#

it also works fine in qemu and on modern hardware

magic saffron
rotund furnace
#

so like

#

idk

magic saffron
#

ah ok

rotund furnace
#

blame amt?

hazy saddle
#

and old as shit

#

who knows that kind of hardware issues it could have

rotund furnace
#

it works fine in windows and linux :P

hazy saddle
#

whats the exact CPU model again

#

i wana look this up

#

@rotund furnace this?

rotund furnace
#

maybe

#

no

#

iirc it's the 5400

hazy saddle
#

@rotund furnace what timing device did you end up using?

#

for your kernel on that system

rotund furnace
#

wdym

hazy saddle
#

like PIT / HPET / ACPI

rotund furnace
#

my kernel only supports the lapic timer

#

oh for calibration

hazy saddle
#

but to calibrate lapic

rotund furnace
#

my kernel only supports the pit chip for that šŸ„€

#

because I was lazy

hazy saddle
#

becaus somthing has to be fucky with my timing system?

#

thats where it was faultin

#

mmm i dont use delays on the uhh put thing

#

we did try and force PIT?

#

and that failed semingly

#

@rotund furnace wana try this?

hazy saddle
#

Lowk I should make that a CLI arg :p

#

ctimer=pit/hpet/acpi

opaque marten
opaque marten
#

i also have the e5200 in another machine

hazy saddle
#

Or some other hardware fault fucking up

hazy saddle
#

Though they may have an E5400

#

Should be close enough :p

opaque marten
#

yea

hazy saddle
#

Thank you

opaque marten
#

lemme whip this thing out rq

#

wait nooo i forgot i moved it to another house death

#

don't have it rn

hazy saddle
#

fuuuuuuuuuckkk

opaque marten
#

i mean i do have my i5-2450M laptop if that helps but

#

yeah

hazy saddle
#

i mean its always worth a test lol

opaque marten
#

it got to the kernel shell prompt

#

i cant take a picture because my phone is being fucking stupid

hazy saddle
#

can you type badapple or doom

opaque marten
#

doom works although its half on one side of the screen and the other on the other half

#

but i think its because you put it to the right

hazy saddle
#

yeah that happens on low res displays

#

technicaly it dosnt meet the minium specs for display res

opaque marten
#

badapple also works and the pc speaker works too

hazy saddle
#

so yeah

#

idk why it wont work for @rotund furnace

opaque marten
hazy saddle
#

Why not play some cross eyed doom

opaque marten
#

lol

hazy saddle
opaque marten
#

i5-2450M, 4gb of ram, 1366x768 screen

hazy saddle
#

Idk why the 2008 PC won’t work them

#

Like my kernel is meant to run on the oldest of hardware

#

I specifically avoid features that would break older systems

#

Without fallbacks*

opaque marten
#

i have a few old machines at my mom's house but i'm not there rn

#

i have an amd sempron le-1250 machine, an e5200 and an e5300 machine

hazy saddle
#

I’d love to see things tested if possible

#

I hope they have a working serial port

#

Maybe we can get into LLDB and my stub

opaque marten
#

they should

hazy saddle
#

The one water has dosnt even have a working serial header

opaque marten
#

i also have a serial to usb converter that i can use on my pc

hazy saddle
#

Ooo hell yeah

#

Just don’t use gdb

opaque marten
#

aight

hazy saddle
#

Because gdb cannot work with my gdb stub

#

šŸ’€

opaque marten
#

bru

hazy saddle
#

It asks for fucking invalid ass memory

#

And it cannot single step right at all

opaque marten
#

mfw

hazy saddle
#

LLDB works perfectly on -O0

#

-O2 works strange because of how some things are inlined and removed etc

#

Not with the stub atleast tho

opaque marten
#

yeah

opaque marten
# hazy saddle Ooo hell yeah

anyways i booted alpine linux on serial and it worked and after fixing my serial code i was able to use bentobox with it too

#

although the machine was an i7-4790 machine

hazy saddle
#

Ooo nice nice

#

I hope my kernel can start getting some progress

#

I keep taking random side quests

#

Like old ass hardware and gdb stubs

#

Instead of the glaring crapping VFS XD

#

Though this has gotten me to fix like 7 various bugs in drivers

#

Which is nice

opaque marten
hazy saddle
#

I also want to try and compile bash but the build system keeps being annoying

#

And I tried to add some stuff to mlibc and it ended up breaking it

#

By just adding more headers and stuff

#

šŸ’€

#

Not even changing my logic

opaque marten
#

mfw

hazy saddle
#

It is a 4 month old commit

#

I should probably update it

opaque marten
#

prolly

hazy saddle
#

After VFS

hazy saddle
#

šŸ’€

opaque marten
#

bruh

hazy saddle
#

I have the changes I made somewhere up here

#

Let me find it

hazy saddle
opaque marten
#

i see

hazy saddle
#

Is there anything in there that should break

opaque marten
#

no clue

hazy saddle
opaque marten
#

what

clear bison
#

The logo

hazy saddle
#

working on updating my mlibc

hazy saddle
#

guess who found another bug with IRQLs

#

and the TPR being set to 1

#

because i had a header file wrong

hazy saddle
#

wow woulndt ya know

#

the ps2 driver i stole

#

is what somehow

#

was causing triple faults

#

😭

wanton grove
hazy saddle
#

ask @rotund furnace

#

they used the goat claude code to make a patch

#

which im refactoring

#

:p

hazy saddle
#

well

#

the ps2 code works

#

my shit deadlocks right away on real hardware now :/

#

But all I did was change the ps2 code

hazy saddle
#

Oh and I made a correctness change

#

On the spinlocks

#

So it won’t lower always to IRQL1

#

On the scheduler

#

Soooooo

#

I dunno that may be causing issues

#

But I can’t repro in VM

#

So all I can do is use my gdb stub

peak cloak
hazy saddle
#

Yeah if I undo that change it works

#

But like

#

I sort of need that change

hazy saddle
#

Or rather

warped ermine
#

alright so the allocator uses 1 page every 4MiB for metadata

#

about

#

itll go up by 1 byte extra for every next power of two but not bad

hazy saddle
#

Why is this in here pewpew šŸ’€

warped ermine
#

oh

#

bruh

#

i might be oopid

#

prodoundly oopid

hazy saddle
#

It’s fine lol

#

You just have to fix my deadlock isssues now :3

warped ermine
#

AAAAAAAAAAAAAAAAAAAAAAAA

hazy saddle
#

apply to dev

#

lmk if you have issues ;3

opaque marten
gentle quest
#

I can send code like this

hazy saddle
# opaque marten

I was making a joke because it’s a friend I know outside osdev lol :^)

#

I have a debugger on real hardware so il find the issue in like 10 seconds hopefully

opaque marten
#

my real hardware debugger is called spamming printf

severe marlin
#

<insert lecture about how printf has side effects that can mess with certain bugs that I always get every time I say that>

#

Real though, also commenting out half the code until it works

hazy saddle
#

A GDBstub is IMO really nice here

severe marlin
#

Oh

#

Fun

hazy saddle
#

Which I have made

#

I can just attach it

#

Make it run

#

Wait for it to lock which takes 10 seconds

#

Stop it

#

Backtrace

severe marlin
#

Ahh yeah nice

#

That sounds very convenient ngl

hazy saddle
#

And because I have interrupt priority it should just work ā„¢

#

Yes yes

#

My code should be pretty portable too if you have IRQLs or atleast TPR too btw

#

And given you use a serial port

severe marlin
#

"it should just work" - famous last words

severe marlin
#

I am curious but I also have this shitty uni assignment (java and we have to use inheritance/oop) I gotta do :(

hazy saddle
#

Damn

#

Il be here later when your free ^^

severe marlin
#

hmm not sure I'll get it finished today but maybe 🤷

hazy saddle
#

but we shall see

hazy saddle
#

okay uhh

#

funn

#

somthing is getting into userspace

#

with IRQL2+ i presume

#

which means it cannot preempt anything properly

#

and its trapped inside userspace

#

good thing is

#

the debugger worked perfectly

#

so thank you past me

#

and also screw you past me for adding IRQLs

#

okay so if somthing holds a lock. then preempts its self it could break?

#

i do see OBOS has the locks commmented out of the schedular

#

wich technicaly should be fine

#

well no

#

because it can be called seperatly

#

// This should be assumed to be called with the current thread's context saved.
// It does NOT do that on it's own.
spinlock Core_SchedulerLock;
static bool suspendSched = false;
static _Atomic(size_t) nSuspended = 0;
attribute((no_instrument_function)) void Core_Schedule()
- obos

#

well yeah i dont have a context save / ISR on self preempt ig?

#

okay so

#

i think i may be mucking up register state?

#

or some other context

#

whenever schedule isnt called from an IRQ

#

uhhhh

#

nothing can preempt

wanton grove
hazy saddle
#

so any sleep that happens simply fails

#

because the timer never gets to run

#

so it thinks zero time passes

#

which means well

#

šŸ’„

#

i am just gonna pass this through aguments?

#

though maybe there is a cleaner way

#

eg CPU local

#

later thoā„¢

#

i can just grab it from CPU local for the old IRQ to restore and check if its needed

#

i think this is fixed now?

#

It’s working

hazy saddle
# hazy saddle

though hardcoding this to zero may be technicaly valid too?

#

because
A. you should never hold a {spin} lock when being preempted

#

B. this is called from IRQL2 {or zero} which should always lower back to zero

#

which is also what happened before just by mistake

#

which seems to be right

#

(As that’s not triggering)

#

though the ps2 driver seems to be inconsistent?

#

as in somtimes i just dont get ant IRQs

#

i should add asserts soon

#

this seems sane enough

    int lock1r = spinlock_lock(&scheduler_spinlock);
    // Make sure IRQL is set to zero when unlocking as this
    // can be called from an ISR which will not return and
    // lower the IRQL properly. This is safe because this can
    // only be called from contexts where IRQL should become
    // zero after. EG the timer IRQ or places where you
    // are not holding onto a spinlock
    lock1r = 0;
hazy saddle
hazy saddle
#

for IRQL stuff

cyan bison
#

yes

hazy saddle
#

ty

hazy saddle
#

Why am I getting GPFs

#

When I disable LTO

#

What the fuck

#

And the stack trace is useless

#

Only happens with bad apple??

#

this patches it

#

if it diddnt like having this?

#

so it decided GPF mmLol

#

only without lto

hazy saddle
#

Okay so current list of todo

#

Update mlibc to trunk

#

Then I’m gonna swap my makefile out for meson + a shell script to make it one command to use

#

Maybe throw in jinx too

#

Then then

#

I will work on the VFS

hazy saddle
#

Given it’s all already inside ram

#

And my tmpFS should be just adding vnodes when needed to the VFS instead of its own full advanced layer?

#
  • implementing the right functions for tmpfs ops
peak cloak
#

anything but vfs

hazy saddle
hazy saddle
#

Yeah šŸ’€

#

I have like way too many random bash and python scripts

#

The libc script is good though that’s staying

peak cloak
#

also if you still want to use borscht then i dont think its gonna help the random bash script situation trl

hazy saddle
#

I’ve done my PMM rewrite for the second time

#

I need to clean it up a bit more

#

But now it won’t call back into the fucking heap

#

šŸ’€

#

Also I may be gettting a slab allocator soon

#

So the memory system should be a good less bit shit soon

#

I may still want to redo paging

#

And make that cleaner

#

Again

#

And the VMA could use a bit of abstractions

#

And cleanup

#

But that can wait because it’s functional

hazy saddle
#

also a good time to clean this function up

#

šŸ’€

#

this should be fully safe now

#

atleast from crashing ze kernel

hazy saddle
#

Okay so

#

I’m probably

#

Gonna have to do the VFS soon

#

funn

warped ermine
hazy saddle
urban mulch
hazy saddle
#

It also stress tested my VMA

#

And it looks to be working mostly fine

normal turret
hazy saddle
#

The fragmentation looks to not cause issues too bad as long as it can reuse nodes

#

Which it will as long as nothing malicious abuses it

#

Like how I allocate tons of 64kb stacks etc

#

If it gets fragmented it will eventually find its way though to working

#

Or just carve off a new chunk etc

#

And later I can redo it a bit more to handle merging of chunks better

urban mulch
#

slabs are based

hazy saddle
#

It should play out fine for a while at the very least

hazy saddle
#

And track the size of the tree and how many nodes are in it

hazy saddle
#

(Which for a basic sanity check isn’t horrid)

#

For the first part of the VFS I am going to have to make a generic bitmap allocator tbh

#

Spesificaly for FDs

#

I’m thinking of holding a block of 64 bytes worth of bitmaps with a prev and next pointer

#

Plus an extra uint64 for metadata if needed

#

Then if it needs to expand and shrink it can

#

And then the allocator will find the lowest free bit using C compiler intrinsics and other things

#

And I will store in the metadata the pointer to the block that was last used to allocate from or free from

#

So that way I can get the lowest always pretty fast

#

Good thing is this allocator just needs to track free indexes so i shouldn’t need any macro fuckery for the most part

#

I will use a linked list for FDs but I will store 8 or 16 (pointers) per node to reduce allocation and other overhead along with cache locality

#

Il try and work on this today perhaps

#

See I’m finally thinking about this ahead of time and planning instead of just putting some bullshit down and moving on

#

I could also make the chunked linked list generic with void* stuff too

#

Which would be good

#

Maybe I can even make it dynamically sizable with flexible strict arrays

#

That way anything that needs a chunked linked list can just use it

hazy saddle
#

Maybe not that

hazy saddle
#

i wana get bash first

#

and the big code cleanup

wanton grove
hazy saddle
#

i also mentioned that

wanton grove
#

then why you need bitmap

#

like you can just pick lowest free fd from list or make new

hazy saddle
hazy saddle
#

ngl i should also expand on my abortable functions stuff

#

and add rdmsr/wrmsr and stuff

#

i may also want generic read & writes of diffrent widths

#

and i can make error handling a bit better

#

by returning a 128 bit value for things

#

(rax rdx pair)

hazy saddle
#

honestly i think i should do CPU local first

#

esp for performance things

#

and i did end up testing the removal of the timer preempting

#

now it dos this at the end of an IRQ

#

which is good!

#

and the IRQ just sets a flag

hazy saddle
#

okay so i think the todo list should be

  • meson & jinx
  • cpu local
  • unite prremption from schedular (which is pretty much already the case but i dont wana push my half assed messy patches)
  • make generic linked list helpers & support circular ones too
  • make the chunked linked list helper funcs ontop
  • implement a generic bitmap allocator for things
  • implement the VFS
#

i have a few more random fixed to commit before i get started on this work tomorrow or two days from now

hazy saddle
#

im gonna keep makefiles

#

and just add jinx

#

i may use meson later once things are less tangled

#

but i dont wana learn TWO new buildsystems

#

also im finnaly gonna update flanterm to latest

#

il do limine revision 5 later tho

marble ridge
#

makefile > meson so good choice :3

hazy saddle
#

:3

hazy saddle
#

welp time to wait for debootsrap

hazy saddle
#

wait i kind of need a sub module

#

or

#

well

#

i cant do in tree builds?

#

but then it asks for

#

./jinx: line 1358: cd: /home/evalyn/Documents/Programming/evalynOS/evalynOS/src/recipes: No such file or directory

#

there we go sub module works

#

:3

#

Looking like a good stat tho

#

Oh crap

#

I could integrate borcht into this

#

With jinx

#

And have it as a host recipe

#

./jinx: line 1358: cd: /home/evalyn/Documents/Programming/evalynOS/evalynOS/src/recipes: No such file or directory

#

again???

#
* done
* building package: kernel
./jinx: line 1120: [: too many arguments
./jinx: line 1130: [: too many arguments
./jinx: eval: line 242: syntax error: unexpected end of file from `if' command on line 239
#

what did i do

#

ahh

#

looks like i can only give one from source

#

sources seem to go into Cloning into '/base_dir/sources/flanterm'... here tho

#

idk what xbps-create: ERROR: invalid pkgver! got kernel-0.0-git_1' expected foo-1.0_1' is

hazy saddle
#

I think im cooking here

#

Things are going quite well

#

I now have a much more stripped down make file for building the kernel too

#

Which just make the executable

#

I’m gonna have to reorganize this project a bit more to make it clean

#

But it’s going good

#

Mainly I am going to bring out /src/kernel into /kernel/src

#

So the stuff needed to build the kernel is in /kernel

#

Because there are some extra generation steps that needs to invoke

#

Also I think this may be cursed but

#

I could use nodeJS for generation scripts

#

I think bunJS TECHNICSLY has faster startup times than Python?

#

So I can just JavaScript as part of the build process

hazy saddle
#

Jinx is now building the kernel

#

Time to just get the ports building with it

#

Like the gcc and user apps and doom

#

And then it just has to generate the initramfs

#

And then build the ISO

hazy saddle
#

binutils now compiles under jinx

#

Let’s go

hazy saddle
#

Now all my ports and mlibc etc compile under jinx

#

I just have to combine all the packages into an initamfs

#

Then make the iso

warped ermine
#

You should add KConfig to the build system trl

hazy saddle
#

From @peak cloak

warped ermine
#

I love make menuconfig rahh

hazy saddle
#

It’s just a menuconfig ripoff

peak cloak
# hazy saddle No im gonna use borcht

Thanks for using Borschtā„¢, please do not die!
-# Copyright (c) 2026, jastahooman, licensed under the 3-clause BSD license plz do not infringe

peak cloak
#

literally

hazy saddle
peak cloak
#

why are they in one repo

hazy saddle
#

Because it’s a mono repo

#

Everything in one repo

peak cloak
#

questionable behavior

#

fair

hazy saddle
peak cloak
#

the linux hybridmicrokernel (trl) is the peak example of a monorepo

#

it has drivers for everything in ts

hazy saddle
#

It’s better than having to download two seperate repos and glue them together

hazy saddle
#

So like you can pick weather or not to compile doom

#

The one repo to rule them all

#

The one repo to compile it all

peak cloak
#

fair

hazy saddle
#

Oh BTW

#

Jinx gives you a package manager

#

All this shit is in packages

hazy saddle
#

just gotta wrap up implementing these

#

Oh and then test

#

I already have the shell script to execute these etc too

hazy saddle
#

I think it’s all properly working

#

This entire repo has just been shuffled around lmfao

#

I’m possibly gonna go more reorganization for the kernel though

#

Just testing the commands and scripts but it should just work now

hazy saddle
#

It works!

#

After fixing two typos

hazy saddle
#

Tomorrow is gonna be CPU local

#

Or mlibc update

#

Maybe both

#

Who knows

hazy saddle
#

So for CPU local I just need to update my linker script with a section to be page aligned and to have start and end markers

#

And I will make sure that I have a special fixed section at the top with the linker

#

That way I can add things to that section and calculate the offset from GS

#

And then on SMP init I just have to allocate a new memory region for it for each core

rancid viper
#

and copy the original sections data into it

#

that way if u init static variables they will be initialized for all the cpus

#

are u planning on using __seg_gs?

hazy saddle
rancid viper
#

attribute

#

tells the compiler to access the variable via gs:

#

in clang its an alias for a specific address_space attribute

hazy saddle
#

How do you make that work properly

#

And tell it the offset?

rancid viper
#

it doesn't need an offset.. it uses gs

#

xD

#

the only issue is that for cpu local accesses you need to guarantee atomicity so u would need to use __atomic* accessors or something with it

hazy saddle
rancid viper
#

...

hazy saddle
#

What

rancid viper
#

it accesses the variable with gs:

hazy saddle
#

Yes?

rancid viper
#

I am not understanding

hazy saddle
#

gs:??

rancid viper
#

lol

hazy saddle
#

Like in assembly you go gs:64 or whatever. How does the compiler know what to generate for that. And how can I know how to allocate it right for other CPUs and copy it

rancid viper
#

oh

hazy saddle
#

I’ve tried to lookup clangs documentation on address spaces before but always came up empty handed for x86-64 stuff

rancid viper
#

well so it still generates the variables into the data section or wherever u put it normally, and just assumes kind of that gs is zero

#

but what u can do then is put the vars into a section and at runtime allocate sections of memory at offsets from that original section

#

and put the offsets into gs

rotund furnace
#

that's nasty as fuck šŸ„€

rancid viper
#

not really

hazy saddle
#

So basically I say this variable is in section CPUlocal and then set GS to the start of it and assign the varribles to that address space?

#

And then it takes the section it’s in and guesses?

rotund furnace
#

no

rancid viper
#

ehh, well no so if gs is zero the accesses would point to the original section

rotund furnace
#

it just tells the compiler to use gs instead of ds for the access iirc

hazy saddle
#

Like???

#

So it ends up not being relative because gs has to be zero??????

rancid viper
#

no gs doesn't have to be zero

#

u allocate blocks of memory at runtime and set gs to an offset from the original section to the new data

#

anyway there are some caveats with this and not how I do it but it is an option

hazy saddle
#

Because it things gs is zero so I have to increase it for it to match with the loaded executable with the memory I allocated

#

I presume it would handle wrap around?

#

This seems like it should work fine and potentially be better for codegen