#Nyaux

1 messages Β· Page 49 of 1

coral dove
#

int main(); seems more like a variable declaration than anything

broken depot
#

Most often it's either returning () (a size-less single-state type) or a Result

coral dove
#

Result? Is that its own data type ?

#

Or is that kinda just the equivalent of an error code in a C function like return -1;

broken depot
#

Result is a generic type with two parameters. It stores either an Ok or an Err value and is the de facto way to deal with functions that can return exceptionally.

coral dove
#

Pov rust actually has error codes that makes sense

broken depot
#

There's this really nice ? syntax that returns the result if it's Err or unwraps Ok

coral dove
#

Kinda like a case switch in C?

#

Like is it the same concept

broken depot
#

That's the underlying mechanism.

coral dove
#

Smart

broken depot
#

Let's move to #programming

coral dove
#

Bet

cinder plinth
#

perfectly

#

ah yes

#

totally no soundness issues anywhere

thorn bramble
#

rusties when they find out that rust is, in fact, not memory safe

broken depot
supple robin
broken depot
#

There's a lot of things you could criticise Rust for but being memory-unsafe is not one of them.

supple robin
#

eh

#

rust isn't 100% memory safe

#

there are a few situations where it fails

#

and im not talking about leaks

broken depot
#

I'm sorry but if you're going to say the language about memory safety is memory-unsafe, you're going to have to provide actual proof.

supple robin
#

have you heard about lifetime expansion

broken depot
#

ofc

supple robin
#

you probably also know cve-rs then

broken depot
#

no

supple robin
#

enjoy

broken depot
#

Those are bugs

#

And you need to really intentionally do it wrong to get bitten in the ass by it

supple robin
#

call it a bug, it's still unsound

broken depot
#

The author literally calls them bugs

supple robin
#

so? this does not invalidate our argument

#

as long as this isn't fixed, rust isn't 100% memory safe

broken depot
#

You were making it sound way worse than it is

supple robin
#

i don't think so

supple robin
supple robin
#

that's... not me?

#

lol

#

in the end it doesn't matter though, because even 1% safety is better than 0

#

these are nitpicks

broken depot
#

Most of it seems to be based around an ability to create dangling pointers

#

Whatever. In the end, both C and C++ let you do this without so much as a single instruction of UB emitted whereas this is entirely because of compiler bugs and is probably classified as UB

#

(the part after you get the dangling pointer, that is)

hollow goblet
#

just.. wrong

supple robin
#

that's not at all what it's like

hollow goblet
#

it is tho?

supple robin
#

no

spice yarrow
#

What's the difference?

hollow goblet
#

soundness holes are bugs, and not being compliant would be a bug

#

something to be discovered and fixed

spice yarrow
#

gcc claims to be c compliant, rust claims to be memory safe
and they both are mostly true, barring a few rare bugs

hollow goblet
#

and the argument around unsafe is just wrong too, unsafe doesn't mean unsafe

#

unsafe means "I checked this myself, trust me"

supple robin
hollow goblet
#

yea just generally pointing around

supple robin
#

in my experience, unsafe also carries around the heavy weight of a lot of UB

hollow goblet
#

if unsafe existing makes rust code not memory safe, by analogy ALL C code has to be not memory safe because even well written C code is in an "unsafe context"

brisk zenith
#

imo there's a difference between a language being unsafe and an implementation of that language being unsafe. to my knowledge, rust the language is safe, because a theoretical implementation without bugs would have no soundness holes. the reference implementation of rust isn't safe, because it has soundness holes due to bugs

supple robin
hollow goblet
hollow goblet
#

rust has had different algorithms for the borrowck, each one increasing the scope of allowed code

supple robin
#

i do wish rust had a stable abi

spice yarrow
#

Rust will reject some valid programs, and all* invalid programs
C will accept some invalid programs, and all valid programs

spice yarrow
hollow goblet
supple robin
#

and rust dylibs

spice yarrow
#

Oh yeah precompiled libs would be really nice

hollow goblet
brisk zenith
hollow goblet
spice yarrow
#

But imo it should only be stabilized to the rustc version

supple robin
#

wut

hollow goblet
#

it should be stabilised to rust 2024/2027 whatever

#

not rustc

supple robin
#

2024 please

spice yarrow
hollow goblet
#

but 2024 is already a thing lol

supple robin
#

shit

#

oh true im dumb

#

we're in 2025

spice yarrow
#

I mean they did just release it a few days ago

hollow goblet
supple robin
#

this

spice yarrow
#

Yeah it was stabilized in nightly last year

hollow goblet
#

to make dylibs forwards-compatible

supple robin
#

stable
nightly

spice yarrow
#

pseudo stabilized? I'm not fully sure on what it was exactly

hollow goblet
#

idk what they did but even if there's no spec they could start by freezing it in rustc

#

like a soft forwards-compatibility guarantee

#

but not actually a guarantee

#

just attempting

#

wait this is nyaux thread

bleak cedar
#

talking about unrelated compiler bugs in Nyaux shall be punsihed

tender gorge
#

keep the chat somewhat nyaux related πŸ₯Ί

ionic musk
#

Nyauxmaster C compiler when?

broken depot
#

Nyaux (Kompiles C)

bleak cedar
#

Nyauc

broken depot
#

NyauxCC

coral dove
#

We love you nyaux if you make a c compiler I will never use another ever again

rich trellis
#

ncc (nyaux c compiler)

bleak cedar
#

> gcc

broken depot
#

ncc (Nyaux Compiler Collection) is better than gcc (GNU (is Not Unix) Compiler Collection)

spice yarrow
#

ncc (Nyaux Compiler Collection) is better than gcc (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU error recursion limit reached

broken depot
#
fn gnu() {
  println!("GNU (");
  gnu();
  println!(" is Not Unix)");
}
fn main() {
  println!("ncc (Nyaux Compiler Collection)");
  println!(" is better than ");
  println!("gcc (");
  gnu();
  println!("Compiler Collection)");
}
spice yarrow
#

;compile ```rs
fn gnu() {
print!("GNU (");
gnu();
print!(" is Not Unix)");
}
fn main() {
print!("ncc (Nyaux Compiler Collection)");
print!(" is better than ");
print!("gcc (");
gnu();
print!("Compiler Collection)");
}

viscid pecanBOT
#
Program Output
ncc (Nyaux Compiler Collection) is better than gcc (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU (GNU
Compiler Output
warning: function cannot return without recursing
 --> <source>:1:1
  |
1 | fn gnu() {
  | ^^^^^^^^ cannot return without recursing
2 |   print!("GNU (");
3 |   gnu();
  |   ----- recursive call site
  |
  = help: a ​`loop​` may express intention better if this is on purpose
  = note: ​`#[warn(unconditional_recursion)]​` on by default

warning: 1 warning emitted
broken depot
rigid fable
#

Also I'm pretty sure the recursion would go something like
GNU is Not Unix is Not Unix is not Unix is not Unix is not Unix is not Unix is not Unix is not Unix

hollow goblet
#

it would assuming you can see the entirety of the infinite length string

#

wait no

#

this isn't just opening the acronym

#

it's GNU (GNU is Not Unix) is Not Unix in this case

#

but if you just evaled GNU itself

#

it would be GNU is Not Unix is Not Unix

spice yarrow
rigid fable
#

Anyways, Nyaux stay safe, we hope we'll seeing you soon 🫑
}

tender gorge
#

sending hugs rayan πŸ«‚ πŸ’™

hollow goblet
#

virtual hug πŸ«‚

spice yarrow
ebon needle
#

nyaux how are you

tender gorge
#

we are still thinking of you nyaux πŸ’™

bleak cedar
#

myaux

tardy hull
#

i eat cement, also nyaux is awesome

#

gives me motivation

bleak cedar
#

which of those 2?

tardy hull
#

both >:3

surreal path
#

im still here

#

very hard to get horus out

#

i dont even have

#

a few minutes

#

i hate this place

#

tomorrow they are making a ddecesion

#

if im staying here long term or not

#

we will see

#

i missed yall tho

broken depot
#

Sending virtual hugs and well wishes

surreal path
#

thank you

#

oh yeah @hexed sluice i just wanna say has limine updated significatnly for the time ive been gone? i cant rlly check github is blocked

broken depot
#

Not in a way that'll break anything. The last major update was before you went in.

surreal path
#

ah okay

#

thanks

broken depot
#

Looks like some new stuff is happening for a 9.x branch some time in the future?

surreal path
#

cnat wait for that

#

love you all

#

soon ill be back i hope

#

when they getr my meds working

#

they will probs let me out

hexed sluice
surreal path
#

thanks for letting me know tho

hexed sluice
#

damn why would they block github, that's weird

#

also i am glad you're alright

tender gorge
surreal path
#

cause u can upload files onto github

tender gorge
#

dont lie to try and get out or anything

surreal path
#

i tell them the meds arent working

tender gorge
#

ok

#

πŸ«‚ πŸ’™

surreal path
#

πŸ«‚

#

have to go

tender gorge
#

itll be alright

#

cya!

surreal path
#

love ylal cya soon\

hexed sluice
#

cya

tender gorge
#

love you too πŸ’™

odd flame
#

nyaux yet again

#

been so long since i came to this server

broken depot
bleak cedar
#

cya πŸ₯Ί

rigid fable
#

Yup, we're still waiting for you 🫑
}

coral dove
#

We Miss you bro

#

Hope you’re doing okay

steady flume
#

can't wait to post that one lotr gif

flat nymph
#

This server is a bit sad without nyauxmaster

broken depot
#

Nyaux is our GOAT

bleak cedar
#

I'll download CS2 on my new distro just for Nyaux

surreal path
#

i have a discharge date

#

13th of march

#

@hexed sluice @flat nymph @tender gorge (cant ping more cause bot will ban me or smt but im so excited to say this i needed to ping yall)

ebon needle
hexed sluice
#

yay

broken depot
#

I just realized that Nyaux is also a fellow computer graphics enjoyer

surreal path
#

i dabble in it sometimes

#

:)\

#

also

#

as soon as i come back

#

straight to nyaux work

broken depot
#

Is 2025 the year of the Nyaux desktop? trl

surreal path
#

yes real

ebon needle
#

NyauxDE

broken depot
#

Nyaux windowing protocol

surreal path
#

omg reall

thorn bramble
#

holy shit LFG

kind root
tender gorge
coral dove
flat nymph
rich trellis
magic kernel
#

let's fucking goooooooo

ionic musk
#

Do you feel better and will you continue getting support?

frigid cliff
plush hearth
rigid fable
hollow goblet
#

nyaux letsgo

supple robin
#

lfg

steady flume
#

LFG

rigid fable
#

Chat we're about a week away from the great return letsgo
}

kind root
#

Hmm does nyaux log gdt/idt init... Ok I dont remember

#

Yes LETSFUCKINGGOOOOOO

thorn bramble
#

nope he doesn’t

kind root
#

Well the old version did anyway

thorn bramble
#

NEVERMIND I AM BLIND

ionic musk
thorn bramble
#

right there

kind root
#

Nice

thorn bramble
ionic musk
#

Ah good

kind root
#

No loading indicators which sucks

ionic musk
#

Make a PR so it prints out every GDT entry

kind root
#

Spinning / with percentages

ionic musk
#

printf("loading gdt...");
sleep(1000);
printf("gdt loaded");

coral dove
silver yarrow
#

I print out gdt loaded for every CPU

#

but tbh that is a relic from some debugging session

flat nymph
marble surge
marble surge
#

Aren't you supposed to enable GDT first before handling interrupts?

ebon needle
tardy hull
#

i eat cement

flat nymph
#

I've just realized Nyaux thread still has more messages than lounge 2 aka uACPI thread

surreal path
#

hi

#

i get night leave today

#

but im too sleepy to talk on disc rn

#

i love yall btw

#

@kind root i will make cpu init ok imagine

#

registers init ok

orchid dawn
#

RAM Init.... ok

broken depot
#

Program counter init... OK

edgy pilot
tender gorge
#

dont do anything stupid πŸ₯Ί

frigid cliff
surreal path
tender gorge
#

itll be alright ^^

thorn bramble
bleak cedar
#

hiiii :3

coral dove
broken depot
coral dove
steady flume
#

LET'S GOOOOOO

rich trellis
surreal path
surreal path
surreal path
#

bro*

surreal path
#

currently js tryna get used to being home if yk what i meann

tender gorge
#

Stay safe ^^

surreal path
#

i will hug

kind root
#

What's next on the nyaux list

surreal path
#

well

#

i need to relearn a lot of things

#

1st

#

2nd i need to finish devfs

#

and 3rd idk its hard to focus cause of one of ze meds im waiting to get taken off of

#

well we will see anyways how things go

kind root
#
  1. Uacpi update trl
surreal path
#

oh yes 100%

silver yarrow
#
  1. marketing, success, money
surreal path
#

real trl

broken depot
#
  1. monopoly on the OS market
thorn bramble
#

yooo nyaux welcome back :’)

steady flume
hollow goblet
#

year of the nyaux desktop

orchid dawn
#

nah nah, nyaux is gonna corner every market segment

#

not just the year of the nyaux desktop

#

but the year of the nyaux laptop, the nyaux tablet, the nyaux phone, the nyaux smart watch, the nyaux alarm clock, the nyaux thermostat, the nyaux smart tv, and finally, the nyaux server

#

oh yeah I forgot, also the nyaux game console

#

the Switch 2, Xbox One.5, and PS6, will all be running nyaux

tender gorge
#

when can i eat nyaux branded food

surreal path
#

devfs is finished?

#

i thought it wasnt but it seems like past me wrote all the code for me

#

@kind root any breaking changes with uacpi?

#

the one in nyaux vs the one rn

surreal path
#

It has been WAY too long

#

but past me wrote pretty much everything

#

this is not epic

#

nvm

#

changes are not needed

#

compiles just fine

edgy pilot
#

does it link though?

surreal path
#

yep

#

ran and all

#

no issues

edgy pilot
#

maybe your commit wasn't that old

broken depot
surreal path
#

for me at least

#

maybe i was on a bleeding edge branch idfk

#

but it ran fine no changes required

broken depot
#

There was also discussion about C standard library things that uACPI needs (e.g. <string.h> stuff), it's also possible that some details were changed there.

surreal path
#

it seems that nyaux is not affected

broken depot
#

Very cool

surreal path
#

oh i see why

#

im on

#

yes

#

latest commit

#

:)

#

🌞

#

😎

#

everything is commited

thorn bramble
#

we are SO BACK πŸ”₯

surreal path
#

indeed we are

thorn bramble
#

im ngl i might just contribute to nyaux instead of trying to make my own shit

#

i never succeed lol

surreal path
#

u shoulddd contribute

#

i would really appreciate that

#

:)

thorn bramble
#

nyaux has blocking mutexes before me

#

that is crazy

surreal path
#

it does actually

thorn bramble
#

i know i just read the code

surreal path
#

but they work 96% of the time ℒ️

thorn bramble
#

wtf

surreal path
#

yea idk why

#

but idc

#

nyaux quirk ig ℒ️

surreal path
#

i updated uacpi anyway

#

hopefully thats cool to you

kind root
#

basically by default uacpi now defaults to expecting the host to implement mem{cmp,move,cpy} etc

surreal path
#

yea i do

kind root
surreal path
surreal path
#

i wanna make a kind of debug tool thing for the kernel

#

like

#

u can list everything from page mappings to

#

current threads running to

#

printing whats mounted on the vfs and et

#

c

silver yarrow
#

I can sense a kernel terminal

kind root
#

if strcmp("ls") print("file.txt") trl

silver yarrow
#

yeaaaaap

#

if strcmp else if strcmp else if strcmp else if strcmp

surreal path
#

it wont

#

i hate c for this

thorn bramble
#

lol

#

[ -> {, ] -> }

surreal path
#

thanks

#

you know what we need

#

a dev device

#

and actually

#

we need

surreal path
#

debug shell done

surreal path
#

its actually

#

decent this time

#
void rsh()
{
    char buf[256];
    int idx = 0;
    kprintf("(rsh): ");
    inb(0x3F8);
    while (true)
    {
        if (serial_data_ready())
        {
            char got = (char)inb(0x3F8);
            if (got == 127 && idx > 0)
            {
                kprintf("\b \b");

                buf[idx] = '\0';
                idx--;
            }
            else if (got == '\r')
            {
                kprintf("\r\n");
                buf[idx] = '\0';

                for (int i = 0; i != 4; i++)
                {
                    if (strcmp(buf, cmds[i]) == 0)
                    {
                        switch (i)
                        {
                            case 0: goto t; break;
                            default:
                                kprintf("commands to do are stubs:c\r\n");
                                kprintf("(rsh): ");
                                goto r;
                                break;
                        }
                    }
                }
                kprintf("not a valid command\r\n");
                kprintf("(rsh): ");
r:
                idx = 0;
                buf[idx] = '\0';
                // exit_thread();
                // break;
            }
            else if (got == 127)
            {
            }
            else
            {
                buf[idx] = got;

                kprintf("%c", got);
                idx++;
            }
        }
    }
t:
    // exit_thread();
}
#

too pro

#

lets fucking go

rich trellis
broken depot
#

A shell for debugging your kernel?

cinder plinth
#

Yea

#

It's not uncommon to have some kind of kernel debugger

broken depot
#

I thought everyone was just using QEMU + GDB

cinder plinth
#

how do you debug on real hardware then

broken depot
#

Fair enough actually

cinder plinth
#

or dump kernel structures

broken depot
#

Yeah because otherwise you need a hardware debugger

#

Which does exist but it harder to set up and usually requires a pricy attachment

cinder plinth
#

You can debug via gdb over serial too

#

But the kernel knows more about itself than gdb so it can print useful info

tender gorge
#

wouldnt be surprised if most laptops dont have a way to debug on hardware properly lol

broken depot
#

Fortunately devkits do tend to have that meme

hollow goblet
#

and make your host connect to it over serial

#

nyauxdb when

surreal path
#

id rather not for now

#

its just nice to be able to print mappings

#

when needed ig

#

and other stuff

#

whats next for nyaux was updating uacpi but thats done

#

i feel so tired

#

i saw

#

its fine my bad

hollow goblet
#

if you want you could pick yourself a simple goal to achive in nyaux

surreal path
#

i just feel like empty cause depression no moticvation to even touch my computer, but

#

im trying my hardest

hollow goblet
#

pick something simple and start moving towards it, but don't pressure yourself

surreal path
#

thanks ik what u mean

hollow goblet
#

doesn't have to be nyaux

#

just life advice

surreal path
#

the goal isnt the issue

#

its just the depression is like an anchor im attached to

#

hard to do much

hollow goblet
#

then try something you know you will enjoy, sorry if this seems too clichΓ©. I remember a cgp grey video from the pandemic era i think. he says mental and physical health affect each other and it's always easier to improve your physical health which will get the ball rolling to start improving you mentally

#

I can link to the video if you want, he does a better explanation than me

surreal path
#

the thing is

#

nothing brings me joy anymore

#

if u get me

#

like ive tried everything

#

i just feel nothing but depression

#

its why i jumped into that river from that bridge

#

i feel hopeless

tender gorge
#

πŸ₯Ί

#

itll be alright πŸ«‚

surreal path
#

its okay tho im happy that yall are really supportive to me and im just hoping tuesday they change my meds to make me hopefully feel smt

edgy pilot
tender gorge
hollow goblet
cinder plinth
#

like nixstrap man said

edgy pilot
#

not for me

hollow goblet
#

YMMV, these stuff are always personal

tender gorge
cinder plinth
#

idk fucking rainbow emoji

hollow goblet
#

sanana lol

tender gorge
hollow goblet
#

lol electrode no need to defend me

tender gorge
#

sorry i just thought sending that would also be slightly funny

hollow goblet
#

it slightly is

cinder plinth
hollow goblet
#

idc unless it has a bad intent

edgy pilot
#

Both chad

hollow goblet
#

@surreal path update us often, ok?

edgy pilot
#

I don't think anyone here has a bad intent

supple robin
surreal path
#

letsgo

broken depot
#

very cool

#

Is this an ext2 driver?

surreal path
#

no tmpfs

broken depot
#

tmpfs as in ramfs?

surreal path
#

yea

broken depot
#

cool

#

I did that one first too

surreal path
#

mhm!

broken depot
#

What filesystems do you plan to support?

surreal path
#

ext2 100%

broken depot
#

Makes sense

#

BadgerOS already supports FAT (but will get ext2)

#

At this point it's mainly there to allow some kind of self-update in the future but originally it was because FAT is more widely supported.

#

ISO9660 (the CD-rom one) is also a potential one because of installation CD memes

edgy pilot
# surreal path yea

unless tmpfs is made in a french town named tmpfs (supports configurable options) it's just sparkling ramfs

broken depot
#

Anyway, just giving you some ideas :3 nice to see some Nyaux progress

surreal path
#

thanks :3

surreal path
#

dev only has one device lmao

broken depot
#

/dev/meow?

surreal path
#

no

#

/dev/null

broken depot
#

To be fair, BadgerOS doesn't even have a devfs yet so I'm in no place to criticize :P

surreal path
#

i need a hashmap of some kind nooo

#

code in userspace to test

frigid cliff
#

yippee

surreal path
#

hi zoe

#

yippiee

rich trellis
#

πŸ₯”

surreal path
#

hashbrown for C

edgy pilot
surreal path
#

letsgo

kind root
surreal path
#

fds are implemented

#

were tested in userspace, untested too much in kernel space with the modifications i made to the hashmap.c to support my sized free function

#

but

#

it should work and its per process as ud expect

surreal path
kind root
#

Bash

surreal path
#

real

#

now to get to bash

#

we need a few things

#

syscalls 10000%

kind root
#

Or dooom

surreal path
#

fpu saving and storing

kind root
#

Yes

surreal path
surreal path
#

mints list thing

kind root
#

Its just xsave and xrstor etc

surreal path
#

i can work on it i suppose

edgy pilot
#

you need to check what's supported with cpuid

surreal path
#

okay

kind root
#

Blindly assume avx512

surreal path
#

real

#

first things first tho

#

i want nyaux to load itself a bg

edgy pilot
#

bg?

#

background?

surreal path
#

mhm

#

just for fun

#

ill reinit the terminal setting the canvas as the bg

#

as well as a new font

frigid cliff
edgy pilot
kind root
#

Cant believe its not upstreamed yet

surreal path
#

actually before anything

#

im gonna setup a build system

coral dove
#

NyauxMake incoming

kind root
#

Nmake

surreal path
#

real

edgy pilot
#

nake?

surreal path
rich trellis
surreal path
#

we have a new bug atm kinda stuck but its good

#

im waiting til 6am so i can go buy smt to eat

flat nymph
#

Am I seeing C++ files? thonk

thorn bramble
#

that's was nyaux omitting the filename_prefix field of the tar entries

#

that file belongs somewhere in /usr/include/c++/...

ebon needle
kind root
thorn bramble
#

no, he tar'd the sysroot he built

kind root
#

ohh lol

rigid fable
#

Oh Nyaux is back?

#

}

rich trellis
rigid fable
#

GODO

#

DAJE ROMA πŸ’ͺ

#

}

surreal path
#

@thorn bramble its dying here

surreal path
#

chat wtf

worn rain
#

nvm, found it

surreal path
#

it was a use after freee

#

works now

#

:3

#

@edgy pilot

#

whats a sixel

broken depot
# surreal path whats a sixel

It's a terminal thing that uses 6 bits of each byte to set 6 pixels in the terminal. I don't recall whether it goes horizontal or vertical but it allows for 2-color bitmap graphics in a terminal emulator

edgy pilot
#

an image encoded with ascii characters

surreal path
rich trellis
#

i feel like that image represents my kernel 101%

#

none existant rn nooo

surreal path
#

so

#

with xsave and xrstor they store and save fpu state

#

im reading the sdm but im failing to understand how exactly to use the instructions

#

what am i supposed to do as a kernel for the cpu

#

etc etc

edgy pilot
desert haven
# surreal path what am i supposed to do as a kernel for the cpu

if you dont care about avx (256bit+ regs), you can use fxsave/fxrestore instructions, which take a fixed 512 byte buffer.
For xsave and friends, there's a new control register, xcr0 (extreme control register 0), that determines which extra bits of state are enabled. So there's a bits for enabling fpu regs, xmm/ymm/zmm regs (if supported) and some other state that you may care about. You set the bits you want to save/restore, and then do your save/restore op.
The size of the buffer needed depends on what state is enabled in xcr0 at that time, and a bitfield you pass to the xsave via a gpr. As for getting the size, check cpuid leaf 0xD. It'll give you 2 values: one is the size if everything in xcr0 is enabled, the other is the size for whats currently enabled.
If you want to do lazy switching of the extended state, there's cr0.TS which generates an #NM exception when set and someone tries to access any extended state. So you can catch that, switch the state, then clear the bit until you switch threads.

kind root
#

I voted for nyaux

surreal path
surreal path
#

fpu funny

#

:3

surreal path
#

i cannot find it

#

thanks god

surreal path
#

nyaux will support avx 512

#

😎

tender gorge
surreal path
#

okay ive inited the fpu

#

now do i need to check on ctx switch if im coming back and coming from userspace and if so run fpu save and fpu store

#

and

#

actually i wont worry about this JUST yet

#

the things for fpu is there, whenever im gonna go straight for userspace i shall remember to ask questions in relation with scheduling and fpu save and store

flat nymph
#

just steal it from proxima galaxybrain

surreal path
hexed sluice
#

lol

surreal path
broken depot
# surreal path

Very nice, have you seen what BadgerOS does on Kernel panic?

surreal path
#

what does it do

broken depot
#

This: #1153085124959809616 message

#

It's also inspired by obos iirc

#

Oh it was actually ilobilix where I got the idea

broken depot
surreal path
#

im trying to put a file in the tar bro

#

jinx hates me

#

hello???

#

its there

#

the sysroot doesnt change no matter what

#

i put in base files it doesnt care

#

./jinx rebuild base-files solved that

#

IT WORKED

#

loading a sixel from my vfs works

#

😎

worldly condor
#

nice work!

#

congrats!

tender gorge
#

πŸ«‚ πŸ’™

surreal path
#

hug πŸ’™

tender gorge
#

hug πŸ’™

surreal path
#

nyaux logo

tender gorge
#

nya~ ux :3

#

im sorry for having written that

surreal path
#

no dw nothing is wrong :3

desert haven
surreal path
#

i have a blood test today nooo

#

they gonna stick a needle in me

tender gorge
#

itll be alright πŸ₯Ί

surreal path
#

and how tf am i supposed to have syscalls without userspace and how tf am i supposed to have userspace without preparring a user thread with everything the sysv abi requires AND loading an elf

rigid fable
#

hurts when they put it in

surreal path
#

ik the experience

#

i get it every 2 weeks

rigid fable
#

ah

tender gorge
#

last time i had a blood test was a couple months ago i think

surreal path
tender gorge
molten grotto
#

why do you need syscalls without userspace

tender gorge
#

so when you call from ring 3 -> ring 0

#

that is a syscall

surreal path
#

without userspace

surreal path
#

the syscall instruction

#

and like yk what i mean

#

actual syscalls

molten grotto
#

for testing purposesℒ️ you could just have a piece of asm in your kernel that you enter to in usermode

tender gorge
#

spin up a really simple ring 3 thread or something to test it with

#

you dont need all of sys v abi

#

loading a ELF is also actually quite simple

edgy pilot
#

you don't even need an elf, simple flat binary will do the job

kind root
#

for testing u can just memcpy kernel code to userspace

#

this will work fine

#

just make a stub function

molten grotto
#

or map part of the kernel as user

#

kinda cursed but for testing its fine

surreal path
#

anyone got ze bytes of some asm code that does a syscall or smt

#

anyone wanna post ze raw bytes trl

edgy pilot
#

what kind of syscalls do you have

molten grotto
#

why not just write it yourself in an asm file lol

surreal path
#

not even a syscall file

edgy pilot
#

you need one first

surreal path
#

ik

edgy pilot
#

do int 0x80 or something

surreal path
#

no

#

syscall instruction fuck you trl

#

ive planned that from the start

#

anyway

surreal path
hexed sluice
#

i do that shit more often than i pee at this point

surreal path
#

when they start sucking in my vein

#

i hate that feeling sm

hexed sluice
#

i honestly don't mind

#

i kinda like it

#

maybe i'm just freaky like that

surreal path
#

they do it at like in the elboo

#

like the joint area but not the bone side

hexed sluice
#

yep

surreal path
#

i hate that area

#

most painful spot for me

surreal path
#

for me its like absolute torture

#

ur hella freaky ig lol

hexed sluice
#

i just kinda like bleeding

#

i am not saying that in an edgy way

#

i just kinda do

surreal path
#

ik what u mean

hexed sluice
#

i don't go out of my way to bleed of course

#

but like, sometimes i scratch too hard and i start bleeding

#

i kinda like the feeling

#

and getting blood drawn is kinda the same

surreal path
#

i cut my lip a lot, i like the pain and the blood ig from the lip but needles are a no for me

surreal path
#

ik what u mean thoo

edgy pilot
hexed sluice
#

i realised i hadn't starred this yet for some reason

surreal path
#

bru

tender gorge
#

same lol

surreal path
#

star this NOW

tender gorge
#

i have now stared it πŸ₯Ί

surreal path
#

number go up, dopamine go up funny

hexed sluice
#

i forgor, i probably had it starred but on old account

surreal path
#

yea fair

#

star the repo too trl

hexed sluice
#

yes i did

surreal path
tender gorge
surreal path
#

instant shamless plug

hexed sluice
#

done

surreal path
surreal path
#

ill impl syscalls myself just after bloods nooo

broken depot
#

KBELF has both x86 and RISC-V support and it supports dynamic linking

tender gorge
#

take care of yourself and your body pls πŸ«‚

surreal path
#

i will

surreal path
#

2 WHOLE 15 ml bottles bro

edgy pilot
#

you have 5 more litres

tender gorge
surreal path
#

we are close to 40 stars btw

tender gorge
#

nice NekoRave

broken depot
surreal path
#

crowd

#

market to the whats a debugger crowd

#

how paging

#

how make operating system

edgy pilot
#

they'll believe it

broken depot
#

lmao

surreal path
#

im going to get my bloods drawn now

#

bye bye see yall later

hexed sluice
#

gl

flat nymph
flat nymph
median goblet
#

memory mapped files with CoW support, then elf loader, then linker, then shared object manager, then running the elf

#

then syscalls

#

or something like that

edgy pilot
flat nymph
#

It's a lot more fun when it's userspace that's loading the kernel galaxybrain

surreal path
#

thats done

surreal path
#

i have everything in place for userspace

#

idk how to test syscalls now i finished the init and shit

surreal path
surreal path
#

it triple faults

#

@thorn bramble

#

but it got to like

#

the function

#

but executing it kills it

broken depot
#

So many notifications

thorn bramble
surreal path
thorn bramble
#

i meannn

#

how are u crashing?

#

gpf? page fault?

surreal path
#

just dies

thorn bramble
#

page fault with error code what

#

what

#

how

surreal path
#

idfk

broken depot
surreal path
#

output @broken depot @thorn bramble

#

sorry i was eating cake

broken depot
#

0xe -> page fault

surreal path
#

and its probs because of what im doing

broken depot
#

CPL=3 but the RIP seems to be a kernel address

surreal path
#

i dont know how to test it any other way tbf

#

i dont wanna stick an elf loader in yet

broken depot
surreal path
thorn bramble
#

so ur accessing kernel code from userspace

#

either map memory as user for testing or get a proper userspace memory mapping

surreal path
#

i did

#

just now

thorn bramble
#

nice nice

#

sorry i was playing games ;)

surreal path
#

all good :)

#

new issue

thorn bramble
#

stack

#

or, well, it's writing to [something-8]

#

and something is 0

#

do u have a tss?

surreal path
#

yes

thorn bramble
#

you should set rsp0 in tss to a proper value

#

i.e a kernel stack pointer for going from user->kernel mode

surreal path
#

okay

#

theres a new issue @thorn bramble but its hard to catch

#

it page faulted

#

it is mapped

surreal path
#

anyone know whats going on nooo

rich trellis
#

no

#

i lack information

#

quite literally how im feeling rn

hexed sluice
#

what

surreal path
#

a syscall

#

syscall instruction and a userspace program written in asm

#

it just does this lol

hexed sluice
#

πŸŽ‰ πŸŽ‰ πŸŽ‰ πŸŽ‰ πŸŽ‰

rich trellis
#

hell yeah

rich trellis
surreal path
#

sysret doesnt work but

#

its good dw

#

@kind root opinion?

desert haven
#

i'm not infy, but nice

desert haven
# surreal path sysret doesnt work but

dont forget that to do a 64-bit sysret (sysretq for gas), and the layout for the sysret descriptors in the GDT is a bit different to the syscall ones.

#

it should be: 32-bit user code, user data, 64-bit user code

kind root
surreal path
#

huh

supple robin
surreal path
supple robin
#

read operation

kind root
supple robin
#

real

surreal path
edgy pilot
#

In Long Mode, userland CS will be loaded from STAR 63:48 + 16 and userland SS from STAR 63:48 + 8 on SYSRET. You may need to modify your GDT accordingly.

flat nymph
#

Just steal my layout trl

surreal path
#

fun

#

yea selector is completely wrong

#

thats fun :)

flat nymph
#

It's compatible with both syscall and sysenter

#

And compat mode

edgy pilot
#

I don't understand how syscall worked in my previous kernel

#

gdt layout is messed up

orchid dawn
# surreal path

holy shit
nyaux officially does more than Techflash OS
congrats (now I'm jealous)

edgy pilot
orchid dawn
#

lol

#

I wish

#

I haven't updated TFOS in ages

#

iirc it's still using Limine 5

#

lmfao

edgy pilot
orchid dawn
edgy pilot
#

hmmm I wanna do syscall

#

nah not useful for now

surreal path
surreal path
#

sysret works now

#

on my birthday too

broken depot
#

Birthday gift from the OSDev gods

surreal path
#

real

frigid cliff
#

Happy birthday btw

surreal path
#

thanks zoe :3

frigid cliff
#

:3

rigid fable
kind root
#

Wait its your bday

surreal path
#

yes

kind root
#

Happy bday

surreal path
#

thanksss

kind root
#

Did u get any cool gifts

surreal path
#

nope

#

i got no gifts

kind root
#

Wtf

#

Why?

surreal path
#

js cause no one gave

kind root
#

What about your parents

surreal path
#

they didnt give

kind root
#

Bruh

#

At least you got syscalls working so thats a LETSFUCKINGGOOOOOO

surreal path
#

yes letsgo

kind root
#

Old ultra just did int 0x80

#

So its more crap than nyaux

surreal path
#

lol

edgy pilot
#

money is a much better gift

surreal path
#

didnt get

edgy pilot
#

what about that card your sibling gave you :D

rigid fable
surreal path
#

yes

surreal path
rigid fable
#

Mhh

#

One sec

kind root
surreal path
#

from my baby sister

kind root
#

Like a gift card?

surreal path
#

no

#

js a card

kind root
#

Ohh

#

Cool

tender gorge
plush hearth
#

Happy Birthday mr nyauxmaster

vivid drum
#

Happy birthday πŸŽ‚πŸŽ‚

surreal path
#

thank youu

edgy pilot
#

guess which dumbass forgot to set cpl 3 bits in a gdt entry and tried to debug an userspace issue for a whole day

#

oh wrong thread

surreal path
#

all good

steady flume
#

happy bday nyauxmaster!

rich trellis
#

happy day of birth celebration🧐

ionic musk
#

You were born on this day. We must celebrate

surreal path
#

syscalls and args work now

#

okay syscalls next whats next now hmmm

#

fuck symlinks yes

edgy pilot
#

I need to implement that tbh

edgy pilot
#

I suggest you look up uvm

#

from netbsd or openbsd

#

also this:

cinder plinth
#

its from netbsd

edgy pilot
#

yes

cinder plinth
#

idk why you said or openbsd is my point

edgy pilot
cinder plinth
#

yea

#

but its from netbsd

surreal path
#

so

#

vfs bugs everywhere

#

i need a hashmap

#

the one i have in the kernel is shit

#

bcs i modified it to use sized frees

#

and kinda fucked it up ig

#

i need a different impl

surreal path
#

node looking normal

#

test is corrupted

#

@thorn bramble

#

it dies even trying to USE test

#

its that fucked

thorn bramble
#

well yeah ofc

#

ops points to code

#

which is obviously borked

#

pls find out how it gets the broken value of test

surreal path
#

could it be a use after free issue again

#

like

thorn bramble
#

no

#

ur not freeing

#

lol

surreal path
#

kk

#

printing everything lookup does

#

@thorn bramble it looks sane

#

it seems but

#

im still waiting til it finishes

surreal path
#

i cant solve it

thorn bramble
#

:(

surreal path
#

:(

thorn bramble
#

we figure out tmrw

surreal path
#

yea hopefully

edgy pilot
#

just don't handle page sized allocations from the same function

surreal path
#

what

edgy pilot
#

don't you know how it works

cinder plinth
#

You evil man

edgy pilot
edgy pilot
#

@surreal path btw I updated the flanterm fork. you can just copy over the files, no api is changed

surreal path
#

i need to check if its a vmm allocation or a slab allocation tho

#

how am i supposed to do that

#

without knowing the size