#Zinnia
1 messages ยท Page 29 of 1
- munmap (smp to be fixed later)
- virtio_gpu ghosting (fixed by uploading the fb before setting scanout)
- a bunch of stupid pty issues
Nice
Nice
Nice
still no zinnia logo?
i couldn't make one (skill issue) but ilo had their own generator do one
i can dig it up and see how to add color to it
:3
#1344765673246822430 message

make sure to remove the trailing spaces at the end of the lines
adding colours shouldn't be hard
๐ญ
ts so peak
also idk why the color palette characters are fucked up on my end
hopefully it's just a simple issue in the config file but i cba checking now 
now to patch this in
๐ฅ
@somber solar
gcc!
yeah yeah
what
good good
Why is everyone suddenly getting GCC 
shrug
man every time i see your nickname i get sad that i didn't continue the microkernel
how does one make nano colourful like that
but this is the weston terminal, which defines TERM=xterm
I have xterm-256color defined
Cuz GCC isn't actually that syscall-demanding
Especially compared to the likes of Wayland
But Wayland requires a lot of Linux stuff
depends
libudev i have fixed now
you do need signalfd, eventfd, timerfd and epoll
but those are relatively easy to implement
suffering from success
my weston works but now X can't find any screens anymore
im crine
i think it's time to run os-test
it unfucked itself?
i added a basic rtc driver
so now it also shows the correct date
gnumake still doesn't work
rup
sickkk
rip
i have no clue what make's problem is honestly
it always says nothing to be done for 'all'
oh wait
maybe i should fix the EINVAL
๐
code for wayland has been merged
wayland init... ok
but i'll take a break from this for a while
i'm going to mess with my shitty microkernel design
just to feel something 
idk why but now that i have implemented all these features i'm getting really bored of rust
marvin try not to switch projects challenge (impossible)
Just rewrite it in C++ 
Zig time 
have you, like, taken a proper break from programming, ever?
considering i'm a full time SWE not really ๐ค
๐
give yourself a literal break man
because like this you'll end up burning out
+1 on taking a break
forgot to add renamed file destination?
fuck it we ball
lol
my score is higher than redox tho 
nvm
it's not really comparable
it didn't even get to run certain tests
as you can see basic only ran 234 tests
redox
isnt your kernel a modular kernel
yes
right now it is
but i have an older version that uses a completely different codebase
ohh
btw does being modular on compile time counts as modular
or do you need to load .o's at runtime
no
that's just being configurable
rip
i have modules as dylibs
i actually load full shared objects as drivers
for the microkernel I'll not use any AI at all to write the code itself
i have to admit i got a bit lazy with delegating debugging to the clanker
C++26
i dont even have a cross compiler that has support for that
jai
rewrite zinnia in c++
c++23 is also quite good
i think gcc 16 has some more c++26 support
i have 15.1
I'd need to update
"I'm using llvm 19 and it's fine"
i have llvm 21
I haven't bothered with rebasing because I haven't really had any issue with it
iirc mesa wanted it
i use both
Like I just use clang + lld for everything
I stopped using gcc becuase of a compiler bug with C++ templates
Rewrite in zig
naw
tfw jinx just nuked my kernel changes
microkernel is doing microkernel things
uacpi from userspace
no idea why it's so slow but w/e
the allocator is pretty bad
how is 2M slow โ ๏ธ
if u optimize it really well i guess
tru
but 2m is pretty decent
fair enough
i still need to reason about my IPC model
especially moving big buffers
Microbenchmark it harder
i mean he said allocator is pretty bad
it's eagerly mapping things and every anon alloc is a syscall basically
plus it's not single threaded
there's initd and posixd running at the same time
one stupid idea i had was to make it so you can "offer" another process memory
or well
i can have all data only IPC be shared memory
then have a syscall to transfer object handles
rn my channels can pass a buffer of bytes + buffer of handles
managarm's ipc is very cool
yes
But the issue with this (that I had) is that the other process/whatever needs a way to accept them (explicitly)
yeah
Otherwise you can just litter its namespace
right now i just listen to a channel with a byte and handle buffer
like, you can say you are expecting at most N handles
then you don't get more
That's how my IPC works
dam
But it's hardcoded to 4 handles + reply right
Then if you don't want them, you can reject them
why 4?
And I have async send + sync receive, and my messages take ownership of handles while being sent
Idk, just seemed like a reasonable number
yeah my messages also take ownership when you send them
as in, unless you clone them, you lose them
Sometimes you need to send a reply right + 2 of them, so I made it 4
If you want more, just send it in several messages
Yeah
But then of the thread dies, it frees its messages and handles within them
is that a problem?
No
But it creates a system, where you either receive a reply or a notification that the handle had been deleted, so if the server crashes or whatever, before it accepts the message, you're not left waiting for the reply forever
this is similar to fuchsia's ipc as well iirc
:^)
the only other idea i had for IPC was nova's UTCB thing
I was loosely inspired by mach
But I changed my IPC 2 times now
Like not fundamentally, but just had 2 big additions
i will probably change things as i go on and learn
also is the zinnia that ran weston kil?
it's still up
i'm not replacing it until i get at least to the same state
aka until i can run weston again
i wanted to get it done in a monolithic design first so i have a thing to base it off of
which will probably make implementation easier, i just need to translate it
port the entire monolithic zinnia kernel to a single server :^)

managarm?
?
posix subsystem :^)
I mean the microkernel doesn't become less microkernel if you do this 
would probably improve throughput
I guess it depends on your design, but maybe
yeah
that was my initial idea
Idk, I'm making it be a server per thing
i probably just want to have one server for the system then
That goes against the whole idea though
what idea
Microkernel
but like
splitting vfs and posix things makes little sense for example
because both go hand in hand
well yeah
Maybe filesystem is ok but you're pushing it
Idk you said you wanted one server in the system
Which kinda goes against the point of a microkernel
"system" being the core component
microkernel but servers are in ring 0
free overhead
unironically a cool idea now is doing that
but with protection keys
no protection
That's not been really explored in an entire OS yet
Though
I'd guess mostly because of lacking hardware support
hear me out
ok nvm i'm retarded
unless
let me experiment with this
i think i found a funny ipc method
protection keys are ass
and cant really be used to make this secure
oh man i missed C so much, no longer have to wait 15 seconds to do a cached build
Why?
max 16 drivers at a time lol
no
in c you can just yolo everything 
they cant do proper isolation afaik
you can only make memory not writable
ideally thats all u want to prevent bad drivers from corrupting the kernel
so you cant stop rop iirc
its not for like rop or isolation
The point is to catch bugs more than malicious code
yea
apple has a feature like that but it lets you configure everything separately
so its useful for security
iirc the fil-c guy said it wasnt that great either
iirc the kernel variant is pretty good
maybe
Managarm does not have the equivalent of a monolithic kernel in userspace
posix-subsystem is not equivalent to Linux
linuxd
posix-subsystem does precisely:
- process management
- some pseudo FSes
and nothing more
Also I wasn't talking about a particular implementation but rather the concept
It does not do on-disk file systems or other devices
I think Apple's is better than intel's
get linuxed
i think for now, doing the channel based message passing is fine
how should i deal with cycles
detect them
like if you send a handle to a channel on that channel
how lol
don't send handles to channels 
well no i do need that
just see if the handle is for the channel is in the channel
how tho
like it seems like a simple check idk
wdym
how do you send stuff?
this can be very indirect
I know how to do proper synchronous IPC but idk how to do async
and you have complicated locking
do you mean handles to send or to receive?
i only have a combined "call" handle
and also a "call target" handle that im just going to make unsendable
idk, so far I've been fine with non-transferable receive channels, and it's not a problem for send rights (however that would translate to other designs)
I mean I'm thinking about making my send optionally synchronous as well, and I would have different deadlock problems there as well
To which the solution is to either trust that userspace doesn't do stupid stuff and make it its fault for deadlocking itself, with no detrement to the kernel, or to somehow be nice and detect it, like what else can you do
send weak handles 

that's what Managarm is doing in some cases
or i can just give the handles at transfer time so i never own them in kernel structures 
yeah
ok after further analysis, im also going to have to restrict processes
to prevent resurrection; that is, after a process exits, the resources are always released and you cant bring anything back
you can implement revocation trees
that is, track from which capability another capability is derived
and then have a revoke() syscalls that revokes all derived capabilities
this is done by various L4 like microkernels
also, a system that I added in BlueRock's microkernel system is ranking of capability spaces
where you assign a rank to each capability and to each capability space and you can only put a capability C into space S when rank(C) < rank(S) (or similar, you could also reverse the direction)
this prevents cycles by design
hmm
that solution feels a lot like what you have with universes in lean and similar theorem provers
yeah
i may have stolen it subconsciously from type theory 
lol
its also the same as lock ranking ๐
a pager must have a rank that is โค the rank of its associated process
and you can only map memory with a rank < your processes rank
and you can only do ipc if the source region has an appropriate rank
yeah so i also have one more rc cycle
an async op needs to point to the target queue
because thats how my locking hierarchy works
but then if you send a message to its own queue and then close the handle you deadlock
actually i think you can solve this by using a globally sharded lock
and then once you hold that lock, the pointer must be valid or something
weston inside of weston is kinda funny
i've reworked the virtual memory allocation so no more bump vmem allocator for userspace or kernec
i really want to be able to host my own website on this
that includes
- get smp back working
- fix make
- virtio-net driver
- tcp/ip stack
- refactor the socket api so it's not superaids to write code for
i really want to run os-test to completion at least once, but for some reason it sometimes starts hanging while running sub makes
wtf unmap() finally implementeed?
I should do that on my vps, just have a nginx reverse proxy or whatever that goes into an astral vm running a web server
would be funnier if the QEMU was running in weston
this
i also really need to fix mesa, not sure what its problem is
i have to run weston with pixman gl renderer
@nocturne rampart how does lwip work
Isn't zinnia rust
Or are you going to hotglue some c rust interop
no
oh wait it's just something you integrate in the kernel?
yes
L
I'm not using that then
uACPI is the only case where it's reasonable to have C interop
you just implement sysdeps and callbacks
Lwip does that for you gang
Yeah
ok then s/udp/virtio nic/
Yeah implement some nic ig
did bro think lwip is a bunch of drivers or what ๐ญ
I'd say go for e1000
Mainly because it's supposed by every virtualization software in some way
i already have virtqueues
Yeah then do net ig
no
i thought it was a userspace thing
I didn't read any docs
i still dk what you thought it did in userspace but all good
Oh it can run in userspace
But yeah it's an entire network stack essentially
uacpi can also run in userspace fwiw
just go home
Lwip is the cowards way out
smoltcp is the slightly less cowardly way out (at least its not in c + i think its a slightly better library for kernel at the cost of being rust shit)
I don't really want to make a libOS
i already have few dependencies
e.g. syn, bitflags and seq
thats fair
i will look at it for reference tho
read TCP/IP illustrated vol 2
if you read it too carefully you will exactly reproduce the BSD Net/3 networking stack but that's no great loss
icmp 
@hoary cave i fixed MSI-X
nvme is now using it too
instead of looping
i just had it as an infinite todo
but turns out you can't really poll a nic on a single cpu system, so i had to fix it
i also discovered a very funny scheduler bug
that's a me not knowing rust issue
and leaking thread Arcs
zamnnn
I had a funny bug in my scheduler once, where it was randomly and quietly erasing threads from the existence, because all of the smart pointers were unreferenced
lol
And like the kernel was doing a great job of reclaiming resources and stuff, so like stuff was just disappearing with no trace
in rust itโs easy to mess up too, but like itโs just a few isolated unsafes so itโs also pretty easy to verify it
yeah it was in an unsafe block
of which there only a few in the scheduler code
i really need to fix smp
i also found a bug in waitpid, which probably explains the odd make behavior
maybe once all those are done i can finally complete an os-test run 
smp when 
@grave peak hello
wait, how does it not have smp?
whatsup
ssh
ssh
i wanted to see if it can do it
it's half decent
the other half is braindead
im keeping the constants
they seem correct
it did shit like THIS
totally unsalvageable
totally unsalvageable
salvaged
okay yes
technically i did salvage stuff
i kept the socket trait impl
AGI
wdym
Well can you do this better in idiomatic rust
yes
you don't need this function at all
this is what i do
it just maps to the uapi constants
it does it all implicitly
๐ฅ
this is so fucking cool
(it does require yet another mlibc ABI break)
if mlibc had semver it'd be at 40 by now 
probably
What model/structure do you use to represent and interact with devices?
I'm looking for ideas for device subsystem rewrite 2.0
wdym
"model"
there's no standard model, you have FileOps at most
to expose to userspace /dev
the rest uses specialized traits for whatever they're implementing
i don't see the need
don't get me wrong there's no need for anything in BadgerOS to be as overengineered as it is
look at iokit
that part is for fun purposes
its nice
yeah I have been looking at it
looks very nice, though not sure how I'll deal with anything potentially inheritance-based in Rust
vtables
well yea
also doesnt rust have inheritance basically
non
Rust has traits
You can simulate inheritance
But there's no class-style inheritance unless you make it all manually
yup
driver model maps well
thus why I said that
probably better than in C
I guess so
You can still do it, e.g. with an "is a device" trait that just gets you the pointer to the base device struct, and then the actual implementations go in an impl dyn Trait + '_ {} (trait-associated functions without dynamic dispatch)
How
Is this python -m http.server?
yes
send recipe
I didn't make one yet ๐

dhcp in kernel โ ๏ธ
dns in kernel 
i mean better dns in kernel than dns in every process with no global cache ngl
just spinup an sqlite database in /tmp? problem, liberals?
i was more thinking dnsfd
nice
I'm assuming Weston won't render because of drm memes
because this is not a DMT resolution
ugly
๐ฅ mesa fixed
at last
i have closed the one remaining issue on the github repo
lol?
no idea why it says invalid license
probably github dying (again)
time to switch to codeberg 
codeberg's ui is like shit
cant they just copy github's ui or something
smp fixed?
yesn't
work stealing and so on is working
but no tlb shootdowns
lol, limine switched from it back a while ago XD
bc their uptime was bad
though github also has a worse uptime recently
you must not be using it professionally
prob
just a few days ago none of the pull requests were working xd
๐
and they lost some in the process
i have a selfhosted gitea but i won't use it for this project
Didn't you say that you reached your goals with menix? 
you should selfhost gerrit instead 
when has my opinion on something ever stayed the same for more than 2 weeks
i still need xhci to be more usable
also a bunch of posix correctness fixes
but that can wait until managarm work is done
for example session management and signals are catastrophically bad
to the point where shit just breaks randomly if you're not careful
and i can't even complete a run of os-test yet
why? crashes?
well
it's hard to describe
it runs like 4-5 tests, then gets stuck doing whatever until i press ctrl+c
no use yet
like seeing what the thread is stuck in
it goes to sleep it seems
okay yeah but then why is the thread not schedulable
haven't debugged that
i see
it's likely an issue with waitpid
os-tests is not really forgiving when it comes to hangs
The tests run w/o a timeout so a single hanging test will stop the entire testsuite
hm
oh another funny thing
in curl, when you don't get a response it just stalls
I don't think there's a timeout happening
i tried running your event in miri with a mock scheduler
ubbbbb
and i imagine this doesnt help either
i have no idea if its a bug in my scheduler mockup but uhh
yeah idk the scheduler wakign functions look sketch
oh i already fixed these locally
but thanks
i rewrote the scheduler with the ULE paper
ah okay
(and copied some parts but from the freebsd impl but shh)
lol
oh so what you are saying is your Event is no longer UB?
send code
not home
ah ok
how did you test this btw
what's the setup like
i need to test my stuff more for ub
lol
that knows how to make tasks wake up vaguely correctly
Whatever forge Limine is on just kinda dies for some reason
we're too chonk
i have started working on refactoring my block io system
it allowed me to get rid of a lot of unsafe blocks in driver and fs code
It appears that device hotplug kind of requires userspace to get notified of such events
I'll add a freebsd devd compatible API to the kernel
I can't really reuse the code directly sadly, but this will go hand in hand nicely with libudev-devd to provide libinput data
port systemd-udev to FreeBSD atp 

believe it or not, devd is very simple
code wise
do u have any use for device hot plug in mind already?
usb
ah
implement netlink
netkink
fuh no
that doesn't solve anything
just more systemd kanker to deal with
it's used for notifying udev
yes but udev is hard to cross compile
skrill tissue
sorry for not being a 1:1 linux larp
I don't want to do sysfs
udev pretty much hard assumes linux everything from what I've heard
Ewwwwwdev
exactly
udev hard assumes linux, yes
It's not meant to be portable
All OSes have their own device enumeration mechanisms, more or less
exactly
Implementing netlink is not hard but you'll be forced into linux's device model or you'll need to create shims for all classes of devices (the latter is what Managarm does)
Since your /sys layout needs to be linux compatible
and "compatible" really means "quirk compatible". For example putting the same device at a different spot or with a different name will not work in all cases

ok mr smp after wayland
Larp as a unix workstation, do NOT join the linux larpers
You need to larp correctly marvin
W
I agree
thor binary compat or bust

Be actually unique and larp nothing like me
i mean I'm just mixing and matching apis how i like it
Larp as a larper. Make zinnia look like a kernel shell os
Well I do larp but I larp a bunch of stuff at the same time
ngl I need to look into bragi, maybe I can reuse it
the right way
dead os
it's safe to say that SMP is working somewhat stably
so far zero crashes
just the usual signal memes
What's that, a motherboard model?
not for now
especially not by hand
it's just way too much code lol
if i did, i would get clanker to analyze the linux xe driver and see where to start
holy
no clue why this is so fucking slow
takes ages to run anything
also where decorations
fucking hell do i need librsvg for this shit

yo it can even detect the correct resolution
it's is horribly slow tho
it takes like a minute to open a window
Do you know why it's slow?
if i knew i'd have fixed it lol
@spark surge btw
that is also fucked
@nocturne rampart
Sexy
Damn
awesome, congrats!
what x server are you using?
is your open() is fast
xorg
idk probably, why
this is working better now
i'm switching my weird event abstraction to actual rust async
memory: 0 bytes ๐ญ
0 bytes ought to be enough for anyone
idk why that happens tbh
zinnia is new 0 bytes kernel
i mean if it does proc/self/mem then it won't work
where's 10k upvotes
i should really get started on xhci do i can test real hw more
boot protocol or hid
k
doing full hid, at least enough for most sane keyboards/mice, is not that much more work compared to boot protocol when you take in consideration everything needed to get to that point
nice
that's an mlibc issue iirc
really?
see the managarm recipe
0 backtrace, 0 context, yeah let me answer that 
sorry but that's all i saw
uacpi_kernel_log gave me a non utf8 string
i didn't even know that was possible
Try not dying on it and actually print it
Like how tf am I supposed to help without any info lol
presumably it's a bug
Yeah its possible for some firmware strings to not have utf8, but there's currently no code in uacpi to repair them tho
what's weird is that this is the first line of uacpi logs
First thing it should print is its own version which is a hardcoded C string
ah wait no
it's trying to print the FACS string
looks like this on QEMU
something has gone terribly wrong with the latest kernel changes
on 2 of my laptops it just triple faults now

before i see any logs
Yeah that cant print garbage since the FACS signature is verified earlier
we'll see
And then the next two are just integers
Absolutely
this is all i do in this stage
it's probably what you did at the before stage 
i even see some ascii strings in the corrupted memory
did u reuse firmware memory for allocations?
wait
omfg ๐
it is a heap allocation but it gets freed one it goes out of scope ๐

i have to mem::leak
void *malloc(size_t size)
{
char buf[size];
return buf;
}
yeah
let me try this
technically speaking rust helped me here
because the buffer is given to an unsafe block
HOLY SHIT
LETS GO

even the time works kinda
damn
triple faults on the framework

damn
time for hang debugging
this happens before screen init
maybe race condition ?
before ap spinup?
a
i added an actual ramdisk device
Why?
so i can boot from ramdisk
Wouldnt just a tmpfs be better? That way you dont deal with metadata overhead and it allows better integration with your memory subsystem etc
?
that doesn't work
the init system looks for a block device by partuuid
this is so i don't need to write an usb storage driver
but i can still test on hw
I mean yeah U already got a filesystem there so why would you need to make another?
Why have two different in-memory filesystems?
Yeah but doesnt that cause more memory overhead than a normal tmpfs?
sure
Since you have to store more shit like superblocks inode/block bitmaps etc
but it's much easier to deploy
because i don't need to change my distro infrastructure to accommodate ramdisks
i already parse initramfses if that's what you mean
but the initramfs init will always try to mount the rootfs from a block device and chroot into it
i'd rather not hack in a special case to do this
๐
i removed so much clanker shit over the week
and smp works on real HW too now 
@grave peak i added support for memory types in Zinnia, what type do i need for ACPI tables?
can i treat it as regular memory?
In the original video it was 9. Larpers DNI
For tables specifically or just generic uacpi map
Tables are wb cached
You have to look at the memory map and see what its trying to map
If ram = wb, otherwise uc
this is a terrible bug man
i triple fault on real hw before the allocator is done
:D now i gotta hack in a pre-kmalloc framebuffer terminal
damn
wait what the fuck
do i need to manually enable EFER.NXE?
please don't tell me bro
i havent had to do that ever
Because limine
i was gonna say check the bios but what year is that machine from
Its a framework
ah
was that the very bad bug?
hmm
i keep triple faulting on the framework once i switch to my own cr3
this literally worked some time ago
idfk what could've changed
are you sure the cr3 is in ram, is aligned, the stack is good, the stack is big enough
yes
stack is inside the kernel binary so it should be loaded fine
there's no way this cpu supports LA57 right
huh
i asked clanker about it and it says that maybe the paging level doesn't match but that sounds like bullshit
Unless you asked limine for it you aren't getting it
yea i did not
But nah its not supported im p sure
la57 is likely a server thing
like you can't even get enough ram in this to saturate 48 bits
likely
are you booting from limine?
ofc
Managarm doesn't triple fault on that machine and it doesn't support LA57
yeah obviously it doesn't have la57
but i'm almost out of ideas
like, the boot has literally worked before ๐
What does clanker think about your mapping code
Bisect?
is fine
it suspects hhdm issues
:^)
oh wait a fucking minute
uh
@grave peak
do i need a CR4 bit for the Global bit
๐
lol i did add the Global bit a week ago
mfw
but the question is
what do i need to enable to make this work
SDM checkment time?
ughh
Alternative: stop using more and more extensions like global bit until you don't get 3fault
disable nx
nx is not the problem
hell disable pat if you've got it on
CR4.PGE
Page Global Enable (bit 7 of CR4)
Looks like the G bit is indeed gated behind a CR4 bit
yeah but it should be ignored even if its set
yeah thats probably not it
no nevermind
@grave peak it actually was the problem
global + no PGE is allowed on intel
shouldnt that also have died under kvm?
but not on amd 
i am on an intel pc
ig
Dw I've been triple faulted by it as well 
amd64 architecture manual
thats on you for setting a reserved bit 
it works on kvm
kvm != baremetal, especially wrt paging
on intel kvm right
yes
can u try on amd kvm
no

i don't have any amd laptop set up with it

indeed

