#Nyaux
1 messages · Page 63 of 1
THIRD TIME THIS SUMMER
I FELL ASLEEP IN VR I ONLY HAD MY WINDOW OPEN?
howd i get sick
insane
What's up with nyaux rn
funny bug we've been stuck on for weeks so monkuous is helping
What's the bug
okay so basically after forking a program and pressing a ps2 key it fucking dies (jumps to some bullshit RIP for some odd ass reason)
i had a few theories as to why its happening but like
they were all proven wrong lol
^ @maiden ridge more info
I remember this happening in Polaris a few months back
what was ur issue
I don't remember clearly but it was stack corruption
Because the stacks did not get switched properly
It overwrote each other's data
weird
Considering you're processing a ps2 interrupt here
And a syscall is happening here
Because read
I guess you could have that issue?
Wait so how do you read from ps2?
ps2 interrupts happen when not in a syscall?
like when doing anything that doesnt hold a lock
or not a syscall
So you wait for new data
Ok fair
mhm
@surreal path cannot reproduce
open doomgeneric
then press a ps2 key
oh wait yeah with doom it works
yea\
yep
mister nyaux, i was inspired by your idea so i also want to enable interrupts in syscalls
running without interrupts enabled in syscalls just feels wrong to me
okay so the issue is that while the bash read call is waiting for input a different thread (the forked bash? i'm not sure but it doesn't matter) also does a read call and when the bash read call is unblocked it returns with the wrong rsp
now i just need to figure out why it's using the wrong rsp
@surreal path why do you do this syscall_user_sp stuff manually in the syscall functions, instead of in schedd? seems a lot more prone to error this way
anyway @surreal path this patch fixes the issue, and prevents this class of issue from occurring in other syscalls in the future https://hst.sh/azareyicif.php
Damn
was that the fucking issue???
Yeah
was that the fucking issue that weve been stuck on for fucking weeks
what in the actual fuck
vro
Read was blocking and some other process was performing syscalls in the meantime so when read unblocked it returned with the wrong rsp
i see
trolled
The fix I used was to just move the syscall_stack_ptr_tmp save/restore to the scheduler
So nothing has to do it manually anymore
im gonna test this now
if this works vro im gonna go and shoot some intel employees
(in deltarune)\
bro was working on this month and fix was just move line
thats fucking insane vro
alr here we go
osdev hard reality
speaking of which @brisk zenith mind looking at that as well, thats been a known issue in nyaux for a few months lol
OOM is a bit harder to debug since it's most likely a memory leak but I'll try, how do you reproduce it?
im gonna go take a look at why doom isnt recieving keyboard input
just run doomgeneric
like a few times
dont provide a wad file ofc
i have discovered at least one memory leak: this code sequence allocates more pages than it frees
why so?
do u think its the cause
that's what i'm trying to figure out
it's definitely contributory
don't know if it's the only memory leak
but it is a pretty big one
like that code sequence has almost 1.4k unaccounted pages
wtf???
inb4 free_pagemap doesn't recurse into all the pt levels
no that's the first thing i checked, it does
ah
actually false alarm, that was only because it was the first duplicate_pagemap operation on oldprocess->cur_map
if i do it twice there are no unaccounted pages on the 2nd one
so back to square one ig
fair
ok apparently there's one process made on every invocation that just doesn't get reaped (or maybe it doesn't exit in the first place? i'm not sure yet)
that would explain ever increasing memory usage
i'm trying to figure out what this process is first
like it only gets created for doomgeneric
other programs work as expected
dumb idea but maybe add a field to the process thats js some string that you can store the executing program name for
on execve
i do believe doomgeneric uses system()
apparently it's calling system("/usr/bin/zenity --help >/dev/null 2>&1")
yea
ah i see
system is calling waitpid(pid_of_spawned_process, ...)
that hits this path
so the process is never waited for and thus never reaped
yea
yea that makes sense
nyuax trolling 
real
anyways i really thank you for your help a ton <3
wow smart people
be smart in 2025 is cringe
sorry chat no nyaux today some shit happened and i dont feel too good
🫂 💙
we ball tmrw then
Don’t feel bad, you’re doing this for yourself, we’re just here to cheer you on
yep
we ball later today
i need to investigate an issue with doom not getting ps2 packets properly
alright chat we bzll
lets go debug this shit
kaBOOM
there goes your tower fell the power
sorry chat stuck in my head
also btw heres todo list for nyaux:
- fix doom key issues
- port openrc
- implement more file related syscalls & sysdeps
- try to get gcc to compile something
- support #!/abc/123
- implement even MORE syscalls and attempt to port more programs
- implement sockets then get X ported
- implement signals
- idk whats next
okay im seeing subscriber fd 5 only SOMETIMES gets packets on keypress
its how i link subscribers it seems
to explain
say we have subscriber 1
we add subscriber 2
so now head points at subscriber 2 -> subscriber 1
now the ps2 driver has a subscriber object itself, so it calls its own handle right to put shit in. its subscriber points to nothing so doom gets JACK shit, thats what it seems?
and considering the ps2 driver opens /dev/keyboard on every interrupt (which is stupid) shit gets weird
im gonna add it so ps2 driver keeps track of its owns handle and keeps its open
hmm
still doing that shit?
i think this whole subscriber system is kinda overly complicated a little
rather then every subscriber having its own ringbuf
wait nvm
okay so like
i need to figure this out
fuck
kinda complicated aint it
@elder shoal how do you deal with this, reading your code you use some kind of hash table?? im a little confused
it just maps an id into a keyboard_t
its probably not the best way of doing it
but it just works and idc
that has its own ring buffer right? but how do you take the keyboard packets into the hashmap then put the packets in the keyboard_t???
cause u cant exactly "iterate" over a hashmap?
wait no u can
nvm
get keyboard pointer from hashmap -> put packets in keyboard ringbuffer
wait do u put the packets on write?
and iterate over the hashmap and put the packet to each keyboard_t's ringbuffer?
also how was ur day :)
keyboard irq -> driver calls into generic code with packet formed and keyboard pointer already known -> that does a bit more profcessing on it for things like shift keys and then puts it on the ring buffer for the keyboard -> the process reads /dev/keyboardXYZ -> it gets the keyboard pointer from the hashtable using the minor device number -> that reads from the ringbuffer or blocks/returns EAGAIN -> process returns read call results
its been good, went to lunch with coworkers and then played some gregtech with my boyfriend
i think ill just iterate on the hashmap
and push the packet to each keyboard_t
that should work
thats good :)
is nyaux have pipes
Port wayland. It’s better 
yea pipes will be on the list
lmao wayland is a thing we want
anyways we ball later, probs 8
implement it now
no
😡
i fixed the ps2 kbd issue
doom works perfectly fine
all pushed onto github
reasons i didnt say much is i feel absolutely ass
im gonna go figure out why openrc wont build
then cry in a corner til i sleep or sm shit
openrc?
yea
like
it will build but
it would get added into the sysroot
hold on ill show
@maiden ridge this issue
idk why its doing this shit
i make my base files the exact same as menix
i changed it to be like menix
and im using menix patches for openrc
so why wont it add itself
????
#! /bin/sh
name=base-files
version=0.0
revision=1
source_dir="base-files"
skip_pkg_check=yes
package() {
mkdir -pv "${dest_dir}/dev"
mkdir -pv "${dest_dir}/etc"
mkdir -pv "${dest_dir}/home/menix"
mkdir -pv "${dest_dir}/proc"
mkdir -pv "${dest_dir}/run"
mkdir -pv "${dest_dir}/root"
mkdir -pv "${dest_dir}/sys"
mkdir -pv "${dest_dir}/tmp"
mkdir -pv "${dest_dir}/usr"
mkdir -pv "${dest_dir}/usr/bin"
mkdir -pv "${dest_dir}/usr/lib"
mkdir -pv "${dest_dir}/usr/sbin"
mkdir -pv "${dest_dir}/usr/share"
mkdir -pv "${dest_dir}/var"
ln -svf usr/bin "${dest_dir}/bin"
ln -svf usr/lib "${dest_dir}/lib"
ln -svf usr/sbin "${dest_dir}/sbin"
ln -svf ../run "${dest_dir}/var/run"
cp -rpv ${source_dir}/. "${dest_dir}"/
}
base files recipe
/home/menix
Wait why does it make all these directories tf
/dev ??
What
okay
ln -s usr/bin "${dest_dir}"/bin
ln -s usr/bin "${dest_dir}"/sbin
ln -s usr/lib "${dest_dir}"/lib
ln -s usr/lib "${dest_dir}"/lib64
ln -s bin "${dest_dir}"/usr/sbin
ln -s lib "${dest_dir}"/usr/lib64
you forgot -svf?
okay
v just means verbose and f forces
still same error
base files is just this
its on github anyway @maiden ridge https://github.com/rayanmargham/NyauxKC
k
wdym?
Check this
arch-meson \
--libexecdir=/usr/libexec/rc \
--sbindir=/usr/bin \
still??
Do this as well
okay
like this?
Wait a minute
hm/
Ugh you can't do things like ls pkgs/package with this new Jinx as well
yea
wait nvm i forgot to save the recipe
its telling me this
${source_dir}/ ?
forgot what it was called builddir or something
Oh nvm
We literally just copy the source dir to the working dir
?/
And then patch it and build from it lmao
Wait
Ok yeah prepare is never called that's why
Bruh
What is this weird thing
Fuck it
code sources/openrc
Find the file
And manually do the edit
Then ./jinx rebuild openrc
👍
no
openrc is installing files into /bin
simple fix, make it not do that
make it install things under $prefix/bin instead
i think the problem is that /bin is a symlink to /usr/bin, but openrc installs into /bin/... so it tries to create the directory /bin
ah wait i misunderstood what you said lol
yeah you need prefix=/usr
yeah
i confused prefix with destdir for a moment 
and keep in mind that xbps will not package empty directories, so add .keep to your empty stuff in base-files 
or one of the many jinx distros maintained by mint
i'm just noting that for dennis
not really relevant but yeah
how
Oh I know. It’s a general note
Cuz those base-files are probably derived from core-files in Managarm, which I wrote 
Lmao
cooked
i hate it when that happens
hold on killing some openrc devs
mfw echo foo | xdd
?????
Where systemd
im taking a break from everything for at least a week, i am sorry.

why not
nvm i wont, just ill be a little less active with nyaux for the next few days due to something that happened
Take your time bro. No hurries
Bro I know you can do it
Ur way smarter than me and I got it too (ok only cuz people with braincells wrote the underlying stuff for me
)
id disagree with that statement but thanks dennis
Ok exhibit A why ur smarter than me: wrote an OS
Couldn’t be me
I never wrote an OS (unironically I never did)
this reminds me I need to port openrc to astral, I've been meaning to do that since forever
What do you guys use currently? A custom init, no init at all or what?
I use a simple init I wrote
I see, me too
okay so the issue is
for some odd reason process pid 3 has a pointer held to a process that JUST had its structure dealloced
so like
wtf?
i LOVE shit related to race conditions!!!
@kind root dont you love that
Those are the best bugs
WAIT just a fucking minute
why am i deallocting the process structure in the first place
i have a question
with orphan'd process's should you deallocate its kernel stack? as well as its pagemap, fd shit, etc etc
wait i forgor my kernel stacks are per thread
okay not kernel stacks
but the fd shit and the page map
should THOSE get dealloc'd when a process gets orphan'd
anyone know?
exactly
No, for orphaned processes you do not deallocate the k stack, page map, etc
After the process fully exits
kk
You can then free
then reaper doesnt have to do much really
Yeah not at all
at least for now ™ ill need some mechanism for deallocating processes later ™ when openrc works for that and shit
You should reap first then deallocate
Based
as in send process to pid 1
yea
ALSO
Yes
Yes you can
Yes, but only after the process exists
wha
epic
Just make sure you do sanity checks because shit goes wrong when doing that for some reason
Spam asserts for the time being

im doing orphan
its the job of init to reap if im correct so
i cant reap without a proper init
im doing orphan
im doing orphan
💀
how's nyaux going btw, I haven't really followed in the past weeks
its going good actually
we got openrc to semi-run dies cause no pipes
bug with the fuckin scheduler was fixed
bug with the keyboard is fixed
we have proper ps2 now
doom runs perfectly

indeed
😭
healthy and happy codebase
hi chat
hallo :3
im burned out a little so im actually taking a break at least for 1-3 days
kid named chat
While you’re taking a break play through all of doom on nyaux and record it
Don't overwork yourself frien 🫂💙
Even if a lot of this project is distraction, you're still doing it for fun
i didnt link it statically?
anyways tmrw we balling
did you add an idt init.... ok print
i dont even have a gdt print atm
i wil add those after i make a proper reentrant logger 
Most people don’t 😭😭 it’s just a meme here at this point
only the most advanced kernels have one
Yessir
NOT meme, if u dont have it = your kernel is mid
Don’t worry, it’s like the first thing that prints in mine lol
3rd thing in mine
Also mine has 3 GDTs
I tried to remove one by moving its entries to another one but I couldn't get it working for some reason
why would you ever want to remove one? The more the merrier 
fair lol
Extra points if there're 32-bit or 16-bit entries
First thing that I print is the kernel version, then I load kernel symbols and then GDT
linux is terrible since they don't GDT init OK
I also know my kernel will never be as good as your kernels so i also don't GDT init OK
maybe linux is being humble
Also third thing in mine, after ASCII logo and kernel version
I print the GDT address
no need to flex on us like that jeez
True
fair fair
do you live near the equator
no i live in ireland
danmn
how are the potatoes
ok vro
kris approved
meanwhile I live in a country that the equator goes through and it was 10c this morning 
real
i live in the CA
im gonna eat you
The equator and the poles are slowly switching places
Dude real
It’s fucking 39C where I am right now
cold as balls
it's basically always 37 - 49C here
39C isn't that bad
I live in the upper states of the United States so
Weather is bipolar
I live in Phoenix AZ 💔
Oh that’s fucked
I went there
Last year
I never experienced such torture
I actually threw up when I went into my rental car
I've been here my whole life 🥹
After it sat in the sun
i am working on nyaux js letting yall know, i forgot to say this i kinda js opened vscode and started cooking
i am learning more about opendir() and readdir() in hopes to implement it for ls
basically im writing a userspace test program to see how linux behaves
Awesome man glad to hear it
Let him cook
mb chat had a doctor appointment yesterday
im still trying to figure out how should i implement directory streams
i still do not understand what d_off is, manpage makes it kinda vague lol
d_off where?
Basically just an opaque value that when seeked to returns the directory entry
Assuming the directory wasn't modified in the meantime
Historically it was the byte offset of the directory data on disk but nowadays it's just an opaque value
the fuck????
also my bad chat js depression is why i havent been active
thats so retarded
dw
but yeah basically it's just if you seek(SEEK_SET) with this value you get the entry it's from unless the directory has been modified in the meantime and it does not necessarily have any further meaning
thats so stupid
also for impl of directory streams ill js implement it where fd->privatedata will store the directory stream shi and like the fd wont have an underlying vnode and uhhhh yea well i need to also figure out how to store the directory entries in the privatedata field to be fair
oh and it should match the return value of lseek(fd, 0, SEEK_CUR) before the readdir call
? im confused
well directories have vnodes too why would the fd need to have no underlying vnode
i mean directory stream not directories they have vnodes lol
yeah and directory streams are just fds from the kernel's perspective, why would you make those fds have no underlying vnode instead of pointing to the directory's vnode
oh then if they point to the directories vnode where do i store the dictory entry stream struct thingys
that call returns the current position in the directory fd; this code should always succeed (barring concurrent use of the fd or modification of the dir) ```c
struct dentry entry;
off_t pos = lseek(fd, 0, SEEK_CUR);
readdir_fd(fd, &entry);
assert(entry.d_pos == pos);
I'm a bit confused now too. directory fds need no extra state compared to file fds, what extra stuff do you think you need to store?
do you mean the DIR type?
yea
that's a libc internal thing that's implemented on top of fds
similar to FILE vs fds
right
as far as the syscall layer is concerned it's just an fd
what does mlibc expect
iirc all mlibc wants for directories specifically is sys_getdents
and it should return the same structure as linux's getdents64
ya mean this
ah yeah that
it also might expect sys_seek to work properly on directories as i described earlier, but that's only if mlibc is fully feature complete wrt the dir stream functions
they're stored in the vnode
so that means the dir stream vnode ptr should not point to the directory vnode
not sure we implement seekdir
void seekdir(DIR *, long) {
__ensure(!"Not implemented");
__builtin_unreachable();
}
long telldir(DIR *) {
__ensure(!"Not implemented");
__builtin_unreachable();
}
nop
and apparently no one in the whole world needs this :^)
just like you (probably) have a vnode function for looking up the child of a directory vnode, you should have a readdir function that reads as many entries from a specific position
pretty much exactly the same as the normal read function
you might even make them the same function although then you have to be extra careful to return EISDIR/ENOTDIR when appropriate
iirc mlibc expects multiple (as many as can fit) variable-sized struct linux_dirent64 elements
just like how normal read takes the size of the buffer and reads bytes into it until either EOF or the buffer is full, readdir takes the size of the buffer and reads entries into it until either EOF or the next entry doesn't fit
right
so like if you have a size_t readdir(vnode *self, void *buffer, size_t size, uint64_t *position) it'll read entries starting at position (note this is an opaque filesystem-internal value; the only value that's guaranteed to mean anything is 0 which reads from the start of the dir) until EOF or size - bytes_read < size_of_next_entry, at which point it updates position and returns bytes_read
these are the dir seek and readdir functions of hydrogen's ramfs https://github.com/proxima-os/hydrogen/blob/main/kernel%2Ffs%2Framfs.c#L211-L320
readdir figures out which dentry to start with (potentially a fake one for the two dot entries) and starts writing into the buffer until you can't anymore
nyaux does not do this, it does it on the fd level
in this case position is just an index into the list of children (offset by 2 to account for the fake . and .. entries)
right
only kind of
the seek function on the fs level takes an anchor and an offset and returns either an error or an absolute position
it doesn't actually update the fd
you have to have some kind of fs-level seek function because different file types/devices interpret anchors and positions in different ways
for example some fs might only support seek_{set,cur,end} while another also supports seek_hole
one device might support seek_{set,cur} but not seek_end

also fs-level is kind of a misnomer here, these functions are per-file-description
different file descriptions from the same fs are allowed to have different readdir impls for example
even fucking worse 
what do i do in that case

like what do u think nyaux should do that would be easiest cause this sounds complicateed as fuck
this is also necessary for proper chardev/blkdev support, where they can exist on almost any fs but their ops are independent of the fs
also wtf is happening here
fucking hell
i dont know what to do
getting the parent directory while taking into account crossing mounts, chroot, etc
oh yea

like
i dont even know where to begin impling that
im so fucking cookef
like how does that even fucking work
who changes the ops
might be best to conceptually imagine it in a language that has OOP support like C++
why is it required for proper chardev/blkdev support
no i cant
everything vfs is C
im afraid
conceptually imagine is different from implement
you can conceptually imagine something in C++ and implement it in C
right now you have something like this ```c++
class FileDescription {
off_t position;
Vnode *vnode;
public:
off_t seek(...) {
...
this->position = new_position;
return new_position;
}
ssize_t read(...) {
...
int error = this->vnode->read(buffer, num_readable, this->position);
...
this->position += num_readable;
...
}
};
class Vnode {
public:
virtual int read(...) {
return ENOTSUP;
}
};
mhm
hydrogen has something like this (with different names and stuff ofc) ```c++
class Vnode {
...
public:
virtual FileDescription *open(...) {
return EXDEV;
}
...
};
class RegularFileVnode : public Vnode {
...
public:
virtual int read(...) {
...
}
virtual FileDescription *open(...) {
return new RegularFileDescription(...);
}
...
};
class DirectoryVnode : public Vnode {
...
public:
virtual FileDescription *open(...) = 0; // overridden by fs
...
};
class DeviceVnode : public Vnode {
...
public:
virtual FileDescription *open(...) {
...
return getDevice(id)->open(...);
}
...
};
class FileDescription {
protected:
off_t position;
Vnode *vnode;
virtual off_t make_absolute_position(off_t offset, int anchor) {
return -ESPIPE;
}
virtual ssize_t do_read(void *buffer, size_t size, off_t position) {
return -ENOTSUP;
}
public:
off_t seek(...) {
...
off_t new_position = this->make_absolute_position(offset, anchor);
...
this->position = new_position;
return new_position;
}
ssize_t read(...) {
...
ssize_t ret = do_read(buffer, size, this->position);
...
this->position += ret;
return ret;
}
ssize_t pread(...) {
...
ssize_t ret = do_read(buffer, size, position);
...
return ret;
}
virtual ssize_t readdir(...) {
return ENOTDIR;
}
};
class RegularFileDescription : public FileDescription {
protected:
virtual off_t make_absolute_position(off_t offset, int anchor) {
...
}
virtual ssize_t do_read(...) override {
...
int error = static_cast<RegularFileVnode *>(this->vnode)->read(buffer, num_readable, position);
...
return num_readable;
}
};
you will notice that vnodes are responsible for creating the file description
some vnodes (regular files, chardevs, blockdevs) have a common fs-independent open implementation (and thus file description implementation)
others (directories) do not
the fs-independent file description implementation for regular files make it so filesystems only have to provide a single function (in this example, reading from an absolute position without taking into account EOF; in actual hydrogen, it's everything necessary for mmap to work properly)
what does this look like in C?
- Vnode/RegularFileVnode/DirectoryVnode/DeviceVnode: https://github.com/proxima-os/hydrogen/blob/c18f439c1a8c8f72f14e8eea62ee0d77dc3be7bc/kernel/include/fs/vfs.h#L127-L182
- FileDescription: https://github.com/proxima-os/hydrogen/blob/c18f439c1a8c8f72f14e8eea62ee0d77dc3be7bc/kernel/include/fs/vfs.h#L75-L100 (pointer to ops is stored within file.base)
- RegularFileDescription: https://github.com/proxima-os/hydrogen/blob/c18f439c1a8c8f72f14e8eea62ee0d77dc3be7bc/kernel/fs/vfs.c#L1295-L1438
you'll notice that in mapping this to C some stuff that is conceptually virtual no longer is for efficiency reasons
some stuff that was separated is put together for cleanliness
etc
for example what was "virtual ... open(...)" has become a switch case: https://github.com/proxima-os/hydrogen/blob/c18f439c1a8c8f72f14e8eea62ee0d77dc3be7bc/kernel/fs/vfs.c#L1466-L1499
here's the generic vfs_pread function in hydrogen as a usage example https://github.com/proxima-os/hydrogen/blob/c18f439c1a8c8f72f14e8eea62ee0d77dc3be7bc/kernel/fs/vfs.c#L1641-L1651
it just makes sure the args are sane, that the file in question can both seek and read, and delegates to the file description function
for regular files that goes into the fs-generic regular_file_read which interacts with the page cache
but this op doesn't have to be fs-generic
or it the generic version can be built on top of a different mechanism like the page cache
chardevs and blkdevs can exist on any filesystem, but the operations done on them are independent of that filesystem. you cannot implement this cleanly if you unconditionally use generic functions that delegate to vnodes
similar story with FIFOs (aka named pipes, which is a bit of a misnomer imo since the more convenient way to implement it is pipes being unnamed fifos)
like i have so many questions (wtf is a EXDEV) what the fuck is a getDevice(id)???? whats id>??? for some reason all of this is making me overwhelmed? i feel like i have to rewrite my entire vfs to make this work to be fair
but like i can think of one way of making this work with my cur vfs impl, js forcefully add some switch statement when mlibc calls open and make it init a dif struct instead of a reg fd, then have that be used for open instead. is this a simple and easy way to get this working without TOO much work? or is this retarded
well getDevice(id) takes a major,minor combo and returns the actual device
why do u do that
it's just conceptual; in hydrogen I don't have major,minor numbers and just store a pointer to the device in the vnode struct
why do u lookup via major minor??
i dont have major minor numbers so i dont care tbf
because that's the Unixlike Way of Doing Things
i dont like that way so im js not gonna do that
however is this solution at least semi decent
oh I just noticed I used the wrong error code there, EXDEV should be ENOTSUP
let me think abt that solution though
kk
do you mean something like this?
this is within the generic open implementation
well nop
i meant this
struct regfdhnd {
...
struct devfshndops *possibledevfdops;
};
struct syscall_ret syscall_open(...) {
...
if (hnd->node->v_type == BLKDEV || hnd->node->v_type == CHVDEV) {
hnd->devfshndops = ?; // i dont know what to set that to but default impl i guess?
hnd->devfshndops->open(...); // after doing shit will call node open
}
...
};
@brisk zenith
that looks right yeah, linux does something similar
okay so that means i DONT have to rewrite my entire vfs lol
holy shit lets fucking go
they store file description ops in the inode (their vnode) and/or device and open is within those file description ops
right
welp i dont know what open for a device would really do? other then like idfk? i genuinely have no use for fd indepent device open calls atm to be fair
ttys do special shit on open
like other then calling open on the device itself
like what?
setting controlling terminal for example
connecting to the modem if relevant and not already done
shouldnt that be done on the vnode open itself
the vnode open is the device open
yeah
so again no use for fs indepement open yet lol
anyways ill impl that soon like later its so fucking hot
then ill have to deal with figuring out the funny, i.e. making readdir work
also btw on creation do directories create the posix dentry_ts they store on a fs level?
in like a list
i see u kinda do that in hydrogen?
hydrogen's a bad example for things like that because the only semi-real filesystem it has is ramfs and for stuff like that you need a real on-disk fs to compare against
right
in this case dentry_t is an entry in the directory structure cache
which i 100000% have
for ramfs every entry in said cache that hasn't been removed has an extra reference so it stays in memory

I suspect you have something that is effectively the same thing except private to the ramfs implementation
because there's not really any other way to implement ramfs
i dont have a cache
and with ramfs it effectively isn't a cache
do you have a list of named vnodes on every directory vnode? or maybe a hashmap?
because that's effectively what hydrogen's dentry "cache" is on ramfs
we have this
yeah that's basically the same thing as my dentry_t when associated with ramfs
within the vfs as a whole there's a huge difference
but all ramfs knows about it is that it's a way to go from parent + name to child
or from parent to children + names
okay but how does this relate to the funny posix dentry structs
not in the slightest
yea lol
it's just where I get some of the data from
makes sense
this is the function that emits my equivalent of posix's dentry https://github.com/proxima-os/hydrogen/blob/c18f439c1a8c8f72f14e8eea62ee0d77dc3be7bc/kernel/include/fs/vfs.h#L297
ramfs gets the parameters to this function from dentry_t, but that's the full extent of the relationship
OH
i was being retarded
i thought i had to store those dentry_ts in some kind of list
but i dont
like i thought i had to allocate them
i can js create them on the stack then write that shit to the buffer right
shouldnt be bad
yeah all readdir does is call that function until it eofs or errors (probably due to a lack of space)
yea lol
can you give me ur devicevnode open
@brisk zenith if ur up that is lol
okay interesting
nyaux has the device as a fs itself called devtmpfs
but i can still make this work
well thats what i do now
pretty much useless for now
😭
found a bug
another bug
fun
why is catting the dev dir calling hardlink
🥺 🫂 💙
love you /p
what is /p?
platonic
platonic
sad
alex is already dating laura lol
"No hetero"
whats the bug atm
catting /dev does this weird ah shit
just dont cat it 
real
well i still have this bug but this is better?
i mean
i get no input if i cat /dev/keyboard but yk
WHY IS IT CLOSING FD 1 AND FD 0 😭
it is running the funny
lol but seriously why is it closing fd 1 and fd 2???
it hates them
ok vro
nothing ever makes sense vro
🥀
is they are tty
yes
then you can just ignore
You have an extremely good kernel
Holy shit
Nyaux Gaming
(Port tetris)
maybw
Damn now I want to port Tetris to BadgerOS too
Unfortunately that's a bit far away in my current planning for it.
yes
1-2 weeks ain't that bad
it is pretty bad when 99% of prebuilts ship within a few days max
but maybe it's a small irish company that builds them on demand
who knows, not me
its custom parts that get assembled
Custom assembly 1-2 weeks makes sense for
why not to build yourself
my dad wants to fiance from this one company named humm
i dont have a choice in the matter im afraid
😔
have to be careful tho, tetris holdings is a shitty company that likes to file dmca's
though if the tetris is made by someone else then it doesn't matter ig
write your own tetris
there's easy portable gameboy emulators ???
There's like one billion tetris clones, just port some random command-line Linux one that almost certainly exists already.
thats a normal shipping time hwat
most of the things I order get here in like 1-2 weeks
Absolute braindead retardation sorry. I wouldn’t get too attached to it. If he doesn’t make payments high court enforcement (or whatever it’s called in Ireland, this is UK terms) they’ll get your shit and you’re fucked
Proper vendor tho. My laptop came from them (well the Dutch version)
specs?
same ssd as me
I have 970 evo plus
I have 1tb 980 pro (and 990 pro 2tb though that's still on my shelf and I haven't yet installed that) + 1tb sata crucial mx500 + 240gb sata kingston a400
damn, wtf
yall are past Ryzen 5000 yet?
crazy, I could never afford something that new
all I have is a Ryzen 3500X, a 5700U, a 5500U, and a 4750U
I have 4650g
9600
Decent specs. I’d want more storage tho (also 16GB is minimum, upgrade to 32 when available. Your LLVM compiles will thank you)
i think it was 32gb actually
It better be
I mean, I'd hope there'd be at least 25 messages in 27 days 
its not my fault atp, its due to my mood getting even worse
yes i still work on nyaux regularly but not as much anymore
i dont even get on discord as much anymore
as im just way too fucking depressed to open the laptop
most of the time i just stare at the ceiling
its not that i dont like working on it its just shit has gotten WAY worse this past month
to the point its difficult to even do much
but like cry and shit
ilo specs are correct
i know
ill try to work more on nyaux when the PC arrives i guess
but like dont expect wayland in a week
or smt
im gonna go attempt to try the last time to get my dad to talk to the doctor about meds
if he makes another excuse im changing the doctor myself atp
if only i wasnt depressed, nyaux would be in fucking Xorg i swear
nah fucking systemd vro
and like i know yall dont expect me to work on it but i want to thats not what im talking about, im js frustrated atp with how im feeling and shit doesnt change and shit get even worse mood wise SOMEHOW
Bro first upgrade you’d do on that box is RAM. Then probably storage.
yea the RAM is kinda slow
Bro you got this
thanks dennis
More concerned about 16gigs
no its 32GB
Then storage probably first
lol
yea pretty much
again for nyaux development to say on topic i dont think im gonna write a single line until the PC arrives to be fair
itll come soon tho
its under testing
photos btw its been built (this link doesnt have private info dw)
Manufacturer of performance custom computers and laptops. Customise your ideal gaming PC or laptop using our advanced configurator.
id recommend that
was one of the things i wanted to talk to you about when we meet up lol
Yeah. You’re 18, you can choose
I’d do that ngl
You don’t have to deal with your dad here
here at 14 your parents dont have access to your medical info
Yeah in the US at 13 your parents can’t have the info without your permission
Depends on the state
Especially depending on what the medical info is
Like I know that in my state (tbh idk why I know this) if you are positive for HIV your healthcare provider MUST tell your parents
also something more funny
nyaux js randomly page faulted js now when trying to launch init
just randomly
it happened once
not reproducable
everything works fine after rebooting that VM
and does for like 50 tries
ANYWAYS
pc is dispatched
we so ball when it comes
race condition or solar ray bitflip... we shall never know
nyaux js? are you making a web framework now
ok vro
just run it a few thousand times
ah yes
(scripts exist)
im not doing that
make something for testing
bro just make a disk image
no
too big already
yea because i compile gcc with -g
a disk image
nyaux gets turned into an iso
a file that imitates a disk and you store other files in
im not writing a disk driver
ok you can still have a disk?
how is it a proper os then
basic nvme is ezpz
it runs programs properly
it manages resources like a kernel should
its mostly posix complient
compliant
can you do ls
when is that?
2-3 working days
so monday to tuesday most likely
its been dispatched
like today
Letsgo
pcs not coming til wednesday todays a bank holiday
how do you not know that
i forgor
its coming tmrw
fedora install livestream?
lol
ill genuinely see if fedora is on the cards
it is always on the cards
nya :3
nya/ux (the cat operating system)
Pc acquired tmrw we fucking ball, I need today to tho to like set everything up and stuff
Also wanna play a few games
play gregtech new horizons
Po2 kappa mode or go home
(Or I guess po3 kappa mode if you want a newer MC version)
Alright chat we ball tonight
sorry I fell asleep and
nightmares happened
But we still balling tonight dwdw
We will implement dir streams
Do you mean stuff like getdents?
Yes


alright sorry chat, we are balling now im working on it rn
so last time we were at figuring cat /dev/keyboard right
okay so new development, ps2keyboard is getting its deconstructor called??
okay
yea i e whats going on
wtf do i do atp
program is calling close on fd3
but bash is also using fd 3??
does anyone know what should i do in this scenario
debug
what?
no i mean
its perfectly reasonable
that bash and the program are gonna use the same fd here
but i dont know what to do
in this scenario
you refcount the object the fd refers to right?
no
do you share file descriptor tbsle between bash and a child process?
the fd table is duplicated
as per fork
they shouldnt share teh same table after fork tho
then why would a process care about another process' file descriptors?
close one, other is still open
real
oky so basically in the keyboard i have this array that stores ps2keyboard classes
index is the fd
thats not gonna work with multi processes
so when you do ```c
int fd = open("/dev/null", O_RDONLY);
int new_fd = dup(fd);
close(fd);
char buf[4];
read(new_fd, buf, 4);
i think youd be cooked
idk
well no u wouldnt
duping fd creates a new fd handle
if other fd is closed ™ that new fd handle wont close
what does it refer to tho
you mean what fd handle is?
whats a real handle?
this bullshiut
uhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh waittt
yea ur right
that shit would cook nyaux qwinci
i forgor how my fds work again
lol
yeah you should refcount the filedescriptorhandle
whats the best way to do that tho
and in dup you just increment the refcount of that and put a copy of it to the new location
you mean a copy of the refcount? like duped fd and fd store the same refcount or smt
?
