#Zinnia

1 messages · Page 28 of 1

brisk totem
#

i guess handle table or something like that would maybe need it?

storm bobcat
#

A large slab is any slab with objects over 512 bytes

brisk totem
storm bobcat
#

and the slab size is calculated to minimize fragmentation

brisk totem
#

also 512 feels weirdly low

storm bobcat
#

It's 1/8th of a page

brisk totem
#

yeah and you map in units of a lot more than 1 page usually

storm bobcat
#

hm?

#

Actually I guess the Solaris way would be to resize the hashmap using vmem or something

magic charm
#

You may say this of unix domain sockets specifically but how about TCP or UDP? With a ring buffer you'd be compelled to introduce an extra copy

#

While the natural solution with mblks or mbufs is to adjusy the data pointer of the block past the headers and pass it up to receive queue

brisk totem
#

hmm

#

well no i dont think so

#

you could create a mildly cursed ringbuffer structure which can hand off objects directly on the fast path

#

and then do some kind of vectored receive on the other side, idk

storm bobcat
#

oh fadanoid I was meaning to ask, how do you avoid making kernel heap frees expensive? Because my physical pages are not contiguous so what I would do on free is free the virtual pages and flush the TLB, but flushing the TLB on every free sounds bad. Can a batching mechanism be used for kernel as well?

brisk totem
magic charm
storm bobcat
#

Yeah I thought about that too

brisk totem
#

and obviously you can also just not free as much

#

and free in larger batches

#

(e.g. im planning to use 64k blocks for my slab allocator, so that already means 1/16th of TLB shootdowns)

magic charm
#

Do an RCU like thing. The VA space is freed only after each CPU has passed some point where it processes queued kernel VA space invalidation

storm bobcat
#

I had this exact idea

brisk totem
storm bobcat
#

I can do some kind of safe memory reclamation trick

storm bobcat
magic charm
#

The technique is described in the mach "tlb shootdown" paper

#

It was one of the inspirations for RCU originally

brisk totem
#

yes but im using 4k pages

storm bobcat
#

Don't you still need TLB flushes for every individual 4k page

brisk totem
#

well no you can do a bulk tlb flush

#

also on arm you have broadcast tlb invalidations (but i dont want to rely on that obv)

neon flicker
#

this does not apply to naming conventions btw trl

near tartan
#

i have the best naming

near tartan
#

@somber solar trl

somber solar
#

nice

near tartan
#

it was getres{u,g}id

#

now to figure out what trips up ppoll

near tartan
#

@somber solar ok it's not ppoll

#

it's the tty handling

#

bash thinks my tty is not canonical??

somber solar
#

interesting

near tartan
#

is it supposed to be canonical?

somber solar
#

yes

#

I think

near tartan
#

i set c_lflag with ICANON

somber solar
#

can you show your syscall log

near tartan
#

what are you looking for? termios?

#

i only log names rn

somber solar
#

arguments and return values would be useful

near tartan
#

wanna join vc?

somber solar
#

sure

near tartan
#

new screenshot dropped

median forge
near tartan
#

why ?

median forge
near tartan
#

lol

#

missing logo for fastfetch

median forge
#

make it new zinnia logo

near tartan
#

idk how to make pixel art

somber solar
near tartan
#

it looked ass when i tried lol

median forge
#

i dont remember

marsh holly
somber solar
near tartan
#

holy

#

peak

near tartan
somber solar
near tartan
#

uhh

#

hm

#

can you change it into a fastfetch format

somber solar
#

what's that

near tartan
#

two plain colors started with $1 and $2

#

e.g.:

           $2.;ldkO0000Okdl;.
       .;d00xl:^''''''^:ok00d;.
     .d00l'                'o00d.
   .d0Kd'$1  Okxol:;,.          $2:O0d
  .OK$1KKK0kOKKKKKKKKKKOxo:,      $2lKO.
 ,0K$1KKKKKKKKKKKKKKK0P^$2,,,$1^dx:$2    ;00,
.OK$1KKKKKKKKKKKKKKKk'$2.oOPPb.$1'0k.$2   cKO.
:KK$1KKKKKKKKKKKKKKK: $2kKx..dd $1lKd$2   'OK:
dKK$1KKKKKKKKKOx0KKKd $2^0KKKO' $1kKKc$2   dKd
dKK$1KKKKKKKKKK;.;oOKx,..$2^$1..;kKKK0.$2  dKd
:KK$1KKKKKKKKKK0o;...^cdxxOK0O/^^'  $2.0K:
 kKK$1KKKKKKKKKKKKK0x;,,......,;od  $2lKk
 '0K$1KKKKKKKKKKKKKKKKKKKK00KKOo^  $2c00'
  'kK$1KKOxddxkOO00000Okxoc;''   $2.dKk'
    l0Ko.                    .c00l'
     'l0Kk:.              .;xK0l'
        'lkK0xl:;,,,,;:ldO0kl'
            '^:ldxkkkkxdl:^'
#

would be huge

somber solar
near tartan
#

yeah but that's not the intended way

#

that just prints the ansi sequences

#

let me try putting it in the sysroot

grave peak
#

damn

near tartan
median forge
hoary cave
# near tartan

why is there so much empty space between the right side of the logo and the stats

near tartan
#

big logo

hoary cave
#

fx it

#

fix it

median forge
somber solar
#

I couldn't get it to be pretty in the fastfetch format

near tartan
#

doesn't have to be

#

as long as it's not a "?"

somber solar
#

I could edit it manually

near tartan
#

yeah it needs like 3-4 cleaned pixels

#

but otherwise doesn't even look that bad

#

or you could remove the bg entirely

#

just one color

somber solar
near tartan
#

hell yeah

#

based

somber solar
near tartan
#

a

marsh holly
#

a

hollow hedge
#

a

grave peak
#

a

median forge
#

a

neon flicker
#

a

idle flower
#

a

cyan nexus
#

a

dusk pawn
#

a

near tartan
#

hm

#

xorg seems to be trying to do modeset

#

but fails horribly because of the screen res KEKW

near tartan
#

that's better

near tartan
#

this isn't as cool as i'd want it to be because it's just using fbdev, not drm

#

it does a modeset, but it stays blank

near tartan
#

xeyes with virtio_gpu DRM

#

don't ask me why the eyes are blue lol

#

but letsgo

shy turret
#

nah but based as fuck

near tartan
storm bobcat
#

Is that 3d accel?

near tartan
#

no but modeset

storm bobcat
#

3d accel when

near tartan
#

once i have xfce running

storm bobcat
#

It can't be that hard

near tartan
#

grave peak
#

so it is indeed hard

storm bobcat
#

Isn't virtio gpu supposed to be simple

#

Well

#

Simpler

near tartan
#

still pretty hard

grave peak
#

no the 3d format is literal mesa ir

near tartan
#

okay with plainfb drm, the eyes are black

#

probably ARGB vs BGRA

#

inb4 i messed up the buffer setup and mixed the formats

shy turret
near tartan
#

this was fucking stupid

#

there we go

grave peak
near tartan
#

yesn't

#

it has constants

#

but they're just common ones

fair lintel
#

it's just super frustrating to work with really

#

these days, it's probably nicer to use the venus vulkan thingy instead

#

at least that uses the official serialized vulkan command stuff

#

I think, with retrospect, my problem was either messing up to set up some descriptors (possibly for DMA), some fencing meme or forgetting to signal something

grave peak
grave peak
near tartan
fair lintel
#

basically it serializes the opengl/vulkan state, DMAs it over to the host, which then deserializes + executes that

#

it

#

's just a lot saner to go the vulkan route these days

grave peak
#

yeah but what device does that require in qemu

fair lintel
#

virtio-gpu

#

might need some options, I don't remember

grave peak
#

Doesn't virtio GPU rely on mesa ir

fair lintel
#

with the vulkan stuff no

grave peak
#

Hm

fair lintel
#

bc it uses the official serialization of it, I think it even works with nvidia-open

brisk totem
#

is it literally just vulkan? surely not

fair lintel
#

it is

brisk totem
#

i mean you cant trust the host vulkan driver to work properly

fair lintel
#

you can't trust, but iirc people have had this thing running and amgpu and nvo

brisk totem
#

amdgpu segfaults if you tell it to use a random entrypoint you dont have in spirv

#

this will even pass spirv-val btw

fair lintel
#

sure but does it matter if it works meme

brisk totem
fair lintel
#

???

grave peak
fair lintel
#

my point is that venus works with multiple drivers

grave peak
#

and shaders

brisk totem
#

and you cant make this work reliably at that level because the drivers are too broken either

grave peak
#

??

#

vm vulkan -> host vulkan -> host amdgpu driver

brisk totem
#

there is no way to know if a given set of maliciously constructed (but valid) vulkan commands is safe

fair lintel
brisk totem
#

gpu drivers are not considered attack surface afaiu

grave peak
#

u submit amdgpu commands

fair lintel
brisk totem
fair lintel
#

virglrenderer or whatever

#

idk what to say, ok bro, don't use it then?

brisk totem
#

i mean sure like thats cool

grave peak
brisk totem
#

i love broken devices 🙃

brisk totem
#

yeah maybe its fine

fair lintel
#

to paraphrase a bit of medical wisdom, "there are no correct drivers, only underdiagnosed ones"

grave peak
#

but its untrusted either way even if its produced by host userspace

brisk totem
fair lintel
#

anyway, if somebody wants to tackle this some day, I'd be happy to help out with a bit of guidance if desired

grave peak
brisk totem
#

yea

#

if you can get it to segfault by accident...

grave peak
#

i suppose

#

but that would be a bug in the driver anyway

#

like either in userspace mesa or host

#

(kernel space)

#

like its not intended that u can make amdgpu segfault from userspace by providing invalid input from userspace

fair lintel
#

wherever the batchbuffer comes from, the driver has to validate it anyway

#

from the driver's perspective, I don't think you can really tell the virtio-gpu Venus case apart from just mesa

#

and the fact that the userspace side then has to validate input is ... obv?

grave peak
#

i still think it would be cool to get that working in managarm so u can brag about some 3d accel

fair lintel
#

sure but I don't think I will have the time to do that in the next few months ngl

grave peak
near tartan
#

anyways

grave peak
#

maybe marvin is going to beat u to it

fair lintel
#

I'm happy to help make that happen

near tartan
#

nah

#

i have doubts in myself

#

the goal i've set for myself with zinnia is to get to xfce4, as that's my fav DE

grave peak
#

on paper it just takes correctly piping userspace buffer into the gpu

fair lintel
#

in theory it's just setting up DMA stuff + handle fences + yeet commands

grave peak
#

fences are probably the only like harder thing

fair lintel
#

I'm not sure what the guest driver side has to do for that even, but even if you have to do a lot of legwork, it's just semaphore + reporting events via a syncobj fd

grave peak
#

iirc userspace just puts a fence command into the buffer which generates an irq when reached or something?

fair lintel
#

might be, but you also have to await all the input data to be available

#

dunno how that works with venus

grave peak
#

yeah idk

fair lintel
#

on nvidia, you'd just emit a few GPU instructions to do a wait on the semaphore

#

same for signalling fences, just insert some instructions to advance a timeline semaphore

marble salmon
#

i doubt that the problem in the past as a fencing issue

#

it's much more likely that some ABI was broken

marble salmon
#

between host mesa and guest mesa

fair lintel
#

I did 4 or 5 passes checking all data structures, so I was pretty certain of their correctness

grave peak
fair lintel
#

for fences, I just set a bit to make it run in sync and hoped for the best

marble salmon
#

in the serialized IR

#

due to mlibc differences etc

fair lintel
#

FUCK I KNOW WHY

#

FUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCKFUCK

grave peak
#

what lol

fair lintel
#

printf LMFAO

grave peak
#

there was a printf bug in mlibc?

fair lintel
#

it 10000% miscompiled shaders

grave peak
#

lol

marble salmon
#

but then it should have miscompiled them on Managarm as well

near tartan
#

rofl

fair lintel
#

that was when I implemented all the float formatting in frigg

grave peak
#

this is on managarm no?

marble salmon
#

shaders on Managarm without virtio-gpu work just fine (even back then)

fair lintel
#

(depending on the codepaths taken)

grave peak
#

u mean llvmpipe shaders?

marble salmon
#

yes

storm bobcat
grave peak
#

yeah it could be different codepaths

marble salmon
#

but it doesn't matter if it's llvmpipe or not since it goes through the same IR

grave peak
storm bobcat
#

(my kernel is a nothingburger)

near tartan
fair lintel
#

I am actually fairly certain that printf + fences would solve virtio-gpu

#

I AM SO FUCKING DUMB

storm bobcat
#

Ok maybe not that much

marble salmon
#

ah actually it probably doesn't serialize on the non-virtio code path

storm bobcat
#

I wrote like 10k in 3

fair lintel
#

yeah about that, scanf bugs also bite there

grave peak
#

maybe just the printf fixes fixed it

fair lintel
#

no I don't have the branch any more, and rebasing that also wouldn't be all that feasible

grave peak
#

fair

fair lintel
#

it would be easier to just rewrite from the spec again, esp with vulkan in mind

grave peak
#

u nuked the driver code also?

fair lintel
#

(just enable zink afterwards)

marsh holly
#

get claude to do a quick and dirty test

marble salmon
#

fwiw claude is quite good at rebasing branches meme

fair lintel
#

jesus christ

grave peak
#

lol

near tartan
storm bobcat
#

it's not really

#

But it doesn't do much

#

Glorified scheduler

grave peak
#

any kernel without a userspace is a nothing burger meme

storm bobcat
#

yes

#

I'm not even thinking about getting close to userpace atm

#

I have so much stuff to do first

#

see the todo list meme

grave peak
#

did u start the tty

storm bobcat
#

it's pinned in the thread

storm bobcat
grave peak
#

ngl thats the most useful todo list

storm bobcat
#

Well yeah I'm still not on par with my c code

#

Because no timer stuff and smp yet

grave peak
#

so what are u working on atm

storm bobcat
#

finishing the allocators so I can start smp

#

I'm overengineering the allocator and I don't have infinite time so it's not pushed yet

#

But it's like 95% done I'd say

grave peak
#

llfree?

storm bobcat
#

No the pmm is already done

#

I'm referring to the slab allocator and vmem

grave peak
#

oh ok

storm bobcat
#

i could probably push it already but I wanna clean it up a bit

near tartan
#

wtf is this

#

xeyes -biblicallyAccurate

nocturne rampart
near tartan
#

et tu brutus??

#

god damn this kernel is hella unstable

#

there's deadlocks everywhere

storm bobcat
near tartan
#

no

#

idfk what it's trying to open yet

storm bobcat
#

well

#

gcc has a bunch of subprocesses

#

it must spawn like 5 executables just to compile a C program

#

ok no maybe like 3

near tartan
#

ok but still why would it try to open a file in posix_spawnp

#

@marsh holly i got bored of openrc meme

#

i got dinit now

storm bobcat
#

bored or it didnt work meme?

near tartan
#

both

#

dinit was way easier to get running

#

and it doesn't use ugly scripts for services

vast lotus
near tartan
#

@nocturne rampart

nocturne rampart
near tartan
#

no

#

not yet bra

nocturne rampart
#

Twm?

near tartan
#

yes

nocturne rampart
#

Awesome

near tartan
near tartan
#

💀

#

i'm not linux

median forge
near tartan
#

wayland needs a lot of linux apis

median forge
#

isnt there is bsd port for it

near tartan
#

then i need to be bsd

marsh holly
near tartan
#

but yes

magic charm
#

these days wayland is runnable on bsd as well

near tartan
#

yeah but only if you're an actual bsd

#

(libudev-devd)

magic charm
#

netbsd and i think even openbsd can run it now

near tartan
#

so my options are

#
  • pretend to be linux
  • pretend to be a bsd
  • write my own shitfucked version of libudev and a device manager
median forge
near tartan
#

yes

near tartan
#

no

magic charm
#

there was an experimental libudev implementation for netbsd but i don't think it's needed for most comprositors

near tartan
#

it's needed for everything

magic charm
#

possibly the path of least resistance is a libudev implementation

near tartan
#

i'M already working on one

marble salmon
#

you can probably patch udev out of compositors rather easily

near tartan
#

but it's very hacky atm

magic charm
#

it shouldn't need to be very thorough

marble salmon
#

it's not feasible to remove it from libinput though. although the BSDs may have their own solution for that such that they may not need libinput anyway

storm bobcat
#

Why is Wayland so not portable again

hybrid island
near tartan
#

epoll + signalfd + timerfd + libudev for libinput which basically everything depends on

storm bobcat
#

Yes but why

hybrid island
#

because it's for linux

near tartan
#

and linux specific socket stuff iirc

magic charm
#

something i noticed, most hobby oses are slightly annoying to use any GUI under qemu since they're using ps/2 mouse and it's got to be captured and generally it feels a bit off when moving it, so if you used virtio-tablet instead, you're onto a winner

brisk totem
near tartan
#

wayland does, not sure about libinput

#

but probably

brisk totem
#

wayland can at least be vaguely patched

near tartan
#

i guess

#

i mean if wayland was feasible to do, i'd provide epoll myself

#

and ofc i'd prefer it over x11

brisk totem
#

theoretically instead of reimplementing udev you can just patch libinput so that the "udev" backend is just the path backend that adds some hardcoded paths or whatever

near tartan
#

but it's just all linux only stuff

storm bobcat
#

Is Wayland the problem or wlroots

brisk totem
#

epoll <<< kqueue

near tartan
brisk totem
near tartan
brisk totem
#

and you need the c library for mesa (and accel more broadly) to work

#

so everyone uses it

near tartan
#

i have no idea what the diff between the two is so idgaf

#

i only vaguely know what epoll is used for

brisk totem
#

oh you mean between epoll and kqueue?

near tartan
#

yea

brisk totem
#

kqueue lets you do more shit

#

and its a bsd api and not a linux api so its also saner

marble salmon
#

even though specific implementations may

#

the wayland protocol does not depend on any linux-isms

near tartan
#

wayland = libwayland in this context

storm bobcat
#

Better Wayland impl when

cyan nexus
brisk totem
#

i have a pure rust impl which only incidentally depends on epoll (and my older impl didnt even require it iirc)

magic charm
#

kqueue can be implemented in terms of epoll+timerfd+signalfd+eventfd+inotifyfd very well, and the converse is also true

#

modulo oddities which are mostly undesired like continuing to receive epoll notifications after closing an fd

near tartan
#

i'm tempted to just implement the devd interface

brisk totem
#

just patch libinput so that "udev" really means "path backend with a bunch of hardcoded libinput_path_add_device calls"

near tartan
#

well

#

i still need some form of device manager

#

but implementing netlink is aids

brisk totem
#

until you get hotplug you can just hardcode the list of commands to execute into a file or something

near tartan
#

which is what X does meme

brisk totem
#

yes ofc

#

and its like fine

near tartan
#

dont get me wrong i would love to do wayland

#

but i also have a job meme

brisk totem
#

im pretty sure its not much harder

near tartan
#

i could vibe code the libudev thing and just make it use my own interface

#

that's a bit easier than patching libinput

brisk totem
#

how

near tartan
#

because there's probably multiple consumers of libudev

#

and there's a lot of places where libudev is used in libinput

#
marvin@aquaduct ~/r/libinput (main)> rg "udev_.*\(" | wc -l
406
storm bobcat
#

Could you technically write a more portable libwayland and make the compositors more portable

near tartan
#

that still doesn't address libinput

near tartan
#

libwayland is technically doable

brisk totem
#

there is complete lockin

storm bobcat
#

I know wlroots isnt

near tartan
#

look

brisk totem
#

you need agreement between mesa and libwayland

near tartan
#

look at the headers

brisk totem
#

yeah that works too probably

near tartan
#

there's not that many functions to implement

storm bobcat
#

Writing a shim between the Wayland interfaces and Linux stuff?

#

That could work

brisk totem
#

it would be easier to just port libwayland tbh

storm bobcat
#

I'd say you can avoid epoll and all that stuff and make that portable

near tartan
#

no

brisk totem
storm bobcat
#

But still rely on mesa

#

yea I know

near tartan
#

mesa is not a linuxism

brisk totem
#

but mesa needs to talk to libwayland so youd have to patch libwayland

#

and youd need to patch most things unless you are drop in at which point you are just reimplementing libwayland

storm bobcat
#

Or write your own

#

yes

#

I literally asked if it was possible to write a portable libwayland reimpl

#

And you said no because of mesa

brisk totem
#

oh sorry i mean you cant have both at once

storm bobcat
#

can't have what

brisk totem
#

both impls

storm bobcat
#

can't have two libwaylands?

brisk totem
#

ye

storm bobcat
#

That's not an issue

marble salmon
#

you can make a wayland stack that's based just on POSIX if you really want to

#

wayland is just yeeting messages over unix sockets + SCM_RIGHTS

#

and it can work with ordinary temp files for the buffers

brisk totem
#

and yeah you can its just not a good idea

#

memfd is a good api tho i dont have anything against it

#

epoll is kinda jank

near tartan
#

but when i (or anyone else probably) am talking about running wayland that implies porting existing apps

#

i've looked this deep into the rabbit hole, and if i were to go through with it i'd be better off just contributing to managarm

#

for my goals with zinnia X is more than enough

marble salmon
#

well yeah basically you have chose between: "be compatible with another OS" or "patch existing software", there's not really a way around that

near tartan
#

yeah

#

as i said before, once i can run and use a xfce desktop that's basically me done with this

#

it's just to learn the basics after all (and do the occasional meme like DRM)

storm bobcat
near tartan
#

because managarm

median forge
#

managarm monopoly

storm bobcat
near tartan
#

managarm is a much more complete project

#

that's actually worth to put time into

#

my entire kernel is just hacked together with shortcuts left and right

storm bobcat
#

How does that stop you from making your own project but good

near tartan
#

well the thing is

#

in osdev there's never a "you're done now" stage

#

but i want to move on at some point, i want to feel "done" with something

#

without a definitive goal it's just always "ah i still need to implement x"

#

for example i wanted to write a wayland wm at some point

storm bobcat
#

Yeah but you can always have some kind of long-standing goal without taking shortcuts

near tartan
#

i guess

#

doesn't feel very satisfying tbh

#

there are just things about osdev i don't like to do (none in particular, sometimes it's just cancer to model in your head) and having other people working on a project to help with that is an awesome feeling

#

i can just focus on the parts that i enjoy

#

at least xfce is my long term goal

#

i'll probably end up coming back to it from time to time, once i have it all working right

near tartan
median forge
near tartan
#

i already have xfce ported

#

it's just a matter of running it

near tartan
median forge
#

i had xfce ported too but it refused to run

#

(my kernel bug)

near tartan
#

either way

#

dinit is working fully now

near tartan
#

hello.c compiled on zinnia!

#

(direct gcc invocation didn't really work yet for some reason)

grave peak
#

bro doesnt know that puts already adds a new line

near tartan
#

shush

grave peak
hybrid island
#

go call fputs if you want to write \n smh

shy turret
#

Or printf

hybrid island
#

imagine doing printf when fputs would do smh

near tartan
#

wtf is gcc doing

#

why is it trying to run /usr/bin/cc1

storm bobcat
near tartan
#

/usr/bin/cc1 is not a thing

storm bobcat
#

it calls like 5 subprograms

near tartan
#

not even on my linux

brisk totem
near tartan
#

probably

#

idfk

brisk totem
#

maybe not

#

whats the specs file

#

run gcc -dumpspecs

near tartan
brisk totem
#

ok that wasnt very helpful tbh

near tartan
#

/tmp/cc000000.o: file not recognized: file format not recognized

#

????????

#

?????????????????????????????????????????????????????????

#

why is clang doing execve("", ...)

near tartan
#

clanger

grave peak
near tartan
#

my kernel sucks? no your program needs to be more resilient

somber solar
shy turret
#

Bash ran without a real VFS clang should be able to survive without execve

zealous salmon
#

bash is meant to run on everything

#

including your mom

#

so that's not surprising

#

including OSes without VFS

#

like Version 7 UNIX and DOS

shy turret
#

fair 💀

#

I am mostly joking regardless

near tartan
somber solar
#

John Zinnia - pictured above - created Zinnia in 1984

somber solar
near tartan
#

cc1

#

that worked for some reason

#

and then assembling/linking by hand trl

somber solar
near tartan
#

i hard linked the cc1 to /usr/bin/cc1

somber solar
#

ah

near tartan
#

cc1 is somewhere in libexec

#

idfk why it wants to run it from /bin

somber solar
#

maybe some option in gcc source

near tartan
#

the next two drivers I'd like to add are ps2 (via evdev) and virtio net

fossil yoke
shy turret
#

Do an i210 too

#

I have some physical machines with that card

marble salmon
brisk totem
#

("Run cc1 in-process")

near tartan
#

is that a runtime flag

brisk totem
#

its a clang flag

#

and yes

near tartan
#

i wonder why gcc thinks /usr/bin/cc1 is the right location

marsh holly
#

What syscalls does it do involving cc1?

near tartan
#

it tries to do a brk for some reason

#

let me look at my config script again

marsh holly
#

I dont think thats the issue

near tartan
#

i can check all the syscalls later

marsh holly
#

Maybe you are spuriously returning success on some syscall like access(/usr/bin/cc1, F_OK) or stat or whatever

near tartan
#

hm

#

what's an easy program to test udp with

eternal wharf
#

dig maybe?

near tartan
#

hm

#

netcat maybe?

eternal wharf
#

can nc do udp? i know socat cat

near tartan
#

nc -u

median forge
near tartan
#

it's right in the pic bro

marsh holly
#

Or believe it or not, dhcp client meme

hoary cave
#

why is this mf tryna do udp

near tartan
#

bc easy

hoary cave
#

how about u make xorg work first

median forge
near tartan
#

it works
?

marsh holly
#

Zinnia vs fishix competing on the osdev speedrun

hoary cave
#

go implement evdev

near tartan
#

yeah

hoary cave
#

and ps2

near tartan
#

when xhci

hoary cave
#

chop chop

near tartan
#

i get off work in 2h

hoary cave
near tartan
#

i fixed it

hoary cave
#

really?

#

nice

near tartan
#

just need to push

hoary cave
#

bruh

near tartan
#

also X doesn't crash anymore

marsh holly
#

Glxgears when

near tartan
#

good shout

marble salmon
near tartan
#

i mean python already works

#

hm

marble salmon
#

If you have it already, it's probably not a bad option to just write a 5 line script

near tartan
#

one thing i don't know how to do solve yet is the network stack

#

sure i could write my own

#

stuff like routing, dhcp and the sort

hoary cave
#

don't do dhcp in the kernel pls

#

that's cringe

marble salmon
#

yeah just hardcode an ip in the kernel instead

near tartan
#

💀

near tartan
magic charm
near tartan
#

my logic has been

does it work?

  • no: kernel is broken
  • yes: must be correct then
near tartan
near tartan
#

ig what i mean is not the kernel side

#

but interacting with the user

#

like configuring routes and dhcp

somber solar
#

it has dhcp

#

I haven't read much else about it

near tartan
#

no but this seems like something akin to uacpi

magic charm
near tartan
#

but that does netlink meme

brisk totem
magic charm
near tartan
#

oh

#

didn't know that

magic charm
#

Or solaris's interface

#

In principle it probably wouldn't be too hard to add your own if you wanted a NIH interface. But either a routing socket or netlink are reasonable I think

marsh holly
#

Theres a route add ioctl as well

near tartan
#

where is that from?

marsh holly
#

I dont have netlink or similar on astral

marsh holly
#

Im not sure if they wte linux only or are in other systems

magic charm
#

SIOCSIF{ADDR,NETMASK,FLAGS}/SIOCADDRT and family come from early BSD

#

4.4BSD introduced the routing socket as the new interface

near tartan
#

evtest on PS/2 keyboard with evdev interface :D

grave peak
#

amazing

near tartan
#

i think sockets are still a bit fucky

#

i also have no idea of knowing if xorg recognizes evdev inputs

near tartan
#

i finally get to do the meme now

median forge
nocturne rampart
nocturne rampart
near tartan
#

i meant more configuring routes and stuff

nocturne rampart
#

Oh alright

near tartan
#

idk i haven't looked into it at all, i just assume I'll have to implement something

near tartan
near tartan
#

i guess i'm doing wayland again

#

fuck it

#

we ball

#

i implemented epoll using some epoll example i found online

#

this is the code

grave peak
#

Lol

#

That was enough for you?

near tartan
#

wdym

grave peak
#

Its a pretty complex one

#

Congrats

near tartan
#

my impl is probably wrong

#

but who care

grave peak
#

If KDE works it works

near tartan
#

i also have this

grave peak
near tartan
#

(using my libudev shim)

grave peak
#

I keep forgetting

#

You're doing your own syscall layer right

near tartan
#

yes

grave peak
#

But you added epoll

near tartan
#

i don't even have mlibc's linux option on

#

yeah

#

it's also present in other kernels

grave peak
#

Oh ok

near tartan
#

and kqueue + epoll shim is on bsd

#

but yes i will also implement some of the stupid linux *fd syscalls

#

whatever you need for wayland

#

this is what libwayland wants

storm bobcat
#

memfd is nice

#

timerfd too

near tartan
#

signalfd not so much

#

and eventfd

storm bobcat
#

they have everythingfd

#

they finally realized capabilities are cool meme

near tartan
#

hm

#

i would've liked to port riverwm but it's written in zig

#

:/

#

unfortunate

#

urgh

#

that does not sound fun at all

#

I'd rather port rust

storm bobcat
near tartan
near tartan
#

fixed some ps2 weirdness that caused the input to go bonkers

#

so now i can actually click stuff

grave peak
#

Have you done any real hw tests yet

near tartan
#

not yet

#

iirc the nvme driver hangs because i don't actually wait for any commands to complete during setup

#

my laptop can do ps2 emulation so i might try that

near tartan
#

you're supposed to wait for a bit to let the controller reset

#

but i just go on with my day

grave peak
#

Lol

near tartan
#

in qemu this is fine because it's sync i think

#

at least it doesn't happen there

grave peak
#

QEMU doesn't emulate any delays

near tartan
#

ig i can try logging to fbcon

#

should work

near tartan
#

and i already see it using it

somber solar
#

systemd when

near tartan
#

never

#

i hate it

near tartan
# near tartan

i do need to figure out why weston doesn't like my socket

#

riveting

#

getting wayland on a posix (+ small extensions) system would be fucking cool

#

only requires a small amount of bullshit

#

at least it seems to not crash randomly

#

even after 4 hours of runtime

#

which is a new record

grave peak
#

U had it running for 4 hours?

near tartan
#

yeah at some point

#

forgot to exit qemu

#

and it was still pretty responsive

#

the most glaring issue in the entire kernel is that there's no unmap meme

#

so no tlb shootdowns happening

#

or anything for that matter

near tartan
#

then bed

grave peak
#

Bed test

near tartan
#

ok

#

e14 first

#

lol ofc hangs in nvme

grave peak
#

Why do you preallocate all GSIs?

near tartan
#

These aren't gsis

grave peak
#

Well all ioapic inputs

near tartan
#

does it matter?

grave peak
#

Well yeah you might run out of space quick if you set up msis for a few devices on top

near tartan
#

i have per cpu interrupts

#

oh the framework actually works!

grave peak
#

Ideally u want per cpu interrupts also tho

near tartan
#

gets further than managarm KEKW

grave peak
#

Lol

near tartan
#

oh fuck oh fuck

#

infy

#

read the error message

#

do you know what this fuckass kernel just did

#

or tried doing

grave peak
#

What

near tartan
#

ext2: bad magic

#

(i have a linux install on there with ext4)

somber solar
#

isn't that just read

#

shouldn't affect anything

near tartan
#

so safe to say nvme works KEKW

#

but that's food enough for me tbh

#

way better than before

#

let's try my pc

grave peak
#

Why does managarm die on it?

near tartan
#

they do eager pci enumeration and apparently writing to the GOP while writing the gpus bar makes it stall

grave peak
#

Hm

near tartan
#

but i only lazily evaluate pci device bar sizes

#

nvm it does actually boot

#

insane

#

now if only i had usb input

grave peak
#

Cool

somber solar
near tartan
#

i tried to use clanker to make a signalfd impl but it was horribly dogshit

#

ill just do it myself

near tartan
#

well nothing really needed it so far

storm bobcat
#

fishix level

near tartan
#

and tlb shootdowns are something I don't know how to solve correctly

storm bobcat
near tartan
#

i have an idt vector allocated for the shootdown ipi but it does nothing rn

near tartan
#

ugh this is going to be horrible with rust types i think

storm bobcat
#

it's pretty over engineered

#

you can just do synchronous tlb shootdowns

near tartan
#

slow tho

storm bobcat
#

if you batch them its not that bad

#

afaik there's no major kernel actually doing asychronous shootdowns

near tartan
#

i might tackle this today

#

can't be that hard after all

storm bobcat
#

yeah just have an atomic counter and spin until its == to ncpus

near tartan
#

today = same day after sleeping

storm bobcat
#

what what

#

just have an atomic counter that is incremented (or decremented) by every CPU and spin on it until its complete

near tartan
#

oh you mean while waiting for the shootdowns to complete

storm bobcat
#

yes

#

that is how you do it synchronously

near tartan
#

that makes an insane amount of sense

#

i wonder if i can encode physical memory allocations in rusts type system

#

i.e. PhysFrames that are deallocates on drop

#

it's impressive how many things in zinnia just work without me trying

#

months ago you would have random shit happening like getting fpu gpfs because the kernel stack was too small and overwrote fpu state

#

year of the zinnia desktop is upon us

#

(unless i rewrite again)

somber solar
#

in zig this time

near tartan
#

c

#

if I'm not writing rust I'm writing C

somber solar
#

I don't remember who

near tartan
#

nothing wrong with that

#

im still using rust language features

storm bobcat
near tartan
#

i.e. using traits instead of making vtable structs

storm bobcat
#

zinnia starts with z

somber solar
storm bobcat
#

z = zig

near tartan
#

rinnia

somber solar
#

cinnia

near tartan
#

based

#

one really nice thing about rust over c is its strict typing

#

you can hardly misuse a public api

#

maybe this says more about me being a shit c developer than a rust developer

somber solar
#

what c code I've seen from you looked clean

near tartan
#

weston progress

#

we can talk to seatd!

#

now i just have to stub my libudev to return the drm device

near tartan
#

more things happening

near tartan
#

almost

grave peak
#

Where do u get these resolutions?

near tartan
#

wdym

#

the resolutions are matched in the virtio_gpu driver

grave peak
#

No I mean

#

How do u come up with these lists

#

Its the same res with different hz

near tartan
#

they're static data from EDID

grave peak
#

Ah ok

near tartan
#

i have a DMT_TABLE

#

ripped from xf86 shit

grave peak
#

Does Weston start now?

near tartan
#

no

#

im still trying

grave peak
near tartan
#

it's trying to traw shit

grave peak
#

U enosys something looks like

near tartan
#

ftruncate trl

idle flower
#

Including using closure with the physical structs that then temporarily map their page to access them from virtual memory

near tartan
#

eh imo that's a bit useless

#

you can just do hhdm

idle flower
near tartan
#

huh

#

why does that matter

idle flower
#

besides, my kernel doesnt really need to poke usermemory directly

near tartan
#

same

#

i have virtual memory objects

near tartan
#

WESTON ALARM

#

@sick flax @fair lintel

somber solar
#

based

#

year of the zinnia desktop

grave peak
#

Congrats tho

near tartan
#

weston-flower and weston-image with a random xfce image i found

#

my ptys are a bit broken so no terminal yet KEKW

#

we dont talk about the broken font

grave peak
#

why is it broken?

near tartan
#

font config i assume

marsh holly
near tartan
marsh holly
#

Hell yeah tho

near tartan
#

😭

marsh holly
near tartan
#

ofc

magic charm
sick flax
near tartan
#

soon tm

drowsy tendon
#

inshallah xfce will run soon also

near tartan
#

🙏

near tartan
#

WE HAVE A WESTON-TERMINAL

#

LFG

#

(still no input sadly)

grave peak
#

get KDE first, worry about input later trl

near tartan
#

@sick flax when you wake up

#

am i missing fonts here?

near tartan
drowsy tendon
#

i've been praying for times like these 🙏

somber solar
near tartan
#

@drowsy tendon is fixing that

somber solar
near tartan
somber solar
#

how does it overflow

near tartan
#

the calculation does

#

i dont do the division hack with the frequency that managarm does

#

fonts fixed

#

@hoary cave

somber solar
near tartan
#

no fonts installed

somber solar
#

lol

storm bobcat
#

congrats

near tartan
#

thx

storm bobcat
#

did you have to implemetn a bunch of linux stuff in the end or not

near tartan
#

yes

grave peak
near tartan
#

epoll, signalfd, timerfd

#

and i had to stub libudev

#

but i think this udev will be very useful

#

you can essentially hard code uevents

storm bobcat
#

epoll is the only thing in there that I dont like personally

#

idk what signalfd is

near tartan
#

you can poll on it and await a signal

#

idk what the point is

#

people online seem to be against it

grave peak
storm bobcat
#

ah that doesnt seem so bad

grave peak
#

its pretty good

near tartan
#

it's simple to impl really

#

it was about 100 lines

#

*130 + syscall plumbing

grave peak
#

yeah i mean its eventfd + glue to set it from a signal

grave peak
near tartan
#

yeah

grave peak
#

damn

#

do u fill it in properly?

near tartan
#

no

#

i just set ssi_signo and ssi_code

grave peak
#

fair

near tartan
#

i'm trying to get weston to boot with dinit so i can try booting on my laptop

grave peak
near tartan
#

yes

#

real hw being plainfbdrm

#

it also doesn't advertise modesetting

#

works with Weston regardless

grave peak
#

Cool

#

Did u test it?

near tartan
#

no i couldn't figure out how to get seatd running in dinit

grave peak
near tartan
#

there is a ready notify feature in dinit

#

but seatd fails for some reason

hoary cave
marsh holly
near tartan
#

say wallahi bro

grave raptor
#

correct

hybrid island
#

This message is a month old bruh 💀

near tartan
#

fixed some long standing problematic issues