#Nyaux

1 messages · Page 51 of 1

broken depot
#

It's not too complicated

#

In the end it's just a bidirectional fifo with some extra sugar.

edgy pilot
#

they are character devices. your input device sends them, well, input. they process it according to the flags set (found in manpages). then you just read data from them. writing sends data to the backend driver, like the display

flat nymph
#

I get that

#

But how do they take over displays, how are keyboard drivers supposed to interract with them, etc.

#

what's the role of init server in all of it

edgy pilot
edgy pilot
flat nymph
#

(microkernel shenanigans)

edgy pilot
#

that might make things more complicated

#

smh autocorrect

flat nymph
#

because I'd suppose my tty would habe to be a userspace server

#

what about multiple displays

edgy pilot
#

n ttys per display?

broken depot
brisk zenith
flat nymph
#

like I've never written a big userspace application, I just don't have a feeling of how the things are connected

#

Linux KMS/DRM based virtual Console Emulator
Time to nag @ ma_rv about uDRM KEKWlaugh

edgy pilot
#

udrm nooo

brisk zenith
flat nymph
#

I would need to implement devfs first

#

But yeah

edgy pilot
#

I think one was just called fbcon or fbterm

flat nymph
#

I mean I have flanterm, and a keyboard driver

#

And userspace

#

Just no glue for them to run bash

flat nymph
flat nymph
edgy pilot
flat nymph
#

I'm missing elf auxiliary vector

#

and execlp

edgy pilot
flat nymph
#

No, I mean I have full fork already

#

Which creates a new process and clones open files

#

and I have POSIX pipes...

flat nymph
#

What if I do the terminal thing in Rust? thonk

flat nymph
rich trellis
#

switch language every time you add a filetrl

#

going from c++ to rust to whatever

flat nymph
#

I mean I also have Go working...

tardy hull
#

i need someone to tell me to finish PMM, ping me

#

i need motivation

#

need someone to tell me to finish memory managment today

#

the whole thing

flat nymph
#

@tardy hull

tardy hull
rich trellis
#

@tardy hull finish the pmm or i will tickle your feet when you go to sleep

tardy hull
#

ty guys

#

also opinion on what allocator for kmalloc?

rich trellis
#

bals

#

buy yeah

#

slab

worn rain
rich trellis
#

im struggling with the pmm and vmm tho so idk

worn rain
#

with the pmm?

cinder plinth
#

slab is really good

worn rain
#

what are you using

#

buddy or freelist?

rich trellis
#

i was about to use bitmap

#

thing is

#

i need to virtual map it

worn rain
#
  1. you dont
flat nymph
#

I just use dlmalloc galaxybrain

worn rain
#
  1. bitmaps are slow af
flat nymph
#

bitmaps are ok, but why would you use them when freelist exists

worn rain
#

well

#

maybe he needs contiguous memory

rich trellis
#

okay but how could i implement a freelist for the pmm?

worn rain
#

buddy allocator all the way

rich trellis
#

im kind of a dumbass

flat nymph
# worn rain

For vmm, read the second part of this paper (vmem)

worn rain
#

he was talking about the pmm

flat nymph
cinder plinth
rich trellis
#

yes

#

its a linked list of pages

#

afaik

worn rain
#

just implement a buddy allocator

#

O(1) allocation

#

and O(1) free

cinder plinth
worn rain
#

well, you traverse the layers but thats still O(1)

cinder plinth
#

buddy is not O(1)

worn rain
#

considering I cap layers at 10 max

#

I dont see where else I could fit it

cinder plinth
#

isn't it like O(log n)

#

Or something

worn rain
#

tehnically yes

#

but if you cap the layers to like 10

#

then its rather wrong to say its logn

coral dove
#

Im pretty sure most operating systems limit the amount of layers right?

worn rain
#

ofc

cinder plinth
#

I may look into buddy eventually

coral dove
#

It’s pretty easy to implement

rich trellis
#

i think ill just go with bitmap

coral dove
worn rain
#

no please dont

rich trellis
#

the issue is bootstrapping some pages to the page tables

#

but eh

worn rain
#

just

#

use a freelist

rich trellis
#

i will probably solve it

worn rain
#

its less code too

#

and O(1)

surreal path
#

guys

#

chill

#

i keep heeaering ping ping

worn rain
#

instant allocation

surreal path
#

from here whats going on

worn rain
surreal path
#

im tryna nap some more

rich trellis
brisk zenith
#

why has the nyaux thread become lounge 3 (lounge 2 is uacpi)

rich trellis
#

yet

#

bitmap

worn rain
coral dove
#

OH SHIT

coral dove
#

MB

#

I THOUGHT TJIS WAS ANOTHER ONE

#

SORRY BRO

worn rain
#

OH I SEE

surreal path
worn rain
#

we are in nyaux

worn rain
surreal path
#

😡

#

im technically in bash tho

tardy hull
rich trellis
#

oh shit

#

freelist just made sense on my head

#

oh shit

#

what have i been doing all this time

surreal path
#

please move to somewhere else thank you

rich trellis
#

okay

flat nymph
edgy pilot
#

there's a chance that I won't have much time to work on my kernel in the coming days

flat nymph
#

Maybe I will do bash once I finish with loongarch meme meme

#

just to beat Nyaux

edgy pilot
#

the osdev race

flat nymph
#

But I want to do it in Rust

#

(Which implies that I should finally write the init server)

surreal path
#

okay so time to implement ttys

worn rain
#

tities?

#

||im so funny haha||

rich trellis
#

tities tty when

ebon needle
#

r/unixporn...

thorn bramble
#

you just do

#

:^)

surreal path
#

i have an even shitter sleep schedule now

#

i slept from 8am

#

:)

rich trellis
#

you can think that will tickle your feet when you sleep if you dont work

rich trellis
#

i sleeped 4 hours today

surreal path
#

nah thats crazy exit code 0 is crazy

quick quiver
surreal path
worn rain
#

why would you ever create a single huge page tho

thorn bramble
#

because that's how a buddy allocator works

#

it's a binary tree sort of

worn rain
#

just cap the max level

thorn bramble
#

at what

#

1?

worn rain
#

10

#

11

#

whatever u need

thorn bramble
#

so you still need to potentially coalesce smaller chunks into bigger ones

thorn bramble
#

no matter what you do

surreal path
#

watching these to understand unix more and to understand how to impl a tty, after this video series ill read the tty article

flat nymph
worn rain
#

when adding a cap

surreal path
worn rain
#

lets not talk about this here tho

thorn bramble
#

no, if you coalesce it never becomes O(1)

surreal path
flat nymph
thorn bramble
#

ok maybe it comes close for very small N

flat nymph
#

but yeah, it's not a freelist where you just push to it

thorn bramble
#

exactly, it is never truly an O(1) algorithm

#

but it isn't bad just because that

flat nymph
#

my allocator at most just coalesces with free region before it and region after it

quick quiver
flat nymph
#

but it becomes slower in relation with how much memory you have

#

buddy is always slow

thorn bramble
#

buddy isn't slow tho

worn rain
#

we should just agree then that its logn where n is max number of levels

surreal path
#

#allocators please :) u can discord forward to allocators and countinue ur convo there :) cause this isnt related to nyaux and while i dont mind the convo here and there its getting a bit much now

flat nymph
#

then I agree with everyone

worn rain
#

lovely

surreal path
#

okay bros yapping at this point

#

ima just read the tty article

#

now

flat nymph
surreal path
#

because hes talking about pipes and

#

shit

#

and signals

#

for some reason

#

those are a todo to learn in my mind but not rn

#

need to laser focus on tty shit

flat nymph
#

pipes are easy

#

you just shit into one end and it comes out from the other one

surreal path
#

💀

#

dont make me imagine that

flat nymph
#

like a water pipe literally

thorn bramble
#

literally tho

rich trellis
#

wather pihpe

thorny glen
#

but thats probably less useful for analyzing performance lol

flat nymph
#

here we go again

surreal path
#

i think i get how a tty works

silver yarrow
surreal path
#

theres this thing called a line discipline that can be attached to a tty, its a passive object ofc so it doesnt do anything itself without someone calling it. from what i understand the line discipline has commands and its own buffers. for example with line editing u can have editing commands like backspace and such

the default discipline provided line editing and only one line discipline can be attached to a tty at a time

#

i think i got that part right

#

tty has its own fields sure but its kinda useless without a line discipline

#

did i understand correctly-ish

#

yea linux documention seems to comfirm it

cinder plinth
surreal path
cinder plinth
#

and implement them

surreal path
cinder plinth
#

a simple tty is pretty easy

surreal path
#

im already trying to run bash

#

it wants a tty

surreal path
cinder plinth
surreal path
#

i dont have ioctl

median goblet
cinder plinth
#

make a useless device file and make it fd 0,1,2

#

then monitor reads, writes, and ioctls to that device

#

writes for now you can just call flanterm, but in the future when you support cooked vs raw mode and termios stuff you may want to do something else

surreal path
#

let me cook here ill try to make an actual tty implementation

#

does a tty have its own buffer

#

why does linux have a name for a line discpline

#

okay reading further into this

#

linux has it so tty_driver install into a tty, and then the tty driver is passed into the line disclpine for its ops to be called

#

heres what ill do

cinder plinth
#

you typically have a ringbuffer for input

surreal path
#

in the tty itself?

surreal path
cinder plinth
#

I would be inclined to say yes but idk

#

depends on your implementation really

surreal path
#

i want it to be done well really

cinder plinth
#

but like think about two users connected to two different ttys

#

thats not really a thing nowadays, but in old unix it was

#

so they mustve had a seperate buffer

surreal path
#

can both be ring buffers?

#

ring buffers are funny

#

@cinder plinth ?

surreal path
thorn bramble
#

big enough

#

ideally

surreal path
#

like 255?

surreal path
thorn bramble
#

use whatever you think works the best

#

a ring buffer is fine

surreal path
#

okay, im gonna steal a library that impls a ring buffer because i dont wanna do some shitty implementation

thorn bramble
surreal path
#

wdym nah

thorn bramble
#

its 5 lines of code

surreal path
#

ill screw up those 5 lines of code

#

thats ze issue

#

if i wrote it itll js be bad

#

and

#

idk

thorn bramble
#

there is only one way to write a ring buffer and you either do it right or not lol

#

its literally a pointer and two offsets for read and write head

broken depot
# broken depot No you can't

That's not how terminal input and output works in shells. The shell doesn't forward from the TTY to the child process, it gives its child process an actual handle to the TTY (unless replaced by a pipe)

flat nymph
broken depot
broken depot
#

Also it's --size because you want to decrement first

flat nymph
#

but like that's pretty much how you would do it in hardware

broken depot
#

Sorta

#

The way you'd do it in hardware is usually actually a ring buffer

#

You can do what you described but it's less efficient

flat nymph
#

but you just chain a bunch of registers

broken depot
#

Like I said: what you say would work but is not how most implementations actually work because of efficiency problems or even clock-domain-crossing problems.

surreal path
#

working on ring buffer shit atm

#

ok fone

#

done

median goblet
median goblet
#

The shell doesn't do line buffering, the terminal does, but in terms of data flow you can think of it like that

broken depot
# median goblet Why not

Because this implies that the shell is writing data that the first process then reads, which is not the case. The TTY already has that data.

median goblet
#

Well, it "already has" the data because the shell wrote that data into it.

#

The same reason the shell "has" the output data because it was piped in from the process

broken depot
#

Do you understand how TTYs generally work under Linux? Because it isn't this.

median goblet
#

I have a general understanding of TTYs I think

#

Not necessarily in Linux

broken depot
#

Like I said earlier, the shell doesn't forward data from the TTY to the process, it merely gives a handle to the TTY to the process.

median goblet
#

Did I ever say that?

broken depot
#

Your picture implies it.

median goblet
#

No. I cut a line through the terminal character device implying it could be represented as two pipes, in a duplex

#

(The shell -> tty -> process pipe has some extra logic though for line buffering)

broken depot
median goblet
#

Sure. A file with two different read ends and two different write ends

#

The shell gets one set of one read and one write end, the process gets the other, as far as I understand

#

(I guess this is why you can write to stdin and it will still show up on the shell)

broken depot
#

The problem I have with this

#

Is that even if you do have a shell that intercepts FDs 0, 1 and 2

#

The way you drew that implies something something different than that

median goblet
#

It implies that you can think of the terminal character device as a duplex of pipes

#

Nothing more

broken depot
#

It implies a closed loop where the TTY acts as a glorified pipe to the child process and back, which I am very confident is not what the video tries to convey.

#

And yes, you can create set-ups like that

median goblet
#

Two, glorified pipes

#

Not one

broken depot
median goblet
#

I think I did mention it does not work exactly like that but you can think of it as such if it gives you a better idea of the actual workings

median goblet
broken depot
#

Also the TTY has conversions for newlines

#

Arguably part of line buffering

median goblet
#

because you say "where's the TTY" when I split it up into two pipes

broken depot
#

You're not getting the point I'm making

median goblet
#

again. my point wasn't to accurately describe the operation of a terminal character device. my point was to give an idea of how communication through a TTY works: you can think of it like two pipes in a duplex

cinder plinth
#

robot you seem like you're being overly pedantic

broken depot
#

If you do the analogy of splitting into two pipes, then the way you draw it on this diagram implies to fundamentally change what that square actually does.
Because when it is just one square you're not implying that the shell uses it to send data to the child process, but with the specific way you drew, it does.

#

Which, once again, is fine, but not a TTY at that point

#

Because now the actual TTY would be somewhere else and only the shell would have access to it

median goblet
#

the shell uses a pipe to send and another pipe to receive

broken depot
#

Of course it does

#

But I don't think you're getting what I'm trying to explain to you.

#

I'm not arguing against the dual pipe analogy, I'm arguing against how you drew it here.

median goblet
#

to reiterate. YOU CAN THINK of it as a pipe duplex. doesn't mean that it ACTUALLY is. in particular there are certain things the TTY does (line buffering and new line conversions) that dumb pipes simply don't.

broken depot
median goblet
#

Other than the pipe duplex system? What does it imply?

broken depot
#

The original example shows one handle to the TTY being shared to the child processes and the shell right?
For your analogy of dual pipes, I would expect the division to be such that there's two pipe objects shared by the shell and child processes, each is either written by both or read by both, and the other end is "the physical device™️".

#

And like I said, what you drew isn't inherently invalid but it doesn't describe the situation I think you want it to.

broken depot
median goblet
#

Here's another attempt

#

Is this better

broken depot
#

I say this because of the sheer amount of times some random youtuber did exactly such a harmful simplification causing me problems solved by looking up the actual system.

broken depot
#

It could be if it had said something like "virtual TTY"

#

But the text reads to me like it's the actual /dev/tty* file

surreal path
#

okay so ive impled ring buffers

#

whata should the 2 read and write buffers on a tty device be called

broken depot
#

If you have a virtual TTY (a special file where one's read is the other's write and vice versa), you might even just call them A and B depending on how the data structures are represented in your kernel.

cinder plinth
#

i think you have a stick up your ass

broken depot
surreal path
broken depot
#

I never said any of you weren't well-intentioned and I don't judge anyone for not knowing certain things or having a misconception about it. What I do judge people for is needlessly throwing insults. We're both human and, regardless of who's right in this situation, I think you wouldn't want to be described as "having a stick up the ass" either.

surreal path
#

ringbuffer seems to kill kernel lol

#

my code

#
struct ring_buf *init_ringbuf(size_t thesize) {
  struct ring_buf *ringbuf = kmalloc(sizeof(struct ring_buf));
  ringbuf->size = thesize;
  ringbuf->write_idx = 0;
  ringbuf->read_idx = 0;
  ringbuf->buf = kmalloc(align_up(thesize, 8));
  return ringbuf;
}
// referenced from wikipedia but i sorta undestand it
int put_ringbuf(struct ring_buf *buf, uint64_t data) {
  if ((buf->write_idx + 1) % buf->size == buf->read_idx) {
    return 0;
  }
  assert(buf != NULL || buf->buf != NULL);
  buf->buf[buf->write_idx] = data;
  buf->write_idx = (buf->write_idx + 1) % buf->size;
  return 1;
}
int get_ringbuf(struct ring_buf *buf, uint64_t *value) {
  if (buf->read_idx == buf->write_idx) {
    return 0;
  }
  assert(buf != NULL || buf->buf != NULL);
  *value = buf->buf[buf->read_idx];
  buf->read_idx = (buf->read_idx + 1) % buf->size;
  return 1;
}
void resize_ringbuf(struct ring_buf *buf, size_t resize) {
  assert(buf != NULL || buf->buf != NULL);
  void *new = kmalloc(resize);
  void *old = buf->buf;
  memcpy(new, old, buf->size);
  buf->size = resize;
}
surreal path
#

yea

#
struct ring_buf {
  uint64_t *buf;
  size_t size;
  size_t write_idx;
  size_t read_idx;
};
cinder plinth
surreal path
#

is there anything wrong with this code @broken depot ??

cinder plinth
#

you should free the old buffer

surreal path
#

other then that

cinder plinth
#

and set buf->buf to new

broken depot
#

Why is the pointer for uint64_t * in that case?

#

That might be what's causing your error.

surreal path
broken depot
#

That's fine

#

In that case you should multiply the size you give kmalloc with sizeof(uint64_t)

cinder plinth
#

why are you writing 8 bytes at once

surreal path
#

oh i just realized why

surreal path
#

my bad

#

lol

#

buffer overflow like usual lmao

#

3bugs related to buffer overflows

#

how funny

broken depot
surreal path
#

works now

broken depot
#

Very cool

cinder plinth
#

I'd just make it uint8_t*

#

makes more sense

#

or char*

surreal path
#

its a generic impl

cinder plinth
#

yes

#

you want bytes

#

not 8 bytes

surreal path
#

maybe some hardware wants a ring buffer that uses 8 bytes idfk

#

maybe in the future

broken depot
#

Then use the uint8_t * for the pointer

tender gorge
surreal path
broken depot
#

lol

tender gorge
surreal path
tender gorge
coral dove
#

We love you nyaux you’re the goat

broken depot
#

Screenshot 'cus no nitror

cinder plinth
#

it's on this server

#

lol

coral dove
broken depot
#

fixed

tender gorge
surreal path
#

anyways my tty will look like this

struct tty_device {
  
}
struct tty {
  struct line_disclpine *cur_disclpine;
  struct ring_buf *tx;
  struct ring_buf *rx;
  struct tty_device *device;
}

// and then my tty would impl dev fs ops
void tty_install_device(struct tty *tty, struct tty_device *device);
void tty_install_linedisclpine(struct tty *tty, struct line_disclpine *loc);
#

sorry i cant spell

#

😭

#

is this a good way of doing things

#

its very similar to how linux does it

tender gorge
#

idk its been a while since ive looked at stuff like this

surreal path
#

devfs has to be refactored

#

its broken

#

fixed

surreal path
#

still refactoring

surreal path
#

how would i go about implementing sys_isatty

#

im a little confused on how to do that

#

this is all i have

edgy pilot
surreal path
#

like that

#

@edgy pilot

edgy pilot
#

is your code on github

surreal path
#

yes

edgy pilot
surreal path
#

how will i get that tho

edgy pilot
#

it's your code

surreal path
#

whats the best way to approach this i mean

edgy pilot
#

store it somewhere accessible

#

your fds contain pointer to a vnode

surreal path
#

yes

edgy pilot
surreal path
#

but not all vnodes are dev devices

edgy pilot
#

not description

surreal path
edgy pilot
edgy pilot
surreal path
#

reload ur page

#

i just pushed upstream

surreal path
edgy pilot
#

and that data contains a pointer to major and minor ids

surreal path
#

i cant just blindly assume data is a devfsnode

edgy pilot
#

check?

surreal path
#

how so

edgy pilot
#

bro

#

have some resource struct that all others are based on

surreal path
#

wait ik what to do

surreal path
#

bro what

#

hnd node is null???

#

i fixed it in tty init tho???

edgy pilot
#

do you write code without testing it 😭 😭

surreal path
#

wdym

#

i didnt write shit for tty

#

im just testing shit

#

again and again

flat nymph
#

I just spam asserts

surreal path
#

I FUCKING DO SET THE NODE

edgy pilot
surreal path
#

bro

edgy pilot
#

are you sure your os is not managarm?

surreal path
flat nymph
#

I have separate assert and panic

edgy pilot
#

lol

edgy pilot
#

good luck though

surreal path
#

bru

flat nymph
#

asserts are good

flat nymph
#

Btw, Nyaux for RISC-V when angr

surreal path
#

soon

#

™️

flat nymph
#

My kernel quality has increased a lot after porting to it

broken depot
rich trellis
#

just make a cpu emulation that runs the os and port it to all platformstrl

rich trellis
#

just emulate x86 on risc-v

#

you skip the step of making the cpu

surreal path
broken depot
rich trellis
#

my os probably will not have a vfs

#

im too dumb for that stuff

kind root
#

vfs is literally an abstraction layer for an fs

#

nothing complex about it

surreal path
#

thats lit my tty atm 💀

broken depot
#

Now it's my turn to fix my scheduler and implement TTYs I guess

#

What a funny coincidence we had the same next things on our TODO lists

surreal path
#

indeed

flat nymph
#

@kind root does Ultra kernel only work on x86?

kind root
#

which one

#

the new one supports aarch64 as well

#

although im thinking of dropping that

flat nymph
#

Why

kind root
#

i dont want to support crapberry pi etc

#

drop until they have a proper standardized platform

flat nymph
#

There are other SBCs with EDK

kind root
#

yeah but ya know

flat nymph
#

So like you only support x86?

kind root
#

anyway arm is not a priority, the new ultra will be focused on hardware support, primarily gpus probably

#

my goal is to run some cool game in 3d accel on a real laptop

#

with cp'ed linux userland apps

flat nymph
#

With your own GPU protocol you said?

kind root
#

protocol?

flat nymph
#

Or uDRM lives?

flat nymph
kind root
#

i will have full linux abi compat, so no its drm

kind root
flat nymph
#

But it's part of uAPI

kind root
#

u can say uAPI is deprecated

#

iirc marvin agrees that its not that great

surreal path
unkempt relic
#

there is no royal road to the bash prompt, and only those who do not dread the fatiguing climb of its steep paths have a chance of gaining its luminous summit

#

nyaux is on its way up

surreal path
#

bash prompt

unkempt relic
surreal path
surreal path
brisk zenith
#

yo nice

kind root
surreal path
surreal path
edgy pilot
#

nice

#

ls-5.2????

surreal path
#

🤷

#

i won tho

edgy pilot
#

🥇

#

here's your prize

broken depot
tender gorge
supple robin
desert haven
surreal path
#

it should work

surreal path
#

been fixing more vfs bugs

silver yarrow
#

how do u free vnodes

#

u refcount em?

surreal path
#

no

#

not atm

edgy pilot
silver yarrow
#

lmao

#

I just re-implemented my scuffed vfs from elysium5

#

I need to properly do ref counting this time

#

: )

#

not looking forward to that

edgy pilot
#

that's what I said before rewrite

#

I still don't have it

silver yarrow
#

lmaoo

#

well

edgy pilot
#

it's on my todo list

silver yarrow
#

I a not moving on before I do this

#

My main concern tbh is string ownership in my kernel

#

like I kind of pass around strings randomly

#

and uhh, it's very possible they just get freed when I start dropping vnodes and their associated data

edgy pilot
#

especially with smart pointers

#

I can just do vnode.reset() and everything is freed

#

(if there are no other references to member shared pointers)

#

I still need refcount for other things

silver yarrow
#

like how do u deal with that

edgy pilot
surreal path
#

solved vfs bugs

edgy pilot
#

and the resource is freed once both vnodes are freed (refcount == 0)

surreal path
#

with some hacks and work arounds

silver yarrow
#

i am just planning on saying "u can only use this data as long as u keep the ref to the associated vnode" but that completely depends on me making sure that is followed

surreal path
#

bash with readline and ncurses @thorn bramble

edgy pilot
#

why does it say ls-5.2

surreal path
#

i dont know why

#

lol

thorn bramble
#

holy poggers

snow wolf
# silver yarrow My main concern tbh is string ownership in my kernel

a model I find quite nice is that the underlying storage of a namecache name is refcounted and immutable. for e.g. rename, you want some namecache entry to adopt the name of some other entry, so you decrement the refcount of the old one (and free it if it reaches zero), increment the refcount of the name you are adopting, and store the pointer to the new name in the namecache entry.

thorny glen
#

i got refcounted interned strings

snow wolf
#

passing namecache entries to underlying filesystem functions can also be nice. e.g. lookup(inode *dir, namecache_entry *dirent);

snow wolf
thorny glen
#

generally speaking if i have some long term string storage ill look it up in a hash table of interned strings and only allocate new space if i cant find it in there already

#

name cache node names, thread names, process names, etc

surreal path
#

working on the tty still

#

implementing tcsetattr

surreal path
#

bash still wants to exit?

#

i even implemented dup

surreal path
#

now with tty reading

orchid dawn
#

Why is it ls-5.2 lol

surreal path
#

no idea

surreal path
#

fuck i need stat and i aint pulling anymore shit from fucking mlibc

#

i need to

#

include mlibc headers

#

somehow

#

no idea how to set that up

orchid dawn
surreal path
#

see if bash spins up

orchid dawn
#

let me know once you've got a build for the Wii trl

orchid dawn
#

jk

#

chuck me a build
I can try it on some shit later

surreal path
#

here ya go

surreal path
#

i got the tty to accept input from serial

#

and it works with bash

#

bash has no idea who i am rn

surreal path
#

now i need fork()

tender gorge
kind root
median goblet
#

what brought you to do something like that?

flat nymph
orchid dawn
#

lol

brisk zenith
surreal path
#

i want to put a rope on myself

ebon needle
surreal path
#

cause i hate being alive

ebon needle
#

and why you hate being alive

tender gorge
#

🥺

ebon needle
bleak cedar
#

please don't 🥺

surreal path
#

if i fail this attempt i swear to god ima js figure out a way to buy a bullet in ireland then 3d print a weapon to shoot myself

bleak cedar
#

please

#

please

#

don't

#

🥺

bleak cedar
#

someone

#

do something

ebon needle
#

@surreal path what are you trying to do

bleak cedar
#

@surreal path

#

please

#

answer

tender gorge
#

@surreal path

bleak cedar
#

@surreal path I promise, I wanted to install a older version of Python to compile ICU 69 today

#

Did someone call any emergency services?

hexed sluice
#

@surreal path hey?

#

you good mate?

ionic musk
#

That's pretty worrying

bleak cedar
tender gorge
ionic musk
#

How do you call them if you're not from Ireland?

tender gorge
bleak cedar
#

110

#

112 can't do anything

ionic musk
#

You can have them redirect you to another emergency service in another EU country?

tender gorge
#

Yes

bleak cedar
#

ok, police is coming to me

tender gorge
bleak cedar
#

yes, they want to check the message themself

tender gorge
#

Ah ok

hexed sluice
#

authorities have been contacted, by multiple people, this thread will be locked and left here as evidence

#

nyaux has been banned as to comply with Discord ToS. I don't personally like it but that's what the law of the land is

#

messages won't be deleted because they are evidence

hexed sluice
#

as an update, from what we know, Nyaux is now safe and in police custody

hexed sluice
#

if you people want to talk to Nyaux, he is on the OSDev matrix space #osdev:matrix.org

hexed sluice
#

@surreal path

surreal path
#

okay so UPDATE to everyone here, nyaux has reached bash since a while ago as we know. ive implemented fork() a shitty implementation but it works and now im implementing sys exit properly

#

after sys exit will be sys exceve

#

we ballin

#

honestly probs waitpid

#

before sys exceve

thorn bramble
#

go go goooo

#

year of nyaux desktop

kind root
#

welcome back

flat nymph
#

letsgo osdev server is saved

magic kernel
#

@surreal path welcome back

surreal path
#

thanks :)

#

bro wtf

#

EXIT THE LOOP 😭

flat nymph
#

Circular lists?

surreal path
#

the fucking operator lol

#

😭

#

solved it

rigid fable
#

DAJE ROMA DAJE 💪

hexed sluice
alpine mulch
#

trallalino trallala

#

porco dio e porco allah

surreal path
#

chat what are we saying

hexed sluice
#

dw about it

surreal path
#

oki

rigid fable
surreal path
#

lets fucking go

rigid fable
hexed sluice
#

i apologise on streaks's behalf

#

he's Spanish and doesn't know what the fuck he's saying

rigid fable
#

😔

alpine mulch
#

I am literally quoting a video of an AI generated shark with sneakers

rigid fable
#

🤷‍♂️

#

}

alpine mulch
#

}

surreal path
#

e

#

:)

rigid fable
rigid fable
#

Very gud

surreal path
#

looks complicated

#

how do i tell mr thread x "hey ur child process died"

tender gorge
#

aka implement posix signals

#

aka have fun :3

surreal path
#

so waitpid needs signals

tender gorge
#

the signal is SIGCHILD

surreal path
#

poop

tender gorge
#

oh youre talking about the waitpid syscall

surreal path
#

yes

tender gorge
#

no that does not need signals

rigid fable
surreal path
#

then how is the thread told

#

its child process died or its child process is alive idk what bash wants

#

lol

tender gorge
#

waitpid waits for the process with the PID to exit

#

how exactly you implement that in your kernel is not something posix cares too much about iirc

surreal path
#

what would be the best way to implement that

#

most simple

#

dimple way

tender gorge
tender gorge
#

which is also i think what posix wants?

surreal path
#

where is it stored

tender gorge
#

as in, if you never wait() a process, it will stay alive as a zombie process (which linux reports correctly as a zombie)

surreal path
#

yes it is in state zombie

#

but where is the process stored

#

it has no more connected to no threads

tender gorge
#

with the other processes

surreal path
#

all its threads are dead

tender gorge
#

it still exists as a process though until it has been waited on

surreal path
tender gorge
surreal path
tender gorge
#

i think

#

probably best to ask korona/qwinci/oberrow on that, i have never gotten past very simply TTY stuff halfmemeright

#

so uhh, i dont really know here

surreal path
#

because that would be the easiest approach

alpine mulch
#

processes and threads are necessarily stored separately

#

unless you are linux and threads are processes

#

you cannot have a thread process separation and have emergent processes as info only stored on threads

surreal path
#

then i shall store a list of processes

#

in the cpu local struct

alpine mulch
surreal path
#

yes they have ptrs

#

to their process

surreal path
#

js a linked list

#

of processes

#

what ill doo

orchid dawn
#

holy shit nyaux is back

#

🔥

rich trellis
#

hell yeah nyaux back

surreal path
#

its scuffed but waitpid is implemented

#

no blocking tho

#

inefficent as shit

broken depot
#

@rigid fable }}}}}}}}

broken depot
surreal path
#

idk if bash is suppsoed to not return to prompt or whatever

rigid fable
frigid cliff
#

yippee nyaux is back

tardy hull
#

welcom backkkkk

surreal path
#

im eepy

tardy hull
ebon needle
tardy hull
#

i am trying to figure out how to build but idk -_-

#

help -v-

coral dove
tardy hull
#

The kernel, I tried doing make but it didn't work and said that cc-runtime git something

surreal path
#

died here

#

it seems

surreal path
#

execve works without deallocate_all_user_regions() but does this if i do

#
void deallocate_all_user_regions(pagemap *target) {
  VMMRegion *cur = (VMMRegion *)target->userhead;
  while (cur != NULL) {
    if (cur->nocopy) {
      cur = (VMMRegion *)cur->next;
      continue;
    }
    kprintf_vmmregion(cur);
    arch_unmap_vmm_region(target, cur->base, cur->length);
    slabfree(cur);

    cur = (VMMRegion *)cur->next;
  }
}
#

thats lit it

surreal path
#

heres where we are atm

#

execve is implemented and working

#

however ncurses is being a piss of poop

#

and not finding our terminfo even tho everything i provide to it is correct?

broken depot
surreal path
#

i gave it tho

broken depot
#

Then i dunno

surreal path
surreal path
#

?

broken depot
#

If you'd asked maybe 30 minutes earlier I could help debug but I'm literally just finishing up so I can go to bed.

surreal path
#

ah oki

#

then goodnight

broken depot
#

Good luck :3

surreal path
#

nyaux after trying to open bash after implementing stat mode correctly

#

my stack pointers fucked

#

???

rigid fable
surreal path
#

bro

#

nah

rigid fable
#

I'm sorry I had to. I won't do it again

surreal path
#

no no its fine

#

lol

rigid fable
#

😅😂

ebon needle
#

are you upgrading

edgy pilot
ebon needle
edgy pilot
ebon needle
edgy pilot
ebon needle
edgy pilot
#

no

ebon needle
#

do you accept bribes???

#

i dont want to go to jail

edgy pilot
kind root
#

still wrong after the edit btw

surreal path
#

in order to debug further

#

i need to figure out why is ncurses getting its shit stripped

#

so i can load it in

#

and view whats up

#

idk whos stripping this shit

#

but i need those debug symbols

#

i know it crashes in that file

surreal path
#

lets go we got more info

cinder plinth
#

I'm not sure why you're debugging ncurses, this is like 99% a kernel or libc issue

surreal path
cinder plinth
#

do you trace syscalls

surreal path
#

yes

cinder plinth
#

do that

surreal path
#

i already do that

#

the last syscall is syscall_close

cinder plinth
#

is that expected

#

or did you return an error code

surreal path
#

i didnt return an error code

#

it was valid

#

it stated the fiel

#

i gave the file stat

#

structure

#

and it closed

cinder plinth
#

and then it hangs?

surreal path
#

then it page faults on orq 0x0,(%rsp)

cinder plinth
#

so your stack is fucked?

surreal path
#

yep

cinder plinth
#

how big is it

surreal path
#

i think it dies here

surreal path
#

16kib

brisk zenith
#

that looks like a stack probe

surreal path
brisk zenith
#

does rsp look correct? if so you probably just need to increase your userspace stack size

surreal path
#

disassembly

#

no it doesnt

#

rsp looks fucked

brisk zenith
#

I mean it's low but it doesn't look obviously wrong

#

maybe it's just at the bottom of its stack

surreal path
#

yea the stack is 0x1000

#

i think its running out of stack

#

u could be right

brisk zenith
#

looks like it yeah

surreal path
#

korona said its plassuible

brisk zenith
#

userspace generally expects a stack region of like a few megabytes

surreal path
#

okay i gave it double

#

giving it more stack didnt solve it

kind root
#

8k is still nothing

brisk zenith
#

is rsp still near the bottom of the stack?

#

try giving it like 8 megabytes or something I think that's linux's default

surreal path
#

i gave it 32768

#

bytes

supple robin
#

give it a megabyte

#

don't be shy

kind root
#

does nyaux have on demand memory allocation

surreal path
#

no

supple robin
#

no

kind root
#

bruh

edgy pilot
supple robin
#

i give 2mib

surreal path
#

it solved it

#

i gave it 1 mib and it solved it

#

lol

#

we got closer

cinder plinth
#

ah no way! I was right meme

surreal path
#

heres whats next for nyaux

#

Nyaux Next Milestone: Run Doom

  • support x2apic and ps2 driver
  • implement more syscalls like access()
  • posix signals
  • devfb
  • dev mouse
  • dev keyboard
  • profit???
hollow goblet
#

Nyaux PS/2 driver

cinder plinth
#

it's piss easy

#

just get keyboard input working

glossy walrus
#

low effort troll

surreal path
#

oh yeah @kind root i havent updated uacpi in a while lmao

#

i should do that

#

@edgy pilot any updates on the flanterm fork i should pull?

kind root
#

yeah there have been a few fixes since

surreal path
#

also btw

#

opinion on tic running?

#

in bash

#

infocmp also runs and same with zdump

#

but no signals

#

actually mostly everything runs expect for this one program but its to be expected cause no access()

kind root
#

tic?

surreal path
kind root
#

dunno what that is

#

but LETSFUCKINGGOOOOOO

surreal path
#

bash programs run

surreal path
#

my waitpid is bugged

#

as well

#

this is pain

edgy pilot
#

have you considered sleeping?

surreal path
#

i cant

edgy pilot
#

tired brain can't really think

#

just laying down is good enough

#

lying

#

Idk

surreal path
#

i cant

edgy pilot
#

you still rest that way

#

why can't you?

surreal path
#

idk

edgy pilot
#

it's easy: you get to a bed and put yourself in a horizontal position, optionally put a blanket over yourself

surreal path
#

cant

edgy pilot
#

president trump says: falsch

#

there are some things you still need to try and do, however pointless they must seem

#

While sleep is only for the weak, it's still important

#

not even sleeping, just resting

#

you might feel like you don't deserve it or you should feel worse or something, but think about it

#

is it really logical?

#

what would spock say?

#

🖖

#

In other news, it's 6 am here