#Nyaux

1 messages Β· Page 18 of 1

surreal path
#

all address aligned

kind root
#

thats not what i meant

#

printf the gas structure

surreal path
#

alright sure

kind root
#

uacpi_gas_read or uacpi_gas_write

surreal path
#

which source file

kind root
#

does it matter? gdb will find them

surreal path
#

kk

kind root
#

they're in io./c

surreal path
#

im sorry wtf

#

why is gas=0x1

kind root
#

yeah there u go

#

now bt

surreal path
kind root
#

can u walk up to read_register_field

surreal path
#

how do i do that

kind root
#

up

surreal path
#

thanks

kind root
#

then p *reg

#

anyway looks like u corupted a static table in uacpi

surreal path
kind root
#

thats not where i told u to walk up

surreal path
#

what it looks liek

kind root
#

try walking up to do_read_register

#

and do p *reg

surreal path
kind root
#

and up once again

surreal path
#

alr

surreal path
kind root
#

and whats the value in read_one

#

i dont understand how the pointer gets transformed into 0x1 lmao

kind root
#

just p reg

surreal path
kind root
#

okay now walk down and print it again

surreal path
#

okay

kind root
#

try stepping one line of code

#

and the varaible is called gas not reg

surreal path
#

yeaaa thast bad

kind root
#

did u walk one line?

surreal path
#

how to do that

#

again

#

sorry

kind root
#

n

surreal path
#

now its

#

valid?

#

huh

kind root
#

yeah okay

#

thats was just because u didnt enter the function

#

now do p *gas

surreal path
kind root
#

okay yeah this one is normal

#

and it will succeed

#

your gas read fails after initialization

#

so just skip to next invocation

surreal path
#

so just continue?

kind root
#

yes

surreal path
#

okay

kind root
#

continue until u see the namespace iniitalization done in log

surreal path
kind root
#

oh lol

#

whats the bt

surreal path
kind root
#

yeah this is where u die

surreal path
kind root
#

it was just because he never stepped into the function

surreal path
#

but the

#

gas looks valid

#

wtf

kind root
#

no it absolutely does not

#

its zeroed out

surreal path
#

oh

kind root
#

now restart your os and breakpoint on the one we looked at earlier

#

lets see if it gets corrupted during init

surreal path
#

which?

kind root
#

the first read

surreal path
#

read_one?

kind root
#

sure

surreal path
#

okay

kind root
#

p registers[1]

surreal path
kind root
#

now do p registers[1].accessor0

finite summit
#

Yes another person gets bash

#

*yet

surreal path
kind root
#

well deref it

surreal path
#

alr

kind root
#

cast to acpi_gas

#

come on this is normal c

#

*(struct acpi_gas*)

surreal path
kind root
#

ok yep

#

now do continue

surreal path
#

alr

kind root
#

and print this again

surreal path
#

alr

kind root
#

bt?

surreal path
#

alr

kind root
#

u didnt do continue did u

surreal path
#

i did

kind root
#

continue to where we finished last time

surreal path
#

ill do it again

kind root
#

ok what does p say

surreal path
kind root
#

why is it different from this output

surreal path
#

im unsure

kind root
#

try again i guess

#

ur corrupting random parts of memory ig lmao

#

this is literally a static table

surreal path
#

no its cause

kind root
#

a global variable

surreal path
#

its cause

#

i didnt b uacpi_gas_read

kind root
kind root
#

but this one is not zeroed out

#

so figure out how it gets zeroed out

surreal path
#

maybe causeeeee i zero out memory regardless

kind root
#

like i said

#

its a global variable

#

its not even heap allocated

surreal path
#

okay so wtf

kind root
#

no idea

surreal path
#

fuck

#

we need the debugging god

#

maybe he'll hear our prayers

#

lol

molten grotto
#

lol

surreal path
#

hiii qwinci

#

im currently dying

#

in the hell

#

of

#

hell

molten grotto
#

I am also currently dying trolol

surreal path
#

😭

molten grotto
#

anyway ig I can take a look if you push

surreal path
#

PUSHING

#

PUSHED

molten grotto
surreal path
#

wtf#

#

how

#

HOW

#

what did u change

molten grotto
#

you didn't zero out the pages you return from alloc after all

#

I already told you do to that once

surreal path
#

oh

#

πŸ’€

kind root
#

nyaux try to listen to advice impossible challenge

surreal path
#

IT WORKS

#

IT FUCKING WORKS

#

NOT YET

#

CAUSE THE SLAB ALLOCATOR STILL

#

IS FUCKING BROKEN BUT WHATEVER

molten grotto
#

its not even that broken, it works as long as you just zero out the memory properly

surreal path
#

rlly?

#

is that the fucking issue

molten grotto
#

yes I just tested

surreal path
#

bro

#

😭 😭 😭

#

can you pin this message im about to send

#

always zero out your fucking pages kids

#

pin that

surreal path
#

im putting that on my wall

kind root
#

im unironically considering making uacpi_kernel_calloc optional

surreal path
#

wait but i do zero out the pages

#

where dont i

#

???

#

tell me

#

which line

molten grotto
#

you write the freelist nodes to them and same for the slabs

surreal path
#

right

#

am i supposed to zero out the nodes too

#

huhh

molten grotto
#

well like you should zero the memory that you return from the allocator

#

because it previously contained the slab node so its not zeroed at that point

surreal path
#

right

molten grotto
#

like in here ```rust
match kmalloc_manager.as_mut().unwrap().alloc(layout.size())
{
Some(q) => {
q.write_bytes(0, layout.size());
return q
},
None =>
{
return cur_pagemap
.as_mut()
.unwrap()
.vmm_region_alloc(
layout.size() as u64,
VMMFlags::KTPRESENT.bits() | VMMFlags::KTWRITEALLOWED.bits(),
)
.unwrap();
}
}

#

well it already has that zero line because I added it

kind root
#

how do u even fuck this up

surreal path
#

BRO i dont even know

molten grotto
#

maybe I should add a write_bytes(0, layout.size()) to the uacpi kernel calloc function in the bindings to work around kernel alloc functions that don't return zeroed memory KEKW

kind root
#

maybe yeah

molten grotto
#

though then it might be done twice if the kernel actually does it properly

kind root
#

yea

molten grotto
#

also @surreal path before I forget to mention, your flanterm bindings are broken in release because they pass neither -mno* flags nor -mno-general-regs-only to the compiler when compiling flanterm

surreal path
#

right

#

could you pr that

#

ill merge it

molten grotto
#

idk where the repo even is, I didn't find it anywhere

molten grotto
#

I just looked at the source in docs rs

surreal path
#

ill just make you the owner of the crate as well

molten grotto
#

why tho

surreal path
#

cause im lazyyyyyyyy

#

plus i need to work on nyaux rn

molten grotto
#

just change it when you want to build nyaux in release then meme

surreal path
#

bru

#

done @molten grotto

#

fixed

#

try it out

surreal path
#

@molten grotto also might wanna have asserts for init level as well,

#

nyaux is ready for uhhh vfs and tmpfs right

thorn bramble
#

also pass -ffreestanding lol

surreal path
#

right

thorn bramble
#
use std::{env, path::PathBuf};

fn main() {
    let target = std::env::var("TARGET").expect("Target triple is not set");

    let bindings = bindgen::Builder::default()
        .clang_arg("-ffreestanding")
        .header("wrapper.h")
        .use_core()
        .generate()
        .expect("Unable to generate bindings");

    let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());

    bindings
        .write_to_file(out_path.join("bindings.rs"))
        .expect("Couldn't write bindings");

    let mut cc = cc::Build::new();

    cc.include("flanterm");

    match target.as_str() {
        "x86_64-unknown-none" => cc
            .flag("-march=x86-64")
            .flag("-mno-80387")
            .flag("-mno-mmx")
            .flag("-mno-sse")
            .flag("-mno-sse2")
            .flag("-mno-red-zone")
            .flag("-mcmodel=kernel"),
        "aarch64-unknown-none" => cc.flag("-mgeneral-regs-only"),
        _ => panic!("Unsupported target: {}", target),
    };

    cc.flag("-ffreestanding")
        .flag("-fno-stack-protector")
        .flag("-fno-stack-check")
        .file("flanterm/flanterm.c")
        .file("flanterm/backends/fb.c")
        .compile("flanterm");
}
#

thats what i do in my bindings

#

you can remove the aarch64 stuff i guess

#

since u dont need it

#

idk why i panic on unsupported target, i should probabaly just pass -mgeneral-regs-only for everything !x86

thorn bramble
#

damn that guys fast

surreal path
#

check out 1.0.7

#

of the flanterm bindings

thorn bramble
#

also with -ffreestanding you don't need "gcc-multilib installed for some reason"

#

:^)

surreal path
#

lol

thorn bramble
#

k time to switch out my flanterm_sys for ur bindings

surreal path
#

yay

thorn bramble
#
let bindings = bindgen::builder()
        .clang_arg("ffreestanding")```
#

bro

#

😭

surreal path
#

sorry

#

😭

thorn bramble
#

also you dont need the

#

ctypes_prefix

#

do you?

surreal path
#

not rlly

thorn bramble
#

also idk if -mgeneral-regs-only is enough for x86

#

like dont take my word for that

#

but i think there might be a reason mint passes -mno-sse and all the friends instead of -mgeneral-regs-only

#

@wicked loom can u explain pls?

surreal path
#

can u list the flags

#

if u dont mind

surreal path
#

so i can change it

thorn bramble
#
if target.as_str() == "x86_64-unknown-none" {
    cc.flag("-march=x86-64")
        .flag("-mno-80387")
        .flag("-mno-mmx")
        .flag("-mno-sse")
        .flag("-mno-sse2")
        .flag("-mno-red-zone")
        .flag("-mcmodel=kernel");
} else {
    cc.flag("-mgeneral-regs-only");
}```
surreal path
#

thanks

thorn bramble
#

i do that

#

basically

#

well, did

#

before i rm -rf'd the directory

#

let target = std::env::var("TARGET").expect("Target triple is not set");

#

thats how you get the target

#

also do the -mno-red-zone for all targets

#

not only for x86 lol

#

thats my bad

surreal path
#
extern crate bindgen;
extern crate cc;
use std::{env, path::PathBuf};

fn main()
{
    let target = std::env::var("TARGET").expect("Target triple is not set");
    let mut e = cc::Build::new();
    e.file("flanterm.c").file("backends/fb.c")
        .flag("-fno-stack-protector")
        .flag("-fno-stack-check")
        .flag("-ffreestanding")
        .flag("-mno-red-zone")
        
        .flag("-fno-lto")
        .flag("-fPIE");
        if target.as_str() == "x86_64-unknown-none" {
            e.flag("-march=x86-64")
                .flag("-mno-80387")
                .flag("-mno-mmx")
                .flag("-mno-sse")
                .flag("-mno-sse2")
                
                .flag("-mcmodel=kernel");
        } else {
            e.flag("-mno-red-zone");
            e.flag("-mgeneral-regs-only");
        }
        
        e.compile("flanterm");
    let bindings = bindgen::builder()
        .clang_arg("-ffreestanding")
        .use_core()
        .header("wrapper.h")
        .parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
        .generate()
        .expect("Unable to generate bindings");
    let out_path = std::path::PathBuf::from(std::env::var("OUT_DIR").unwrap());
    bindings
        .write_to_file(out_path.join("bindings.rs"))
        .expect("Couldn't write bindings!");
}

hows this

#

@thorn bramble

thorn bramble
#

you can gert rid of line 26

#

but other than that looks fine

#

e

surreal path
surreal path
#

the else statement?

thorn bramble
#

also parse callbacks are not needed eitther

#

e.flag("-mno-red-zone");

surreal path
#

oh

thorn bramble
#

you have one in the else

#

and one in the thing above

#

you only need one

#

and you need it in both cases

surreal path
#

right

thorn bramble
#

so get rid of the one in else

#

yup

surreal path
#

okay done

#

will i publish?

#

@thorn bramble

thorn bramble
#

i guess

#

i hope

surreal path
#

alr

thorn bramble
#

so i can fix my build

surreal path
#

done

#

1.0.8

thorn bramble
surreal path
#

less gooo

#

also how'd u change the font

thorn bramble
#

using the font argument?

#

it accepts a font lol

surreal path
#

oh lmao

thorn bramble
#

you can also change colors

#

you can give it a background image

surreal path
#

ooo

thorn bramble
#

what do you think limine does?

surreal path
#

lol

thorn bramble
#

limine uses flanterm my guy

#

lmao

surreal path
#

does flanterm check height and width of a backgroudn image

#

image

#

background*

#

or does it

thorn bramble
#

no

surreal path
#

okay

thorn bramble
#

you give it a "canvas"

#

which needs to be the same size as framebuffer

#

and it uses it as background instead of the default background color

surreal path
#

right

#

um @thorn bramble ???

#

i did .pic(false)

thorn bramble
#

why

surreal path
#

cause it wont compile otherwise

thorn bramble
#

weird

#

works for me

surreal path
#

can i remove mcmodel kernel

#

its causing issues for me

thorn bramble
#

probably?

#

not sure

surreal path
#

okay

thorn bramble
#

its probably going to be fine

wicked loom
thorn bramble
#

ah so nowadays it's fine to just -mgeneral-regs-only on all platforms?

wicked loom
#

if you don't care about compat with gcc <=12 (iirc) then yes

thorn bramble
#

nice, ill stick with the split options tho

#

if i ever do need that

#

thanks for explanation

wicked loom
#

np

surreal path
#

okay so

#

imagine

#

i have a path

#

/usr/bin/bash

#

or

#

usr/bin/bash

#

is there a function i need to get the 2 back slashes

#

and get the word inbetween

#

or smthin

molten grotto
molten grotto
#

for getting the vnode for a specific path

surreal path
molten grotto
#

no

#

the function in vnodeops only needs to look up one component

surreal path
#

yea

#

i see

molten grotto
#

I mean yeah basically what a path lookup function would do is call the vnode's lookup function for each component and assigning vnode to the result

surreal path
#

okay

surreal path
#

I HAVE SCHOOL TMRW

#

😭

#

HELP

thorn bramble
#

just go to school

surreal path
#

no its 5th year

thorn bramble
#

where problem

surreal path
#

you dont understand

#

i have like

#

8 subjects

#

😭 😭

#

its gonna be rlly hard

#

and too much homework

thorn bramble
#

just studyℒ️

surreal path
#

where time to work on nyaux

flat nymph
#

I never did my homework

surreal path
#

im gonna

elder shoal
surreal path
#

cry

surreal path
#

wwhat do i do

#

how do i escape this hell so i can work all day and night on nyaux

elder shoal
#

The only time I ever had to take some time off to study I tryharded studying for 3 months to pass the entrance exam for my uni

surreal path
#

ur in uni

#

luckyyyy

#

im still in highschool even tho im 17

elder shoal
#

5head

surreal path
#

cause i got delayed a year

surreal path
#

😎

flat nymph
#

You can't

#

Just study and the uni will be chill

#

(except the first year)

surreal path
#

i remember last year i designed my slab allocator

#

in school

flat nymph
#

(though it probably depends)

surreal path
#

πŸ’€

#

for old nyaux

elder shoal
#

My last year of high school was so chill I was either scribling about osdev in my notebook or playing clash {of clans,royale} with my friends during class

#

And passed with rly good gradea

surreal path
#

😭 😭

flat nymph
#

My last year of school was during covid

#

When the pandemic started basically

#

And it was weird af

flat nymph
surreal path
#

guys does osdev make you big pro

#

will it give me

#

extra credit

#

in school or smthin

#

like in college

#

not high schl

flat nymph
#

You can base your end of degree work on it

#

Or smth

#

Like Linux

flat nymph
#

Because you're invested and motivated

elder shoal
#

I had a chat with the os professor a few weeks ago and he said we should chat again in two semesters

flat nymph
surreal path
#

also uacpi works on nyaux

#

i forgot to say

#

tho i cannot get namespace_init or namespace_load working cause some init level shanggains

#

idfk

flat nymph
surreal path
#

i will have vfs done by 2 hours

#

then we can work on ustar

#

and tmpfs

flat nymph
#

Ok I have to get my disk reading/basic filesystem before you

surreal path
molten grotto
#

you should first call namespace load then namespace initialize

surreal path
#

unimplmented

#

i dont know what its trying to clal

#

call

#

what function

molten grotto
#

well just look what functions you return that status from and add some prints

surreal path
#

isnt that

#

optional

molten grotto
#

well if you don't want any events (like power button press or whatever) then ig you can just make it return success and not do anything

flat nymph
#

Power button is cool though
(only user input I have atm ok)

surreal path
#

um

#

its calling io_map

flat nymph
#

Just return success?

molten grotto
#

that isn't too hard to implement properly either

surreal path
#

ill just actually implment the function

surreal path
molten grotto
#

well you just need to return something that you can use to access io ports starting at the base that's passed to the io_map function in the read/write functions

#

you could just return the base itself

surreal path
#

right

flat nymph
flat nymph
molten grotto
#

you don't need to do anything but you need to return something you can use to access the base given the handle in the io_read/io_write functions

#

yeah

kind root
#

Get ticks expects 100ns increments

flat nymph
#

Oh

median goblet
#

high school is supposed to end at 17 in your country?

surreal path
median goblet
#

yeah but is it supposed to end when youre 17

#

4y primary, 4y secondary and 4y high school

#

and now uni another 4y

kind root
median goblet
#

in my country you get a year repeat if your average grade for a subject is below 5 (1-10, 10 is best)

#

or, well, you get a corrigence test during summer, and if you fail that, you repeat the year

#

idk if corrigence is a word though i just adapted it from my native language

surreal path
#

fight in school

#

i missed a lot of days of school

#

got held back a year

kind root
#

damn

kind root
surreal path
#

im an osdever

#

im a nerd

#

this guy was ripped

kind root
#

should've triple faulted the guy

surreal path
#

πŸ’€

flat nymph
# median goblet in my country you get a year repeat if your average grade for a subject is below...

I repeated the last year of high school because I was expelled for "hacking"
(I connected to teachers' WiFi with test/test username/password, shown it to my classmates, and they printed something (with my hint, but that still wasn't me) on school printers and I've gotten all the blame)
And couldn't find another school which would let me continue because the one that expelled me fucked up the documents and admitted me without giving me a certificate for finishing middle school

cinder plinth
#

That is so stupid

surreal path
#

WHY IS IT DEADLOCKING

#

@kind root

#

😭

kind root
#

your bug

surreal path
#

how

kind root
#

idk

surreal path
#

how tf do i fix

#

this is in kernelapi btw

kind root
#

it says global lock is owned by firmware

#

thats impossible on qemu

surreal path
#

wha

kind root
#

so u already fucked something up

surreal path
#

how the hell

#

fuck

#

what

#

???

#

i dont understand

#

what did i do wrong

kind root
#

no idea

#

i mean global_lock is a field of the FACS table

#

maybe u trashed it or soemthing

surreal path
#

i did not

#

no way

#

can you look at it pls

#

i think its with the kernel api

#

i refuse to believe its another memory bug

kind root
#

check the value of p g_uacpi_rt_ctx.facs->global_lock

#

and p g_uacpi_rt_ctx.facs

surreal path
#

alr sec

#

what function do i break point

kind root
#

try_acquire_global_lock_from_firmware

surreal path
#

gotcha

#

@kind root

kind root
#

deref

surreal path
#

right

kind root
#

okay its correct

#

now continue to when it starts hanging

surreal path
#

global lock is 2 @kind root

kind root
#

thats in try acquire?

surreal path
#

yea

kind root
#

b in do_release_global_lock_to_firmware

#

and reboot

surreal path
#

okay

#

whats next

kind root
#

dump the same thing

surreal path
#

right

#

what it looks like

kind root
#

where

#

bt?

surreal path
kind root
#

right, thats not where i wanted u to break

surreal path
#

oh

#

which was it

kind root
surreal path
#

k

#

lock=0x0

kind root
#

actually i know whyt

surreal path
#

why

kind root
#
    if (mutex->handle == g_uacpi_rt_ctx.global_lock_mutex) {
        uacpi_status ret;

        ret = uacpi_acquire_global_lock_from_firmware();
        if (uacpi_unlikely_error(ret)) {
            UACPI_MUTEX_RELEASE(mutex->handle);
            return UACPI_FALSE;
        }
    }
#

since u return the same gabage handle for all mutexes

#

it thinks they all refer to the global lock

#

so it tries to acquire the global lock multiple times

surreal path
#

so what am i supposed to return

kind root
#

idk make some global int

#

and return int++

surreal path
#

right

#

and for deacquire?

#

??

kind root
#

doesnt matter

surreal path
#

just make some global int

#

and plus plus it on each acquire

#

correct?

kind root
#

no

#

plus plus it on each create mutex

surreal path
#

okay

kind root
#

so that handles dont collide

surreal path
#

yes kinda worked

#

!!!!

kind root
#

yeah

surreal path
#

now another issue to debug

#

lapic not firing

#

my fucking interrupts are gone

#

lol

kind root
#

i wouldnt run this on real hw, half of ur api is stubbed out

surreal path
kind root
#

it might not work properly

#

implement the goddamn api lol

surreal path
#

fair

#

ill do it maybe later

#

but just for now

#

lets get shit working

kind root
#

ye

surreal path
#

we needa make a move on before school tomorrow

#

oh fuck

#

😭

#

why is my lapic not firing

#

ITS CONFIGURED CORRECTLY AAAAA

molten grotto
#

the real question is what did you change

surreal path
#

wdym

molten grotto
#

it worked fine yesterday?

surreal path
#

yea?

#

so wtf

#

my interrupts arent masked

#

sooooooo ummmmmm

#

wha

#

@molten grotto i pushed it so maybe you can look at it

#

all i changed was kernelapi

#

for uacpi

molten grotto
surreal path
#

tho

molten grotto
#

removed what?

surreal path
#

sti

#

all the asm sti calls

molten grotto
#

yes then they aren't enabled

surreal path
#

i did cli

#

wait

#

no

#

oh

#

sti is enable right?

molten grotto
#

yes

surreal path
#

right

#

sec

#

okay so @molten grotto

#

it gets stuck

#

i dont think that looks right....

molten grotto
#

at least when I tried it it didn't get stuck

surreal path
#

yea its stuck

#

flanterm_bindings

#

????

kind root
#

nyaux try not to get stuck challange

#

failed yet again

surreal path
#

more fucking issues

molten grotto
#

idk what did you even change to make it stuck

surreal path
#

maybe its the fact i updated the bindings or smthin

#

is it the compile flags?

#

are they wrong

#

or smthin

molten grotto
#

I just added a core::arch::asm!("sti") before the hlt loop in hcf and the thing you pushed worked fine

surreal path
#

try it again

#

fetch

molten grotto
#

you get an interrupt while you are holding the print lock and then you try to print "tick" there

#

this is why you should usually disable interrupts for the duration of holding the spinlock

#

or raise the ipl or whatever if you use that otherwise

#

if you'd have your own spinlock struct instead of using one from some crate you could save the irq state and disable irqs within the spinlock lock method and then restore the state in the guard's drop method

surreal path
#

ill just change the macro

#

solved

#

alright lets work on the vfs

flat nymph
#

you can just not enable interrupts while in kernel

surreal path
#

i think i will get 2mb pages working

#

the loading hhdm is too slow

#

actually nvm

#

i just need to focus

desert haven
#

just disable pre-emption while holding the output lock

surreal path
#

i disable interrupts when locking

#

and when finished i renable interrupts

#

GUYS

#

GUYS GUYS GUYS

#

I DID IT

#

VFS IS DONE

#

WEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE

#

NOW FOR TMPFS

#

AND USTAR

#

THEN APIC AND UHHH SCHEDULER THEN USERSPACE THEN MLIBC AND JINX SETUP THEN DEV DEVICES THEN BASH !!!!

molten grotto
#

you might have bash before I do KEKW

surreal path
#

might not cause my motivation might die down cause school and depression so i might be a bit slower this time memedown

#

its okay tho im taking my time with nyaux

#

slow and steady

#

im not rushing to userspace

molten grotto
#

well tbh idk how much time would it take for me to make bash working with my kernel either, rn I am just trying to fix my libc enough so its not total garbage (because debugging it on a custom kernel isn't fun)

surreal path
#

fair KEKW

flat nymph
#

(sorry if I pinged you I forgot to uncheck it)

molten grotto
#

nah you didn't, though I don't mind as otherwise I may not see the messages

surreal path
#

yall can someone motivate me to get to fucking work

#

why cant i write a single line of code for nyaux

#

help

flat nymph
#

imagine being able to self host

surreal path
#

maybe im having burnout

#

idk

#

do i need a day break

#

or smthin

#

or am i just procastinating

#

what do yall think

surreal path
#

i lied i dont have a working vfs cause i dont understand the resolve_path function, i dont understand anything im a fucking failure. i have no idea how to implement this im unsure how to even get tmpfs working i dont know what im supposed to do

#

i only said that so you guys would have meaningful progress in the thread instead of nothing for the last 3 days

#

im such a failure

#

ugh

#

im sorry

#

maybe i should drop the project entirely at this point

#

idfk

molten grotto
surreal path
#

the resolve path function

#

how to even

#

start at implmenting that

#

what do i return what am i supposed to do

#

i dont even have tmpfs either

#

so like

molten grotto
#

ig you could take a look at how I do it, maybe then you'd get an idea

#

in fs/vfs* and iirc fs/tar* for the weird impl on top of tar

surreal path
#

i dont know anything about c++ strings

#

but ill try to

#

implment something similar

surreal path
#

wheres your path lookup

ionic jetty
#

you don’t have any obligations to anyone here

#

you shouldn’t feel pressured to finish stuff as fast as possible imo

#

itβ€˜s a hobby project, you can always work on other things in the meantime

molten grotto
surreal path
#

is tarfs a read only file system

haughty kite
#

tarfs is a shitty file system

molten grotto
haughty kite
#

you probably want to unpack a tarball into a vfs

surreal path
#

okay so will i have the filesystem implment the component lookup

molten grotto
#

yes

surreal path
#

is that a better design choice

#

?

molten grotto
#

I mean idk how else would you do it

#

the component lookup kinda depends on the filesystem

surreal path
#

and do i need a function that resolves absolute paths yes or no

molten grotto
#

likely yes but that can be a generic path -> vnode function

#

(that then uses the component lookup fn on the vnodes)

surreal path
#

fair

#

should i have a global vnode

#

that i store

elder shoal
surreal path
#

the root vnode

#

i just wanna get to a point where i can run doom on nyaux

#

like i know its gonna be hard lol

elder shoal
#

I have a vfs_root global but usually its not used

#

I usually take the process cwd or root

surreal path
#

i should probs use it

#

initally

#

for booting up the kernel

#

to like

#

actually execute the elf

#

to run in userspace

#

then ill use whatevers in process

#

on context switch

#

that a good design?

#

@molten grotto ??

molten grotto
#

as in what is the root inside the process?

surreal path
molten grotto
#

the cwd you mean? though you can also have per-process root like if you chroot

surreal path
#

yea per process root

molten grotto
#

but I don't think you need to concern yourself with that rn

surreal path
#

and current working directly will be vnode

#

hows that

molten grotto
#

sounds fine

surreal path
#

alr cool

finite summit
#

Lemme find it

#

ignore any namecache stuff

#

actually this might make more sense

surreal path
#

im implmenting getting USTAR now

#

which means

#

we need to setup jinx

finite summit
#

what

#

how does that collerate to that

surreal path
#

cause

#

i want a populated ramfs

#

filled with a bunch of files and programs

#

just to test out

#

if the vfs is good enough

#

@wicked loom right?

finite summit
#

shell script best build system

surreal path
#

😭

finite summit
surreal path
#

@wicked loom i need help with jinx configuration

#

actually yk what

#

screw jinx

#

too difficult to configure

#

lets dooooo uhhhh

#

xbstrap?

#

@magic kernel how does xbstrap work?

#

is no one responding today 😭

wicked loom
#

what

surreal path
#

i have no idea

molten grotto
#

didn't you use jinx last time too?

surreal path
#

but the difference is

#

its written in rust

#

instead of C

molten grotto
#

it doesn't change anything

wicked loom
#

what does Jinx have to do with that

surreal path
#

im unsure of how to configure that

molten grotto
#

just the way you build the kernel

wicked loom
#

take a look at Andy's kernel, see what he does

surreal path
#

he uses jinx?

wicked loom
#

yes

surreal path
#

alright

#

sec

#

i do not know what its looking for

#

nvm

magic kernel
surreal path
#

like i dont understand

magic kernel
#

Everyone will probably tell you it isn’t so idk. Imho it’s preference over shell vs yaml as biggest difference

surreal path
#

im just tired

#

im gonna be up all night setting this up i guess

#

screw school lol

cinder plinth
#

works anywhere

flat nymph
surreal path
#

what does this mean

#

does anyone know

#

?

cinder plinth
#

What'd you curl

surreal path
#

i dont know

#

i dont know whats its doing

#
name=base-files
version=0.0
revision=1
source_dir="base-files"

package() {
    cp -rpv ${source_dir}/. "${dest_dir}"/
}
#

my recipe just looks like this

#

anyone can help please

#

im so tired

#

i just want this working

surreal path
#

its jinx doing that

#

its not in the makefile

cinder plinth
#

What's the source url

surreal path
#

source url

#

there isnt supposed to be

#

@wicked loom help

#

i copied everything

#

modified it for my kernel

#

its giving me this error

cinder plinth
#

Is source dir even right

#

Don't you need source_method or something

#

I think what's happening is it's trying to curl nothing

surreal path
#

i dont know

#

i seriously dont fucking know

#

im just copying jinx files and recipes from aero

elder shoal
#

I think aero uses some very old jinx version

wicked loom
#

@surreal path i am not inclined to help you because your amount of frustration is repulsive and it annoys me, sorry

#

go use xbstrap and bug dennis about it

#

using the "i'll go use X instead" as basically bait to try and get me to help you really achieves the opposite result

#

also i am not inclined to help you because you're likely gonna work on this for a week tops and then go MIA again for 3 months and it just feels like a waste of effort, which in combination with the aforementioned annoyance, really doesn't make me wanna help

#

i also do not appreciate being pinged over and over about it

thorn bramble
#

just copy gloire/vinix

#

bruh

cinder plinth
#

yeah I'd just copy vinix

#

it's the most up-to-date

#

and has a shitton of ports

surreal path
#

i apologise

#

im really sorry, i shouldnt have pinged you constantly about that

#

i wish i wasnt a shitty person to people im sorry

wicked loom
#

apology accepted

surreal path
#

Alright, just to document my progress not asking for help. I am currently still trying to setup a bootstrapper like jinx. might be done soon i think i got it working

surreal path
#

rbrt like robert?

#

like a guy named robert?

#

maybe its my jinx config?

#

uhhhh

#

nooo?

#

base-files recipe looks the exact same as vinix

#

uhhh im unsure

surreal path
#

i need to get some work done soo im just gonna make a shell script to make a initramfs and not setup jinx for the time being

#

i need to prove this os is not going MIA after like a week anyway lmao

surreal path
#

alright i need to make an oct 2 bin function

#

i suppose

#

i might setup the rust test system

#

that might make it easier to debug in future

#

instead of firing up a VM and waiting forever for the kernel to load lmao

#

wait is that possible

#

does anyone know

#

?

surreal path
#

i got test working!

#

very useful

finite summit
#

nice

surreal path
#
assertion `left == right` failed
  left: 52
 right: 42
#

well that is nice to know

#

that the oct2bin function

#

is shit

finite summit
#
inline static uint64_t oct2bin(const char* str, size_t size)
{
    uint64_t n = 0;
    const char* c = str;
    while (size-- > 0) 
        n = n * 8 + (uint64_t)(*c++ - '0');
    return n;
}```
finite summit
#

np

surreal path
#

incrementing it?

finite summit
#

c += 1

surreal path
#

right

finite summit
#

and it takes the value of c

#

gives you the value of c

#

then increments it

#

specifically

#

that's important

surreal path
#

okay

#

what should i pass to size

#

hmmmmmm

#

assertion left == right failed
left: 52
right: 5

#

IM SO CLOSE

#

😭

#

wheres my 2

#

assertion left == right failed
left: 52
right: 42

#

bro

#

im actually like

#

why

#

hmmmm

#

bro im so stupid

#

its working correctly

#

please end my brain

#

😭

#

running 1 test
test fs::USTAR::test ... ok

#

😎

surreal path
#

how come

#

initramfs != initramfs

#

finally

#

ooooo

#

38 MB

#

my kernel uses lol

#

is that bad

#

eh

surreal path
#

well we got something

#

ustar done

#

tmpfs time

cinder plinth
#

you can also use my revolutionary archive format meme

#

if you want

cinder plinth
#

(don't)

#

nah I was joking

surreal path
#

lmao

cinder plinth
#

it's a project that was only talked about in #staff

surreal path
#

No access

#

lol

cinder plinth
#

# staff

surreal path
#

yea clearly πŸ’₯

#

anyways

#

tmpfs time fr fr

cinder plinth
#

basically TAR but smaller but with more copying involved

surreal path
#

as i remember it tmpfs has nodes and dir entries and dirs

u have a dir which contains dir entries, they all contain vnodes to which to lookup on, it could contain another dir or a tmpfs node

#

yea i believe thats how it works

cinder plinth
#

a directory is a tmpfs node tho

surreal path
#

wha

#

no its not

cinder plinth
#

yes it is

#

a node is either a file or a directory

#

typically

finite summit
finite summit
#

so in summary

#

it's bad

surreal path
#

yep

#

😭

elder shoal
rigid fable
#

this thread has almost 18k messages lol

surreal path
#

OKAY IM AWAKE

#

I FELL ASLEEp

#

AAAAA

surreal path
#

then

surreal path
#

im writing the tmpfs in MOSTLY safe rust

#

for a change

#

no more spamming unsafe

#

this time i can get the benefits of rust 😎

wicked loom
surreal path
#

OKAY 2 MORE FUNCTIONS AND IM DONE WITH TMPFS

#

THEN WE CAN POPULATE IT

#

WITH THE INITRAMFS :)

surreal path
#

tmpfs is done

#

just creating a vfs create function for vnode

#

and i shall populate my vfs :)

#

or tmpfs rather

surreal path
#

I LOVE RUST TESTS

surreal path
#

well thats why u write tests

#

vnode { ops: no, flags: FILE, data: 0x77d068000e50 }

#

hmmm

#

ops

#

no

#

lol

#

😭

haughty kite
#

what happens if you do cargo miri test?

surreal path
#

one sec

haughty kite
#

rustup component add miri first

#

and if it screams at you then UB moment

surreal path
#

yea ub moment

#
help: <271825> was created by a SharedReadWrite retag at offsets [0x18..0x38]
   --> src/fs/tmpfs/mod.rs:173:48
    |
173 | ...                   *result = Some(&mut o.vnode as *mut vnode);
    |                                      ^^^^^^^^^^^^
help: <271825> was later invalidated at offsets [0x0..0x40] by a Unique retag
   --> src/fs/tmpfs/mod.rs:174:52
    |
174 | ...                   (*dir).head = Some(o);
    |                                          ^
    = note: BACKTRACE (of the first span) on thread `fs::vfs::path`:
#

its telling me something pitust

#

about my shitty usage of raw pointers that for sure