#Fishix
1 messages Β· Page 2 of 1
I would've tried that but was told it was gonna come soon so went to do other stuff
π₯
I could try taking my mlibc-linux-os-test work and continuing it into a proper mlibc profiling thing
but anyways thats the fishix thread not managarm
Brother go review open PRs into bootstrap mlibc and Managarm
Help me unblock Linux-mlibc
bet
ougghhh i added some debug lines to figure that out but this time the same thread deadlocked instead of segfaulting
i sent a fake sigsegv from htop to get this trace
ok i managed to catch this in debugger
not sure why i bothered but
for some reason theres a read-only page mapped inside a read-write mapping
how...
god damn it qemu sdl gui doesnt support scrollback in the monitor console
and gtk gui is broken af on wayland
omg nvm the sdl does have scrollback
with ctrl+pageup
they lied to me.....
ok thats 7 years old
nvm the scrollback doesnt go far enough π
surely theres a way to print the memory map in gdb console
good news
gemini figured out the page fault after burning through 10 rain forests
apparently i forgot to invalidate pages when merging into existing ranges
i have so many stupid 1 line mistakes like this everywhere ugfhfgjhfgjkhjfgkhfghfdg
bad news it still randomly deadlocks
and this time i got a run where it didnt deadlock but its just stuck
like
the window is still rendering and the internal server is running because i apparently got shot by a skeleton after a few minutes
did u like explain to it how to run qemu etc?
no i just gave it the vmm code and asked to find a way that a read-write range could end up containing a read only page
ah
Is there a mlibc todo? I wouldn't mind working on it when I have some time
I believe in alternatives to glibc π
See open issues and/or find something that isnβt implemented or that you think can be done better and work on that
π
yeah
if you have logind and get in this state it tells you to switch to a tty (and how to do it), log in, and run loginctl unlock-session 2 (sub 2 for whatever the session number is)
nice path
why do these exist
its not even documented on linux manpages
accidentally wrote a slash when creating the file
it replaced it with a fake slash character??
lol
ok at least executing a file works now
no idea how its managing to get that path
fcntl for noobs
apparently gcc wasnt working and i thought it was related
but apparently its because my $PATH somehow contained a .
and that breaks gcc for some reason
idk what even set my path to include .
i dont set it myself
interesting
when running something with shebang the normal argv[0] gets turned into an absolute path argv[1] i guess
or only when its not a relative path?
idk
yippee
idk if the way i fixed it is even correct but whatever
ignore the fishos column idk why thats there lol
it ran all the include and namespace tests too so it was an absolute memory leak stress test
created about 48000 processes
is it bad
bad is relative
i dont really care about the failing tests at least rn i have much bigger problems to deal with lol
what the hell is fishos
most of the % come from glibc
old name
yea
did you ever clear your sysroot
its funny that ur running the entire kde thing and getting shitty posix test results
like the bar is super low apparently
almost as if most of the pain is just porting software
that makes me pretty happy
a lot of the tests are for things that dont really matter
yea its neat
yes
you need to ignore the entire include() section
and compile time tests
because that just means it compiles
not that it actually works
and the namespace section idk why they even added that
namespace pollution
so you don't declare types and/or functions when the standard says you shouldn't
e.g. with different posix versions
glibc isn't even very accurate there
mlibc tries to be as accurate as possible when it comes to standards conformity
example of bigger problems to deal with
i cant free the kernel stack without causing crashes because of a timer struct in the stack being used in a linked list
yeah os-test is something for when you've got most things implemented and don't need to care about stuff anymore
fixed
i hope there arent any other problems with freeing the stack because they might be really annoying to find later
i fixed so many bugs today :)
I'm starting to think Linux binary compat is the way
if you want to show stuff off yes
I don't see any disadvantages if you keep it separate from the rest of the kernel
Linux binary compat does not imply your kernel has to copy linux's design
What I'm gonna do is have my own thing, then Linux binaries will run in the kernel-mode Linux compat subsystem
linux design = api internals?
binary compat is cool because you can just make it source compatible afterwards
wdym
well you can't change the linux apis
yeah i know
but that doesnt mean your kernel has to work like linux
to be binary compatible with it
it kind of does
how do you do procfs without procfs
you only do procfs stuff in the linux subsystem
or something like netlink
you keep the linux stuff logically separate from the rest
just posix doesnt cut it, so might as well do linux
yeah that is what i aim to do too
and linux compat is implemented using these interfaces
if possible
i am not in a position to argue about it tbh, but i don't even do source compat
thats literally freebsd
linux .ko binary compat
no
it just has a kernel module for linux compat
that emulates linux syscalls for binaries that have that bit set
β οΈ
Soon the entire server will convert to linux compat 
it's very tempting since its easy af
real
ok um
apparently i never actually implemented SO_PASSCRED
i added it as a socket option and added the boolean
but i didnt actually implement the behavior
but i remembered as if i implemented it
im so fucking stupid its insane
its 3 am so i should probably sleep instead of doing this
Turkey?
smh dont doxx me
Lol
nah since i dont have the burden of old bsd code
damn i also need to implement fd passing
i guess it will have to be for tomorrow then...
mihoyou games have kernel level anti cheat mhyprot2.sys, and the .sys extension already screams windows
no i havent worked on that yet
i would need to fix my gs base logic
you are scaring me
wdym
are you talking about mash
building and running nbcraft
not sure why the kde compositor disappeared lol
it was causing lag anyways
default settings
Wdym disappeared
disabled
oh right its probably because of nbcraft
sdl windows disable the x11 compositor by default
I mean I still see kde window frames etc
100 fps at lowest settings
i havent tested in a while but it should work
last time i tried i was on mlibc running jwm and gtk
and it worked fine
ill try it tomorrow
What even is nbcraft
Oh
huh why cant i place down a bed
Is this for your OS?
Survival mode is broken and wip at the moment and yeah beds dont really exist lol
yea
ah
nice
β οΈ
π₯
ugh unix socket ancillary messages are so annoying
apparently im only supposed to send and receive 1 ancillary message of each type per sendmsg/recvmsg
if i understand correctly
i forgot i said this
i should do it now
the usb i normally used for real hw booting is 2 gb though
hmm
actually maybe theres a way to boot without usb
its kinda annoying to flash a massive image
i love grub
nvm thats not going to work
at least if i want to load an iso file
i think i could still create a fat32 partition on my ssd and flash there
how was it working before π
Nothing really uses gs in 64 bit linux userspace I think other than smth like wine
So the gs base just
Stayed there
yea
ok done
i should have done this a long time ago
it loads instantly when its on the ssd
on qemu loading the initramfs takes like 20 seconds so its almost faster to just reboot into it lol
anyway one small problem
it hangs because of PS/2: Command write timeout
π
Astral curse moment
do you have a ps/2 keyboard connected?
what does your timeout detection code look like
my punishment for copying your ps/2 driver
no
then what do you expect
Bro u copied the one part that is like the joked about bad part of astral
π
out of curiosity where exactly does it hang?
No idea, it works on all my hardware so I am in the dark about those issues
i see
hmm bios has an option for legacy usb support and its enabled
though i remember on my previous motherboard it only worked when i booted in csm mode
idk how i would boot into limine in that mode though
also the mouse was kinda buggy even then but it did somewhat work
i should just write a xhci and usb hid driver real quick fr
in my case these first 2 commands time out and the flush_out_buffer enters an infinite loop
i guess i should add a timeout to this
and return from init if the commands are failing
i see
well it works in real hardware
but i cant interact with it :(
(i launched glxgears by modifying the init script lol)
holy fps
yea
do u not have ps2?
astral also has llvmpipe and it gets like 300?
mlibc i guess
Astral could use my gears code to beat llvmpipe
idk how to get ps2 emulation working on my motherboard

nvm u cant
i thought it was a laptop
yea it works on my laptop but im too lazy to boot it there
also idk if 8 gb ram would be enough 
yea it boots pretty fast
nice
its unfair because for most hobby kernels performance issues come from slow io drivers afaik
meanwhile im just loading initramfs directly into ram
I really need to profile it but its a glibc thing I think
Astral on iretq's machine gets like over 1k fps
also this is still single core....
Yeah I nuked a big part of the kernel profiler trace
Literally no improvement
There needs to be some serious profiling but thatll come in time
atp u have to try porting glibc to astral
Nah

I want mlibc to be a proper glibc alternative and it wont get there without use
based
i mean i didnt say u should replace mlibc
I dont have a huge build server to maintain two distroa
I build stuff on a i5-10300h
π₯
write xhci
scary.......
wtf why is there a high quality youtube tutorial for this
really? 
shouldnt this be like too niche
just read usb book and xhci docs instead of this
but i dont have an attention span :(
i got it for 15 days
(its my first documentation which i read)
watching the tutorial at 2x speed rn
fuck i need contigous physical pages
actually i could add that easily
do you have only bump allocator
no i use free list for physical pages
do buddy
bitmap
Gen z π
someone should make osdev tutorial for gen z with subway surface gameplay
when fishix disk loading btw
i do have a virtio blk driver already but im too lazy to implement ext2
so its just sitting there doing nothing
what for
nvm i guess its not required
xhci progress
driver now resets and starts the controller, sets up command and event ring, sends a test command and receives event in irq
so far its been really simple
like almost simpler than virtio
wait until you find out that real hardware exists
but yes xhci is pretty simple overall
real
the usb devices are the ones that are stupid
All modern devices are like that basically
GPUs, nvme, virtio, mellanox nics etc etc
All utilize in-memory command rings
Have sq/cq in some way
its a pretty nice system
bruh...
wasted like 2 hours being confused because i accidentally wrote a condition in inverse
xd
xhci progress
implemented port resetting, setup the input context for the device, and sent the first set address command
also made the command requests async with the coroutine infrastructure i wrote before for virtio
will you do boot protocol or hid
idk i didnt look at the later parts yet
do boot protocol if you want to have at least keyboard and mouse
(its easier)
is hid significantly harder
Hid is just parsing a structure that tells you how to parse packets
xhci progress: successfully read the device descriptor on real hardware (qemu pci passthrough of the real xhci)
now i just need to read some more descriptors, hope the mouse supports boot protocol, setup the input endpoint, and begin receiving data
im not sure if the way i find the device by resetting every port is actually a good idea, ill return to it later
every mouse supports boot protocol
at least if you can use it in your firmware settings
Boot protocol is lame
i love how pci passthrough just hangs the entire system sometimes
ok this time it just instantly shut down the system when i tried to undo the passthrough
i guess i should do this testing later lol
itβs nice to implement in the beginning, just to make sure everything works
Yeah
my brain is kinda fried rn
i finished configuring the device i think
but i cant get it to give me data from the endpoint
i place a normal trb in the endpoint 1 IN transfer ring and ring the doorbell and it just does nothing
usb_xhci_ep_kick slotid 1, epid 3, streamid 0
just says this in the qemu trace
you're probably not configuring the endpoint correctly
am i supposed to do anything other than sending a Configure Endpoint command after setting up the endpoint context
no, but what you put in there matters
you also need to set a bit in the slot's input context
im assuming you followed 4.8.2.4? (Endpoint Context Initialization)
ok lmao i found the issue
i calculated the endpoint context pointer incorrectly π
its always the stupidest shit...
gg ez
lets see if passing through the real xhci will actually work or it will crash the whole system again
x to doubt
dang it
btw how do u pass it through without disabling your keyboard etc
inb4 uses ps/2 keyboard
for some reason my motherboard has a bunch of seperate controllers that each have their own iommu group
lol
fair
but yeah xhci on real hw can be finicky
so i didnt expect any% driver to work right away
it gets further if instead of sending 2 seperate address device commands (first one has BSR bit set) i just send 1 without the bsr bit
wait why
i have no idea
how did u even come to the conclusion of "if one address command fails lets send two and see what happens"
uhh its what i saw somewhere idk

its not about it failing
why are you setting the bsr bit
didnt it fail on your screenshot?
the one that failed was the 2. address device command
due to being silly i am randomly following either a questionable usb book or xhci spec or some guy's code based on the questionable book
and the book said i have to do that or something idk
what is the questionable book?
yeah you should stop reading that
the fysos one
and follow actual good code
just dont set the bsr bit
i have never seen anyone have to set it
so you don't have to either
yea that one
it had some straight up wrong information that i noticed
like what?
uhhhhhhhhhhh
like the set address command not mentioning a slot id
i forgot the other thing
yeah the book is not really spec replacement
if thats wrong this guy is on the osdev forums and he always replies to questions and takes feedback
i think that's for like low speed devices
the spec also mentions this
yea i guess thats the case
"for some legacy usb devices"
is this from like the devices expecting old nt behavior?
also yea but the book literally shows the layout of the set address command trb with the part where slot id is supposed to be as "reserved" which i think is a bit silly
u should let him know
lol funny
lol i just remembered that i forgot to implement the legacy support bios handoff
thats probably why the real hardware wasnt working
if the qemu ovmf firmware takes control of the mouse
idk if it actually does
damn i think i also set the slot context's context entries count wrong
rahh i cant wait to get back home and fix it
well shit seems like the issue wasnt either of those
ok
bruh bochs doesnt support msi-x
ok apparently you can just register the pci interrupt line as an irq and it just works
i never even checked because osdev wiki said you need acpi or whatever so i just noped out 
acpi is only needed if you use the apic
i use the apic
you probably use it in virtual wire mode so the pic is still connected
hm ok that shouldnt've worked
maybe it just so happens that the pci interrupt number matches the input
aka just luck
lol
le fishe au chocolat my beloved
is that the fishix logo
01161623669i[USBHID] The first request after an initial reset must be the Device Descriptor request with a length equal to the max packet size allowed for device.
01161623669i[USBHID] For low-speed devices, use an 8 byte length. For full- and high-speed, use a 64 byte length. For super-speed, use a 512 byte length.
01161623669i[USBHID] The device expects a reset, MPS-bytes of the descriptor, another reset, set address request, and then the full 18 byte descriptor.
01161623669i[USBHID] Some devices (more than you think) will not initialize correctly without this (non-USB compliant) sequence.
hmm
is this bochs logs?
yes
also i had a bug in my config descriptor parsing and it got further after fixing that and says
02190567443e[USBHID] SETUP packet found while expecting Status Packet?
02272547817e[USBHID] SETUP packet found while expecting Status Packet?
yea lol
ok i fixed this warning
still not sure why this one happens
aha
apparently i needed to set the DIR bit on the status trb when sending host->device requests with no data returned
there are no warnings left and it works in both qemu and bochs
lets see if it works with real now.........
nope its even worse now

because i added back the address device shenanigans
what does this assert even check
ignore the assert its just my async stuff being extremely stable and able to handle error conditions without exploding
wait why does it even say that it failed to sent the usb request
the status looks like a success
is bochs hw accurate in xhci ?
ok maybe i cant just ignore it and theres actually a massive issue with how the async system works
they tried pretty hard to make it accurate
holy shit
the configure endpoint command finally succeeded for once
but then the set idle command failed
ill try just not sending that
apparently its because i didnt set the interval field of the endpoint context
i had originally set it and then commented it out because i thought it was a problem
it was probably one of the other things that caused it to break before
i havent fixed the address device thing yet btw i just commented it out
hmm
gg ez
i am not going to bother figuring out all the mess rn
i just wanna write the evdev interface for it immediately
yea
i never used bochs before so it took like half a hour to figure out how to set it up lol
i didnt know it was useful like this
ok i hooked up the mouse to an evdev device in the hackiest way possible
for some reason it has crazy senstivity though
it just instantly jumps accross the screen
all of the input reports have either the minimum or maximum value
very weird
this is the normal qemu mouse btw
oh i guess im supposed to just interpret the axis value as only -1 or 1
actually no evtest on linux has a proper range
rahhhhhhhhh im trying to do a full test on real hardware now and its hanging when trying to read the manufacturer string of some weird ass usb device that doesnt even appear on lsusb
are you checking is this device connected (is there device on port)
im guessing the usb request fails and then it does the stall thing which im not sure how to handle
yea i can read the device descriptor of it
and the language string descriptor
afk
update
fixed that issue by sending an evaluate context command after getting the new max packet size
i was doing that before too but i commented it out when trying to get the address device shit to work
now all of the usb devices are correctly configured and the system boots into kde
except uhhh
mouse works... but only when moving it vertically
its locked on the y axis
i dont understand how thats even possible
its not like im doing anything different for their handling
so i guess the mouse just doesnt implement boot protocol properly yet says it does
idk why the qemu mouse is so messed up too
do i really have to parse the damn hid report
ok yea its just straight up lying about being boot protocol
it uses 16-bit fields for x and y instead of 8 bit
Its not that difficult
yea but im a lazy coward
also i just realised why the qemu mouse is working badly im a dumbass
Why
i was doing weird shit with the x and y fields when i was supposed to just pass them as an int8_t
Oh
implemented basic hid format parsing
well i havent actually made it parse the received data
ill do that now
done
both qemu usb mouse and real passthrough mouse are now fully functional with the mouse wheel and 5 buttons
time to finally use kde on real hardware
at least as much as i can use it with only a mouse
yep it works
gg
exposing usb hid keyboard with evdev is so much damn harder than the mouse lol
why is that?
the report format is completely different from ps2 keyboard
evdev keyboard is very similar to ps2 keyboard
Is it like keys pressed at once
yea usb keyboard gives you 6 keys that are currently pressed
evdev gives events for keys that are being pressed, repeated and released
hid maps to evdev very nicely wdym
you can map each output report to an evdev event and slap an EV_SYN, SYN_REPORT at the end
how
its like that for the mouse
but the keyboard requires keeping track of which keys changed
well yeah but your evdev code should keep track of that
wait, are we talking about hid report protocol?
that should give you a full keyboard state on every report
for boot protocol you'll need to keep track of which keys are pressed in a bitmap yourself, that's true
but i think that report protocol for keyboard usually is a bit array of keys
uhh unless im doing something wrong the report protocol for my keyboard is identical to the boot protocol
interesting
let me check the usb hid spec
are you sending a Set_Protocol request?
i am
heres the full log for my real keyboard
the 2. report seems to be for extra keys that im not using
- report is 05 01 09 06 a1 01 05 07 19 e0 29 e7 15 00 25 01 75 01 95 08 81 02 95 01 75 08 81 01 95 05 75 01 05 08 19 01 29 05 91 02 95 01 75 03 91 01 95 06 75 08 15 00 26 ff 00 05 07 19 00 2a ff 00 81 00 c0
0x05, 0x01, // Usage Page (Generic Desktop Ctrls)
0x09, 0x06, // Usage (Keyboard)
0xA1, 0x01, // Collection (Application)
0x05, 0x07, // Usage Page (Kbrd/Keypad)
0x19, 0xE0, // Usage Minimum (0xE0)
0x29, 0xE7, // Usage Maximum (0xE7)
0x15, 0x00, // Logical Minimum (0)
0x25, 0x01, // Logical Maximum (1)
0x75, 0x01, // Report Size (1)
0x95, 0x08, // Report Count (8)
0x81, 0x02, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x95, 0x01, // Report Count (1)
0x75, 0x08, // Report Size (8)
0x81, 0x01, // Input (Const,Array,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x95, 0x05, // Report Count (5)
0x75, 0x01, // Report Size (1)
0x05, 0x08, // Usage Page (LEDs)
0x19, 0x01, // Usage Minimum (Num Lock)
0x29, 0x05, // Usage Maximum (Kana)
0x91, 0x02, // Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
0x95, 0x01, // Report Count (1)
0x75, 0x03, // Report Size (3)
0x91, 0x01, // Output (Const,Array,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
0x95, 0x06, // Report Count (6)
0x75, 0x08, // Report Size (8)
0x15, 0x00, // Logical Minimum (0)
0x26, 0xFF, 0x00, // Logical Maximum (255)
0x05, 0x07, // Usage Page (Kbrd/Keypad)
0x19, 0x00, // Usage Minimum (0x00)
0x2A, 0xFF, 0x00, // Usage Maximum (0xFF)
0x81, 0x00, // Input (Data,Array,Abs,No Wrap,Linear,Preferred State,No Null Position)
0xC0, // End Collection
// 65 bytes
wait i wonder what this one is
XHCI: Dumping data: 09 04 01 00 01 03 00 00 02
XHCI: Unsupported interface found, skipping (class: 0x3, subclass: 0x0, protocol: 0x0)
nvm im stupid
that one is just the 2. report with the extra keys
so yea
i see
(apparently my code doesnt skip it properly π )
sorry if i said anything confusing, im too tired for this stuff
nah you didnt
you do need to keep track of key state in evdev because there is an ioctl to get it
but i dont think that helps you with sending the right events
as in, you still need something to generate the key up event
yea i do have that
damn
the driver is still quite unfinished but it works well enough
baremetal or passthrough only?
baremetal
so u can use kde properly now
a video would be way cooler
damn
but yeah crazy work
u made like a full xhci driver with hid support for both keyboard and mouse in like 3 days
yea lol
i dont remember the last time i was this locked in to a project
xhci and usb are really not that bad (maybe the more complicated stuff like hubs is where it gets hard idk)
damn that's pretty damn cool
You would have already if you didnt spend 30k lines of code in a hello world

Naaah I have maybe 5k loc tops
also xorg is surprisingly good at handling shitty evdev reports
the usb keyboard driver is super janky rn because i was lazy to do it properly
yet it barely causes any problems with xorg
hmmm what should i work on next
so many things to do
i wanna see if i can do SMP speedrun
- implement mutex (its basically an atomic and an event object glued together right?)
- put mutex in syscall wrapper
- add multiple queues to scheduler
- make the important scheduler functions thread safe
- make the other cpus start running those queues
did i miss anything
right i already have some spinlocks around stuff like that
completely untested though
i mean on a up system a spinlock can just be cli()
idk if i even do interrupt disabling properly
i have interrupts always disabled in syscalls juuuust in case
not disabling it doesnt seem to break anything at all
but it doesnt seem to impact performance noticably
β οΈ
do your syscalls never block?
by that i mean they only enable interrupts when they are going to block
i mean i get that its kind of meant to be a speedrun etc
things wouldnt be working so well if i didnt block lol
π
why is it a bad idea though
because you allow your userspace to steal a shit ton of cpu time by issuing heavy syscalls
i do still try to add proper interrupt locks to my code btw but i just keep them disabled out of paranoia
especially if you dont have smp
i guess my syscalls arent heavy enough for that to matter
actually nvm its probably part of why the rest of the system becomes almost unusable while minecraft is running
yeah thats probably why
but i also have a super basic round robin scheduler
nah a basic round robin should be good enough
its just that you dont guarantee any time slices
man why do I even bother minimizing interrupt latency and preemption disabling when I could run kde π
real
Ikr
join the compat army
nice
Theres a diff between compat and speedrun smh
yeah fair
I dont want to pollute my design with linuxisms
so the idea is to keep that stuff separate
like *bsd linuxulators
freebsd even emulates the linux modules API
I will take a better route for astral and just run everything not ported through wine
Random linux application? Some linux emulator for windows ran thru wine
thats a decent route

weird route
ideally i'd do it as a userspace subsystem but i dont think that's really feasible without polluting the kernel, so might as well put it there
why? wine is quite fast
Detect something is a pe -> launch wine pointing to it a la shebang
That implies looking at bash code. I do not want to look at bash code.
tbh its not exactly hard to support in kernel
just treat it as an elf that had an interpreter set
or well i guess u dont load that binary at all in that case
ok i removed the interrupt disable and it doesnt seem to change anything at all
the rest of the system still becomes super laggy when mc is running
are you sure round robin is actually good enough
yes
the point of the round robin is to give equal time to everything
if anything super smart poorly implemented algorithms could cause that but not round robin
doesnt basic round robin basically mean that when a thread is constantly running everything else in the system becomes 2x slower
the cpu time is split between N runnable threads equally
i did hear that a good way to improve upon the basic scheduler is to implement priorities then make it boost the priorities of threads that spend a lot of time being blocked
ill do smp first and look more into schedulers if it isnt good enough
wtf
i posted on r/osdev and it was instantly removed
?
is it cause im on a new account with 0 karma
probably
rahh
get a 500 day streak or something first
π
I have a 400 day one because apparently it's not really a streak
doesn't get reset on the next day if you don't use reddit
oh i got a notification that i couldnt see because ublock broke the reddit ui for some reason
Your submission in r/osdev was automatically removed because your account has less than 5 total karma. This helps us cut down on spam. Once you have 5+ karma, feel free to try again. If you think this was a mistake, please message the mods.
make 5 comments or something
or upvote 5 things
upvoting gives karma?
Then you could just make a bot that upvotes stuff
Just comment some random stuff and ask everyone gere to upvote
Comment 67 on some r/osdev post ez
doesn't a comment = 1 karma
pls upvote
π
that one doesnt count i think
Shouldhave been 67, not upvoting
π₯
Done
thank
Done
when you created ur account
a week ago
hi chat im back
i can finally make the stupid post now
yay yippee woohoo
ok i should start the smp speedrun
i lowkey forgot about this
xd
just run the windows version of that linux application π
my bro doing smp after getting minecraft 


Valid tho.
mf called binfmt
ugh its been ages since i wrote my APIC code
time to read it to figure out how it works again 
ok i now have all the cpus running threads
debugging 1 million race conditions time yayyy
well i managed to get into bash
though it explodes if i press a key
i have some problems i need to deal with about process deletion
oh right i also have to do tlb shootdowns now
though none of the processes running rn are multithreaded so thats not the problem rn
U can still free kernel memory
oh right
if owner == me then return true
i changed it to just lock and listen the events one by one instead of trying to lock all at once
Also I think if you have duplicates something's fishy
its because of poll
poll can be called with the same fd contained twice
and deduplicating it would be annoying
so i just try to correctly handle duplicates
which im not sure if its a good idea but it seems to work
Fair enough
You back your io polling system with events. I back my events using my io polling system. We are not the same
real
currently dealing with endless locking issues inside the vmm
i implemented tlb shootdowns
and also added locks to the input system
bash still explodes when i press a key though
i fixed this btw, i probably wouldnt have noticed it if you didnt point it out so thanks :3
ok bash no longer explodes
apparently i forgot to make the current pagemap a cpu-local 
how it feels to add smp
rn i keep getting a weird ass page fault in the kernel heap
fault handler finds that the page is present, error code says its not present
seems like i also might not have implemented mutex correctly
real
this can happen if you're updating page tables while another thread in the same process is running, and you just need to invalidate the page and try again
unless you forgot to check some condition like "thread is trying to write but this page is read-only" or "thread is trying to execute but this page is NX"
(I actually screwed up that one)
what you have kdeplasma and not even smp?
he did jump to userspace
honestly SMP should be one of the first things you get working in a kernel
not saying that adding SMP support to an existing non-SMP kernel isn't possible
but it's more difficult than just starting out with SMP already planned out
hmm ok ill try that
well i have bash running 2 minutes ago and i dont have smp lol
that worked btw thanks ^w^
for the past few hours i have been trying to get the scheduler to not explode from race conditions or deadlocks
my scheduler code is such a mess i should probably just completely delete and rewrite it
race condition is the most crap part of smp
but i probably wont do that 
np
you can ask me (almost) anything else about SMP if you want
ok thanks
while trying to make the scheduler work in smp i instead managed to break it in non-smp
It's always advisable to start implementing smp at the earliest
I don't know who gave me that advice (probably static) but they were damn right
yes, you should do it as soon as you start. it's much harder upgrading an existing design to SMP than it is to create an SMP system from the get go
no if you want to suffer with race conditions
(even tho i technically do have multitasking but its just a shell)
and the shell just waitpids
so i (hopefully) wont have too much trouble
if they don't start now it'll be much harder to switch to SMP later
i meant this
well they said "should I start with smp... rn" and you said "no"
no if you want to suffer with race conditions in future*
that's why the word "unless" exists
yes, unless you want to suffer with races in the future
ok i finally stopped procrastinating and actually split the code in sched.cpp into 3 files
I need to do the same tbh
hows your smp coming along
currently xorg is broken in non-smp and im not sure how i managed to reach this point
i didnt work on it yesterday btw
hopefully i shouldnt be far from having inefficient but working smp once i fix this stupid bug
well git bisect will tel u
i didnt make any intermediary commits
lol
what the fuck is this person doing???????????????????
Fishix UWP
UWP host for the Fishix kernel β run Linux applications inside a Universal Windows Platform container with no emulation layer, direct framebuffer display, USB passthrough, and cross-app IPC.
its all vibecoded btw
fishix on xbox one real??!?!?!?!?!
π
bro π
ok i decided to stop rotting and work on fishix again
i found that reverting event.cpp to the pre-smp code fixes xorg deadlocking on single core
then tried slowly reintroducing changes
and uhhh
removing these functions and their calls causes it to break??????
the functions do literally nothing
but it seems like not calling them somehow causes xorg to get stuck permanently while launching
ok nvm i slowly removed them again and now it didnt happen
dfghsdfjgjkdfdbhjfbsdjhfbdhjgdfgg
lol it happens sometimes
due to the overwhelming amount of memory safety issues in the codebase i have decided to start rewriting the project in rust
if its not written in rust its collecting dust
nooo π
π π π

Wait a minuteβ¦ itβs like Unixβ¦ but Fish?
what do you have ported so far?
it's Linux compat
I see
hows the kernel now?
it runs linux binaries directly, notable things that work include: kde plasma desktop, minecraft, factorio, gimp, netsurf (cant browse the internet yet due to no tcp support tho)
havent worked on it because the smp issue is super depressing
i have no idea how to fix it so im genuinely considering a rust rewrite rn
(its probably just a tiny mistake in some random code that doesnt require a full rewrite)
projects die in rewrites
true
Just one more rewrite bro
rewrite in rust

true
i think ill be adding SMP once im able to get a terminal emulator (st) to work
working on a side quest (ctrl + c to kill programs) now
let ai find the bug
@claude fix the bug make no mistakes
true
already tried
id start adding smp immediately
like right at the beginning was the best time
currently i dont have any multithreading support so it should be easy to add
and rn most of the time i only run one process
(bash just starts a new process and waitpids)
well for now
its not just multithreaded support per-process
SMP is multithreaded
