#Fishix

1 messages Β· Page 2 of 1

abstract kestrel
#

then one could test it meme

restive bison
#

I would've tried that but was told it was gonna come soon so went to do other stuff

#

πŸ₯€

abstract kestrel
#

lol

#

busywithworkandotherlifedrainingbs

restive bison
#

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

charred storm
#

Brother go review open PRs into bootstrap mlibc and Managarm

#

Help me unblock Linux-mlibc

restive bison
#

sure

#

give #

charred storm
#

One sec

#

Managarm 1287, mlibc 1687 and 1688 and bootstrap 657

restive bison
#

bet

sacred grail
#

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

sacred grail
#

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

sacred grail
#

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

runic cloud
#

did u like explain to it how to run qemu etc?

sacred grail
#

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

runic cloud
#

ah

stuck hemlock
#

I believe in alternatives to glibc πŸ™

charred storm
abstract kestrel
sacred grail
#

funny kde message

tropic ravine
#

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)

sacred grail
#

crazy

#

hhhhhh

abstract kestrel
#

nice path

sacred grail
#

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

abstract kestrel
sacred grail
#

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

sacred grail
#

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

sacred grail
#

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

abstract kestrel
#

87 πŸ’€

#

time to fix

sacred grail
abstract kestrel
#

bad is relative

sacred grail
#

i dont really care about the failing tests at least rn i have much bigger problems to deal with lol

runic cloud
#

what the hell is fishos

abstract kestrel
#

most of the % come from glibc

sacred grail
sacred grail
abstract kestrel
runic cloud
#

its funny that ur running the entire kde thing and getting shitty posix test results

#

like the bar is super low apparently

abstract kestrel
#

galaxybrain almost as if most of the pain is just porting software

runic cloud
#

that makes me pretty happy

sacred grail
abstract kestrel
#

tcp

#

and i'd say standards conformance is a neat thing to have

sacred grail
#

yea its neat

runic cloud
#

glibc probably gets u most of the way there

#

u just have to have the syscalls

abstract kestrel
#

yes

#

you need to ignore the entire include() section

#

and compile time tests

#

because that just means it compiles

#

not that it actually works

sacred grail
#

and the namespace section idk why they even added that

abstract kestrel
#

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

sacred grail
#

i cant free the kernel stack without causing crashes because of a timer struct in the stack being used in a linked list

abstract kestrel
#

yeah os-test is something for when you've got most things implemented and don't need to care about stuff anymore

sacred grail
#

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 :)

stuck hemlock
abstract kestrel
#

if you want to show stuff off yes

stuck hemlock
#

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

abstract kestrel
#

binary compat is cool because you can just make it source compatible afterwards

stuck hemlock
abstract kestrel
#

well you can't change the linux apis

stuck hemlock
#

yeah i know

#

but that doesnt mean your kernel has to work like linux

#

to be binary compatible with it

abstract kestrel
#

it kind of does

stuck hemlock
#

like, procfs sucks

#

no

abstract kestrel
#

how do you do procfs without procfs

stuck hemlock
#

you only do procfs stuff in the linux subsystem

abstract kestrel
#

or something like netlink

stuck hemlock
#

you keep the linux stuff logically separate from the rest

#

just posix doesnt cut it, so might as well do linux

abstract kestrel
#

i mix and match interfaces from different systems

#

whatever i deem "clean"

stuck hemlock
#

yeah that is what i aim to do too

#

and linux compat is implemented using these interfaces

#

if possible

abstract kestrel
#

i am not in a position to argue about it tbh, but i don't even do source compat

abstract kestrel
#

linux .ko binary compat

runic cloud
#

no

#

it just has a kernel module for linux compat

#

that emulates linux syscalls for binaries that have that bit set

abstract kestrel
#

i know

#

im just saying

#

do .ko compat

runic cloud
#

thats kinda impossible

#

since linux kernel api changes every day

abstract kestrel
#

that's the joke

#

😭

runic cloud
#

☠️

#

Soon the entire server will convert to linux compat trl

#

it's very tempting since its easy af

sacred grail
#

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

runic cloud
#

Turkey?

sacred grail
#

smh dont doxx me

runic cloud
#

Lol

stuck hemlock
sacred grail
#

damn i also need to implement fd passing

#

i guess it will have to be for tomorrow then...

warm osprey
#

does it run wine?

#

try hi3rd lol

vast jetty
warm osprey
#

theres launchers for it

#

i play it on linux all the times

sacred grail
#

i would need to fix my gs base logic

jovial steppe
#

you are scaring me

warm osprey
#

wdym

jovial steppe
#

are you talking about mash

warm osprey
#

yea

#

now it works

#

its because of my problem

sacred grail
#

building and running nbcraft

#

not sure why the kde compositor disappeared lol

#

it was causing lag anyways

#

default settings

runic cloud
#

Wdym disappeared

sacred grail
#

disabled

#

oh right its probably because of nbcraft

#

sdl windows disable the x11 compositor by default

runic cloud
#

I mean I still see kde window frames etc

sacred grail
#

thats the window manager

#

compositor gives rounded edges, shadows, animations etc

runic cloud
#

Ah

#

Btw can u boot into this on real hw?

sacred grail
sacred grail
#

last time i tried i was on mlibc running jwm and gtk

#

and it worked fine

#

ill try it tomorrow

runic cloud
#

What even is nbcraft

sacred grail
runic cloud
#

Oh

sacred grail
#

@wraith forge :3

#

really nice project

sacred grail
#

huh why cant i place down a bed

wraith forge
wraith forge
sacred grail
wraith forge
sacred grail
#

oopsie woopsie

#

i actually swap my gs correctly now after years πŸ’€

normal sorrel
#

☠️

restive bison
#

πŸ₯€

sacred grail
#

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

sacred grail
#

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

wraith forge
restive bison
#

Nothing really uses gs in 64 bit linux userspace I think other than smth like wine

#

So the gs base just

#

Stayed there

sacred grail
#

yea

sacred grail
#

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

#

πŸ’€

restive bison
#

Astral curse moment

wraith forge
#

what does your timeout detection code look like

sacred grail
sacred grail
wraith forge
#

then what do you expect

sacred grail
#

right i should check if my bios even supports emulation

#

πŸ’€

#

im stupid

restive bison
#

😭

sacred grail
#

yes

#

because it would be funny

#

it works on my laptop btw

wraith forge
restive bison
wraith forge
#

i see

sacred grail
#

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

sacred grail
#

i should just write a xhci and usb hid driver real quick fr

sacred grail
#

i guess i should add a timeout to this

#

and return from init if the commands are failing

wraith forge
#

i see

sacred grail
#

well it works in real hardware

#

but i cant interact with it :(

#

(i launched glxgears by modifying the init script lol)

runic cloud
#

holy fps

sacred grail
#

yea

runic cloud
#

do u not have ps2?

stuck hemlock
#

how the fuck is it this fast

#

It's gotta be a glibc thing

runic cloud
#

glibc yeah

#
  • llvmpipe
sacred grail
#

so its 34% faster

stuck hemlock
runic cloud
#

mlibc i guess

stuck hemlock
#

Astral could use my gears code to beat llvmpipe

sacred grail
stuck hemlock
runic cloud
#

i thought it was a laptop

sacred grail
#

yea it works on my laptop but im too lazy to boot it there

#

also idk if 8 gb ram would be enough troll2

runic cloud
#

but yeah crazy perf for 15k loc

#

does kde boot fast in general?

sacred grail
#

yea it boots pretty fast

runic cloud
#

nice

sacred grail
#

meanwhile im just loading initramfs directly into ram

runic cloud
#

nah thats not it

#

glxgears dont really do io

#

nor does minecraft

#

etc

sacred grail
#

wait right im stupid

#

πŸ’€

restive bison
#

I really need to profile it but its a glibc thing I think

#

Astral on iretq's machine gets like over 1k fps

runic cloud
#

99% it is

#

since u said u halved kernel time and it was still slow af

sacred grail
#

also this is still single core....

restive bison
#

Literally no improvement

#

There needs to be some serious profiling but thatll come in time

runic cloud
#

atp u have to try porting glibc to astral

restive bison
runic cloud
restive bison
#

I want mlibc to be a proper glibc alternative and it wont get there without use

sacred grail
#

based

runic cloud
#

i mean i didnt say u should replace mlibc

restive bison
#

I dont have a huge build server to maintain two distroa

#

I build stuff on a i5-10300h

#

πŸ₯€

summer lotus
sacred grail
runic cloud
#

it is

#

its not that bad but

#

edge cases, hub support etc

sacred grail
#

wtf why is there a high quality youtube tutorial for this

runic cloud
#

really? KEKW

sacred grail
#

shouldnt this be like too niche

summer lotus
sacred grail
runic cloud
#

any% xhci

summer lotus
#

(its my first documentation which i read)

sacred grail
#

fuck i need contigous physical pages

#

actually i could add that easily

summer lotus
sacred grail
summer lotus
sacred grail
#

hmmmmmm

#

nah

summer lotus
#

bitmap

restive bison
summer lotus
summer lotus
#

when fishix disk loading btw

sacred grail
#

so its just sitting there doing nothing

young copper
sacred grail
sacred grail
#

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

young copper
#

wait until you find out that real hardware exists

#

but yes xhci is pretty simple overall

sacred grail
#

real

young copper
#

the usb devices are the ones that are stupid

runic cloud
#

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

restive bison
#

its a pretty nice system

wraith forge
#

i love github !!!!

#

also

occured

#

that's wrong, it's occurred

sacred grail
sacred grail
#

wasted like 2 hours being confused because i accidentally wrote a condition in inverse

#

xd

sacred grail
#

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

summer lotus
sacred grail
#

idk i didnt look at the later parts yet

summer lotus
#

(its easier)

sacred grail
#

is hid significantly harder

restive bison
#

Hid is just parsing a structure that tells you how to parse packets

sacred grail
#

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

summer lotus
#

at least if you can use it in your firmware settings

runic cloud
#

Boot protocol is lame

sacred grail
#

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

young copper
runic cloud
#

Yeah

sacred grail
#

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

young copper
#

you're probably not configuring the endpoint correctly

sacred grail
young copper
#

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)

sacred grail
#

i calculated the endpoint context pointer incorrectly πŸ’€

#

its always the stupidest shit...

#

lets see if passing through the real xhci will actually work or it will crash the whole system again

runic cloud
#

x to doubt

sacred grail
#

dang it

runic cloud
#

btw how do u pass it through without disabling your keyboard etc

restive bison
#

inb4 uses ps/2 keyboard

sacred grail
runic cloud
#

lol

#

fair

#

but yeah xhci on real hw can be finicky

#

so i didnt expect any% driver to work right away

sacred grail
runic cloud
#

wait why

sacred grail
#

i have no idea

runic cloud
#

how did u even come to the conclusion of "if one address command fails lets send two and see what happens"

sacred grail
#

uhh its what i saw somewhere idk

runic cloud
sacred grail
#

its not about it failing

young copper
#

why are you setting the bsr bit

runic cloud
sacred grail
#

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

runic cloud
#

what is the questionable book?

young copper
#

yeah you should stop reading that

sacred grail
#

the fysos one

young copper
#

and follow actual good code

runic cloud
#

☠️

#

theres a good usb book by ben

young copper
#

just dont set the bsr bit

#

i have never seen anyone have to set it

#

so you don't have to either

runic cloud
#

wait

#

is this the one ur reading?

#

this one is pretty good

sacred grail
#

it had some straight up wrong information that i noticed

runic cloud
#

like what?

sacred grail
#

uhhhhhhhhhhh

#

like the set address command not mentioning a slot id

#

i forgot the other thing

young copper
#

that's what the spec is for, i believe

#

☠️

runic cloud
#

yeah the book is not really spec replacement

sacred grail
runic cloud
#

if thats wrong this guy is on the osdev forums and he always replies to questions and takes feedback

young copper
#

i think that's for like low speed devices

sacred grail
#

the spec also mentions this

sacred grail
#

"for some legacy usb devices"

young copper
#

yeah

#

i was about to point that out

runic cloud
#

is this from like the devices expecting old nt behavior?

sacred grail
runic cloud
#

u should let him know

young copper
#

lol funny

sacred grail
#

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

sacred grail
#

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

sacred grail
#

well shit seems like the issue wasnt either of those

runic cloud
#

try bochs

#

its designed to catch driver bugs

sacred grail
#

ok

sacred grail
#

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 KEKW

runic cloud
#

acpi is only needed if you use the apic

sacred grail
#

i use the apic

runic cloud
#

you probably use it in virtual wire mode so the pic is still connected

sacred grail
#

ok i said it wrong

#

i meant i registered an io apic interrupt

runic cloud
#

hm ok that shouldnt've worked

#

maybe it just so happens that the pci interrupt number matches the input

#

aka just luck

sacred grail
#

lol

wraith forge
#

the name reminds me of this

sacred grail
#

le fishe au chocolat my beloved

runic cloud
#

is that the fishix logo

sacred grail
#
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

runic cloud
#

is this bochs logs?

sacred grail
#

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?

runic cloud
#

oh cool

#

see bochs is pretty useful

sacred grail
#

yea lol

sacred grail
#

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

runic cloud
sacred grail
#

because i added back the address device shenanigans

runic cloud
#

what does this assert even check

sacred grail
#

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

summer lotus
sacred grail
runic cloud
sacred grail
#

holy shit

#

the configure endpoint command finally succeeded for once

#

but then the set idle command failed

#

ill try just not sending that

sacred grail
#

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

sacred grail
sacred grail
#

i am not going to bother figuring out all the mess rn

#

i just wanna write the evdev interface for it immediately

runic cloud
#

congrats

#

bochs is the goat

sacred grail
#

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

sacred grail
#

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

sacred grail
#

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

summer lotus
sacred grail
#

im guessing the usb request fails and then it does the stall thing which im not sure how to handle

sacred grail
#

and the language string descriptor

#

afk

sacred grail
#

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

sacred grail
#

it uses 16-bit fields for x and y instead of 8 bit

runic cloud
#

Its not that difficult

sacred grail
#

yea but im a lazy coward

#

also i just realised why the qemu mouse is working badly im a dumbass

sacred grail
#

i was doing weird shit with the x and y fields when i was supposed to just pass them as an int8_t

runic cloud
#

Oh

sacred grail
#

implemented basic hid format parsing

#

well i havent actually made it parse the received data

#

ill do that now

sacred grail
#

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

sacred grail
#

exposing usb hid keyboard with evdev is so much damn harder than the mouse lol

normal sorrel
#

why is that?

sacred grail
#

evdev keyboard is very similar to ps2 keyboard

wraith forge
#

Is it like keys pressed at once

sacred grail
#

yea usb keyboard gives you 6 keys that are currently pressed

#

evdev gives events for keys that are being pressed, repeated and released

young copper
#

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

sacred grail
#

its like that for the mouse

#

but the keyboard requires keeping track of which keys changed

young copper
#

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

sacred grail
young copper
#

interesting

#

let me check the usb hid spec

#

are you sending a Set_Protocol request?

sacred grail
#

heres the full log for my real keyboard

#

the 2. report seems to be for extra keys that im not using

#
  1. 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

young copper
#

i see

sacred grail
#

(apparently my code doesnt skip it properly πŸ’€ )

young copper
#

sorry if i said anything confusing, im too tired for this stuff

sacred grail
#

nah you didnt

young copper
#

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

sacred grail
#

yea i do have that

sacred grail
#

i got usb keyboard working on real hardware

#

and pushed the code to github

runic cloud
#

damn

sacred grail
#

the driver is still quite unfinished but it works well enough

runic cloud
#

baremetal or passthrough only?

sacred grail
#

baremetal

runic cloud
#

so u can use kde properly now

sacred grail
#

i got a photo for potentially posting on r/osdev

runic cloud
#

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

sacred grail
#

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)

stuck hemlock
#

damn that's pretty damn cool

runic cloud
#

yeah this guy is crazy

#

dw ill catch up in 10 years trl

restive bison
runic cloud
#

Naaah I have maybe 5k loc tops

sacred grail
#

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

sacred grail
#

hmmm what should i work on next

#

so many things to do

#

i wanna see if i can do SMP speedrun

runic cloud
#

Yeah do smp

#

Where osdev reddit post?

sacred grail
#

oh right

#

πŸ’€

#

uhh ill make it in a bit

sacred grail
# sacred grail i wanna see if i can do SMP speedrun
  1. implement mutex (its basically an atomic and an event object glued together right?)
  2. put mutex in syscall wrapper
  3. add multiple queues to scheduler
  4. make the important scheduler functions thread safe
  5. make the other cpus start running those queues
#

did i miss anything

runic cloud
#

Well allocators and stuff

#

Logging

sacred grail
#

completely untested though

runic cloud
#

i mean on a up system a spinlock can just be cli()

sacred grail
#

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

runic cloud
#

do your syscalls never block?

sacred grail
runic cloud
#

i mean i get that its kind of meant to be a speedrun etc

sacred grail
#

things wouldnt be working so well if i didnt block lol

runic cloud
#

but its a bad idea

#

like really bad

sacred grail
#

why is it a bad idea though

stuck hemlock
#

non-preemptible kernel in general is bad design

#

unless you're doing special stuff

runic cloud
#

because you allow your userspace to steal a shit ton of cpu time by issuing heavy syscalls

sacred grail
#

i do still try to add proper interrupt locks to my code btw but i just keep them disabled out of paranoia

runic cloud
#

especially if you dont have smp

sacred grail
#

actually nvm its probably part of why the rest of the system becomes almost unusable while minecraft is running

runic cloud
#

yeah thats probably why

sacred grail
#

but i also have a super basic round robin scheduler

runic cloud
#

nah a basic round robin should be good enough

#

its just that you dont guarantee any time slices

sacred grail
#

ok wait ill remove the interrupt disable

#

and see if it improves

stuck hemlock
#

man why do I even bother minimizing interrupt latency and preemption disabling when I could run kde 😭

sacred grail
#

real

stuck hemlock
#

well yeah I plan to

#

but linux compat would work as a subsystem of my kernel

runic cloud
#

nice

restive bison
#

Theres a diff between compat and speedrun smh

runic cloud
#

yeah fair

stuck hemlock
#

so the idea is to keep that stuff separate

#

like *bsd linuxulators

runic cloud
#

i mean i think freebsd design is relatively clean here

#

yeah

stuck hemlock
#

freebsd even emulates the linux modules API

restive bison
#

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

runic cloud
#

thats a decent route

restive bison
summer lotus
#

weird route

stuck hemlock
#

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

runic cloud
#

why? wine is quite fast

restive bison
#

Detect something is a pe -> launch wine pointing to it a la shebang

stuck hemlock
#

you can probably patch the shell to do that

#

instead of handling it in the kernel

restive bison
#

That implies looking at bash code. I do not want to look at bash code.

young copper
#

linux already has support for that

#

it's called binfmt

runic cloud
#

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

sacred grail
#

the rest of the system still becomes super laggy when mc is running

#

are you sure round robin is actually good enough

runic cloud
#

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

sacred grail
#

doesnt basic round robin basically mean that when a thread is constantly running everything else in the system becomes 2x slower

runic cloud
#

the cpu time is split between N runnable threads equally

sacred grail
#

yea

#

thats exactly the problem

runic cloud
#

u could try implementing a ule or something

#

or just add damn smp KEKW

sacred grail
#

idk what ule is lol

#

i know very little about schedulers

runic cloud
#

the freebsd scheduler

#

its very well documented

sacred grail
#

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

sacred grail
#

wtf

#

i posted on r/osdev and it was instantly removed

#

?

#

is it cause im on a new account with 0 karma

normal sorrel
#

probably

sacred grail
#

rahh

normal sorrel
#

get a 500 day streak or something first

sacred grail
#

πŸ’€

normal sorrel
#

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

sacred grail
#

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.

stuck hemlock
#

Those kind of policies are stupid

#

Forces you to go karma farm

normal sorrel
#

or upvote 5 things

sacred grail
normal sorrel
#

I think so

#

no

stuck hemlock
#

Then you could just make a bot that upvotes stuff

restive bison
#

Just comment some random stuff and ask everyone gere to upvote

#

Comment 67 on some r/osdev post ez

normal sorrel
#

doesn't a comment = 1 karma

sacred grail
restive bison
#

Shouldhave been 67, not upvoting

sacred grail
#

πŸ₯€

stuck hemlock
sacred grail
#

thank

runic cloud
normal sorrel
summer lotus
sacred grail
sacred grail
#

hi chat im back

#

i can finally make the stupid post now

restive bison
#

Updooted kind stranger

#

May reddit gold be with you

sacred grail
#

yay yippee woohoo

#

ok i should start the smp speedrun

#

i lowkey forgot about this

#

xd

warm osprey
scarlet stone
abstract kestrel
sacred grail
#

ugh its been ages since i wrote my APIC code

#

time to read it to figure out how it works again KEKW

sacred grail
#

ok i now have all the cpus running threads

#

debugging 1 million race conditions time yayyy

sacred grail
#

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

restive bison
sacred grail
#

oh right

edgy mesa
sacred grail
edgy mesa
sacred grail
#

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

edgy mesa
#

Fair enough

restive bison
#

You back your io polling system with events. I back my events using my io polling system. We are not the same

sacred grail
#

real

sacred grail
#

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

sacred grail
#

ok bash no longer explodes

#

apparently i forgot to make the current pagemap a cpu-local KEKW

sacred grail
#

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

bitter arrow
wraith forge
#

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)

warm osprey
summer lotus
wraith forge
#

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

warm osprey
#

well i have bash running 2 minutes ago and i dont have smp lol

sacred grail
#

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

summer lotus
sacred grail
#

but i probably wont do that troll2

wraith forge
#

you can ask me (almost) anything else about SMP if you want

sacred grail
#

ok thanks

sacred grail
#

while trying to make the scheduler work in smp i instead managed to break it in non-smp

warm osprey
#

umm should i be starting to work on smp rn

#

so that i dont end up like you :((

edgy mesa
#

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

wraith forge
warm osprey
#

true

#

currently i usually just run 1 process/thread at a time

summer lotus
warm osprey
#

(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

wraith forge
wraith forge
summer lotus
wraith forge
#

that's why the word "unless" exists

#

yes, unless you want to suffer with races in the future

sacred grail
#

smh its not THAT bad

#

im just having a catastrophic skill issue rn

sacred grail
#

ok i finally stopped procrastinating and actually split the code in sched.cpp into 3 files

normal sorrel
#

I need to do the same tbh

runic cloud
#

hows your smp coming along

sacred grail
#

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

runic cloud
#

well git bisect will tel u

sacred grail
#

i didnt make any intermediary commits

runic cloud
#

☠️

#

one shot smp support

normal sorrel
#

lol

sacred grail
#

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??!?!?!?!?!

summer lotus
warm osprey
sacred grail
#

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

bitter arrow
#

lol it happens sometimes

sacred grail
#

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

summer lotus
#

😭 😭 😭

chilly kettle
#

Wait a minute… it’s like Unix… but Fish?

velvet quest
#

what do you have ported so far?

normal sorrel
#

it's Linux compat

velvet quest
#

I see

warm osprey
#

hows the kernel now?

sacred grail
sacred grail
velvet quest
#

oh cool

#

if you get tcp support let me know

sacred grail
#

(its probably just a tiny mistake in some random code that doesnt require a full rewrite)

velvet quest
#

projects die in rewrites

sacred grail
#

true

restive bison
#

Just one more rewrite bro

abstract kestrel
#

rewrite in rust

restive bison
#

Just one more rewrite and all bugs will be fixed

#

Just one more

normal sorrel
flat ravine
#

Honestly a rewrite wouldn’t be bad

#

Especially if adding SMP is killing ya

warm osprey
#

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

flat ravine
#

@claude fix the bug make no mistakes

warm osprey
#

true

sacred grail
wraith forge
#

like right at the beginning was the best time

warm osprey
#

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

wraith forge
#

SMP is multithreaded