#EvalynOS
1 messages Ā· Page 20 of 1
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
I use this term when talking about the number of the interrupt
its not in thes sver š
Yeah interrupt is a general term and vector is the number
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
Almost as if a global mask of all interupts is stupid

And being able to mask everything except a few things
Is like very good
Holy crap
Like genuinely
IRQLs make the debugger smooth as shit
Maybe because serial actualy has proper priority 
smooth operator 
also did i somehow cause you to use 
Iāve always used 
ehhhhh 
Hmmm
It appears everything works
except
When a breakpoint is hit
Single stepping fails
RIP
it works perfectly
ONLY
if i do si
and it breaks inside printf vargs

for normal stepping
??????
yes!!!
No thatās just a normal printf
oh

i still wanna ask tho
oh
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
gnu debugga(ss) 
so you can see what happens if you get fucked up
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
ohok
GDB is issuing requests on its own to do that lmao
And to read and write memory
And it keeps asking for BS
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
bruh
idk why wouldn't gdb like llvm compiled code, it works just fine most of the times
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
I think that is a dwarf 5 issue, with -gdwarf-4 it works fine
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
https://github.com/llvm/llvm-project/commit/4a7b4beac759ad9001671a61846ee2bfc9076eec
though i found this old commit
and this blog post from a website that no longer exists lmfao https://web.archive.org/web/20211108134514/https://www.moritz.systems/blog/lldb-serial-port-communication-support/
Moritz Systems have been contracted by the FreeBSD Foundation to continue our work on modernizing the LLDB debuggerās support for FreeBSD.
The primary goal of our contract is to bring kernel debugging into LLDB. The complete Project Schedule is divided into six milestones, each taking approximately one month:
Improve LLDB compatibility with ...
did you compile your kernel with that flag?
ahh its a compile flag 
tbh most of the times you don't really need that as you have better ways to communicate
like tcp (or in qemu -serial tcp where the guest can use serial but the host can connect using tcp)
it seems lldb is working now
and i got it over serial
and it properly steps through
nice
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 
process connect --plugin gdb-remote serial:///dev/ttyUSB0?baud=115200
yup adding this works
for addr2line
gdb is still angry
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
Bro's getting IRQL_NOT_LESS_OR_EQUAL

Well yes my kernel has IRQLs now

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
Should I make this as the panic code lmfao
As a reference to windows

Maybe idk 
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
)
Thats cool
Thank you :3
I will have to add and refactor a bit more later
Esp once I get SMP
But it shouldnāt be too bad
just do itā¢
trademark owned by Nike pls dont sue me nike
Nah it was GDB just being dumb
Idk why but LLDB works fine
Talk is cheap send patches

me when setting one byte to int3 is too difficult:
Me when sending patches is too difficult:
now its not my code now is it
But your talking about it
then I wont

Iām just messing with ya
Software breakpoints are on my todo
But Iām content with the 4 hardware ones

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
This way I donāt allocate inside of IRQ contexts
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

yeah qemu cant really emulate a PS2 very well

that means your emulator is buggy
you should find a better PS2 emulator
theres a bunch of open source ones i hope
playstation jokes aside good luck
I mean the driver lowk needs a rework anyways so
it legit has a fucking lock inside of it
š
the commit⢠is all ready
Can confirm a build off the main branch works perfectly still

I honestly cannot believe itās working this well now
It turned out to just be GDB freaking out lmfao
It was trying to read and write to bogus memory
Whole LLDB was just fine XD
safe_user_funcs.c best file name'
It is what it says on the tin
Though I may change it to sage funcs
VFS is tomorrow
I wokeup at 1pm today and I am unfit to work
But I may submit the ps2 driver patches
tried to update my mlibc patch just a little
uhhhhhhh
(trying again to port bash)

well the other patch is fine idk
the diff for reference
I wonder if it attempted to dynamic linking when I 100% compile it as static??
I was copying my CR4 code there
And I fucking forgot
š„
š
Biggest fuckup of mine of this kind has been cr2 instead of cr3
Damn š
Doesnt that throw a #UD
isn't cr2 read-only
It's not afaik
yeah you can write anything you want to there
lol thats crazy
i deliberately chose not to restore cr2 in my interrupt handlers
Iām sending EOIs here when I shouldnāt

Because with IRQLs I send them right away etc
You still need to CPL0 no?
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
No, because cr2 would be overwritten on page fault
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
iirc there is a kernel here that briefly uses cr2 as storage
they probably have internal uses
Lmao
There is
if you know, you know
Revolutionary tech
Is the registers used for Intel to figure out what feature to remove next
Ahh I miss read that reply 
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
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 
The scheduler shouldnāt even need to take locks given itās already at dispatch?
cool, nice to see š
its still triple faulting on @rotund furnace's old desktop lmfao tho
i even attempted to add some delays
just mark it as unsupported hardware š
and then the delays caused it
š
I do want to mark it as unsupported but his kernel can run just fine
hmm have you tried disabling features of the kernel until it stops faulting? that might give you some insight
And the problem is so strange
It faults on the wait for you to press enter lmao
And if you remove all waits it still crashes

It just gets angry at some point after printing everything
This is what happens right before reset
Not yet
And this is the code minus stuff not being commented
though the good thing is i found a ton of teensy bugs from this
thats fine, its one less thing to worry about for now
i was gonna add smp after i get everything for bash and get my major rewrite done to get the codebase up to standards
until they add smp support and everything breaks :P
Better to do it in a stable spot versus now :p
yeah ngl adding smp to a kernel this late is going to suck, but you'll learn a lot of things I'm sure
not wrong
but its one less thing to diagnose now
My initial scheduling things were so fucking unstable
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
I think thats an entirely reasonable decision, better that than giving up š
Yup :3
I also will try and go for my own 16 bit trampoline
Verses using the linine request
linine

prob going to inevitably have a worse outcome than if smp had been there from the start
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 š
Pros and cons
And atleast now I am way more competent at this so
yeah probably
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 
by worse outcome i mean worse smp support since like
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
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
I already have a global PMM lock 
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
Well actualy make my own heap because the one I stole is dookie
I even wanted to attempt some lock free algorithms
i still cannot figure out how to build it too

isnt it just a make target?
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 š
btw talk cheap send patches. did you try the older iso :p
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
did you run ./bootstrap?
yes
limine the bootloader builds
not the test kernel
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
./configure --enable-all
make -j16
this is from my fuckery of attempts lol

it managed to yoink that much crap
maybe start again, that looks fucked
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
š
ok interesting
this could be my fault ngl
but like
my code will get to the "waiting for aps"
and then just nothing
Iām personally willing to bet ventoy is fucking with my kernel tbh :p
until I press a key š„
š„
it happened when I dded it directly

it also works fine in qemu and on modern hardware
yeah ventoy is known to be a big pile of hacks (or it was), have you (or Water bottle) tried without it?
ah ok
blame amt?
it is a dual core pentium

and old as shit
who knows that kind of hardware issues it could have

it works fine in windows and linux :P
both kernels that have years of work put into them with tons of possible quirks tables :p
whats the exact CPU model again
i wana look this up
@rotund furnace this?
@rotund furnace what timing device did you end up using?
for your kernel on that system
wdym
like PIT / HPET / ACPI
but to calibrate lapic
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?
this build also forces PIT
Lowk I should make that a CLI arg :p
ctimer=pit/hpet/acpi
ram is too expensive, use cr2 register for more memory
ey i have one of these in an optiplex
i also have the e5200 in another machine
Wana test if my kernel breaks on there to see if itās just a bad PC?
Or some other hardware fault fucking up
sure
This is the debugging iso
Though they may have an E5400
Should be close enough :p
yea
Thank you
lemme whip this thing out rq
wait nooo i forgot i moved it to another house 
don't have it rn
fuuuuuuuuuckkk
i mean its always worth a test lol
it got to the kernel shell prompt
i cant take a picture because my phone is being fucking stupid
can you type badapple or doom
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
yeah that happens on low res displays
technicaly it dosnt meet the minium specs for display res

badapple also works and the pc speaker works too
Why not play some cross eyed doom
lol

laptop's a packard bell from ~2012
i5-2450M, 4gb of ram, 1366x768 screen
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*
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
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
they should
The one water has dosnt even have a working serial header
i also have a serial to usb converter that i can use on my pc
aight
bru
mfw
LLDB works perfectly on -O0
-O2 works strange because of how some things are inlined and removed etc
Not with the stub atleast tho
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
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
lol
Oooo nice
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
mfw
prolly
bruh
Here
i see
no clue
im willing to be its just an old commit that i got the short end of the stick on
what
The logo
working on updating my mlibc
guess who found another bug with IRQLs
and the TPR being set to 1
because i had a header file wrong
wow woulndt ya know
the ps2 driver i stole
is what somehow
was causing triple faults
š
how
idk
ask @rotund furnace
they used the goat claude code to make a patch
which im refactoring
:p
well
the ps2 code works
my shit deadlocks right away on real hardware now :/
But all I did was change the ps2 code
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
maybe it was useful after all
True
Yeah if I undo that change it works
But like

I sort of need that change
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
Why is this in here pewpew š
AAAAAAAAAAAAAAAAAAAAAAAA
here you gooo
apply to dev
lmk if you have issues ;3
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
my real hardware debugger is called spamming printf
<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
Itās a deadlock in a random part of potentially the schedular

A GDBstub is IMO really nice here
Which I have made
I can just attach it
Make it run
Wait for it to lock which takes 10 seconds
Stop it
Backtrace
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
"it should just work" - famous last words
I am curious but I also have this shitty uni assignment (java and we have to use inheritance/oop) I gotta do :(
hmm not sure I'll get it finished today but maybe š¤·
tbf as long as nothing gets trapped into a cli section its not a "true" deadlock here as it can still get high prioirty things
but we shall see
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

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
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;
lmao oops
lmfaooo
bte does this look correct @cyan bison?
for IRQL stuff
yes
ty
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 
only without lto
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

And I will support MMAP under tmpfs
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
anything but vfs
To be fair the build system is probably worse than the current VFS

then get a better BS build system
Yeah š
I have like way too many random bash and python scripts
The libc script is good though thatās staying
also if you still want to use borscht then i dont think its gonna help the random bash script situation 
fair
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
also a good time to clean this function up
š
this should be fully safe now
atleast from crashing ze kernel
500000000 lines of code
Nah itās not that bad
yoooooooooooooooooooooo
The slab is so fucking based
It also stress tested my VMA
And it looks to be working mostly fine


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
slabs are based
And well the metadata is always smaller than the describing region so
It should play out fine for a while at the very least
Ya know maybe I could benchmark this

And track the size of the tree and how many nodes are in it
Or I can just make a command that iterates through the entire thing too tbh and be lazy instead of counters
(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
Then a macro that just auto casts can be made where needed to interface with these functions per thingy?
Maybe not that
when disk loading
later
i wana get bash first
and the big code cleanup
you want to have linked list for fds right
i also mentioned that
then why you need bitmap
like you can just pick lowest free fd from list or make new
I always need the lowest and a bitmap is cheaper than checking the entire linked list
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)
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
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
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
makefile > meson so good choice :3
:3
welp time to wait for debootsrap
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
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
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
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
You should add KConfig to the build system 
No im gonna use borcht
From @peak cloak
I love make menuconfig rahh
Thanks for using Borschtā¢, please do not die!
-# Copyright (c) 2026, jastahooman, licensed under the 3-clause BSD license plz do not infringe
as stated in the instruction manual
literally
I may use borcht later to pick what programs to compile
I think the BSDs do this
the linux hybridmicrokernel (
) is the peak example of a monorepo
it has drivers for everything in ts
I mean userspace too
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
fair
just gotta wrap up implementing these
Oh and then test
I already have the shell script to execute these etc too
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
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
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?
Yes
What is this cool thing?
attribute
tells the compiler to access the variable via gs:
in clang its an alias for a specific address_space attribute
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
But how does it know the offset from gs to use
...
What
it accesses the variable with gs:
Yes?
I am not understanding
gs:??
lol
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
oh
Iāve tried to lookup clangs documentation on address spaces before but always came up empty handed for x86-64 stuff
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
that's nasty as fuck š„
not really
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?
no
ehh, well no so if gs is zero the accesses would point to the original section
it just tells the compiler to use gs instead of ds for the access iirc
So how does this work? For this?
Like???
So it ends up not being relative because gs has to be zero??????
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
So gs = original_section - new_address
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

