#Nyaux

1 messages ยท Page 14 of 1

surreal path
#

sys_exit

elder shoal
#

Is your bash compiled with readline

surreal path
#

idk

#

i think it is

#

wha

surreal path
#

??

elder shoal
#

Bash with readline needs a more working system lol

#

Whats your jinx recipe for bash

surreal path
#
name=bash
version=5.2.26
revision=1
tarball_url="https://ftp.gnu.org/gnu/bash/bash-5.2.21.tar.gz"
tarball_blake2b="6789c9a0d9eb1ad167d4199bf1438d77934a7bbeae9f9fdd7167cae006b17b3894852440248db1bb6e9cf6d930e8a18b6448a3bb4db8831b2e6d1445b56a2065"
source_allow_network=yes
source_imagedeps="curl"
source_hostdeps="autoconf automake libtool pkg-config"
imagedeps="gcc"
hostdeps="gcc autoconf automake libtool pkg-config"
deps="core-libs ncurses readline"

regenerate() {
    curl -Lo bash52-022 https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-022
    curl -Lo bash52-023 https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-023
    curl -Lo bash52-024 https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-024
    curl -Lo bash52-025 https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-025
    curl -Lo bash52-026 https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-026

    for f in bash52-02*; do
        patch -p0 < $f
    done

        AUTOHEADER=true \
    autotools_recursive_regen
}

build() {
    autotools_configure \
        --with-curses \
        --enable-readline \
        --without-bash-malloc \
        --with-installed-readline="${sysroot}/usr/lib"

    make -j${parallelism}
}

package() {
    make install DESTDIR="${dest_dir}"
    ln -s bash "${dest_dir}${prefix}"/bin/sh

    # post_package_strip
}

copied from vinix

green elbow
#

you have --enable-readline so im guessing it is using readline :^)

#

you could try remove it and recompile

elder shoal
#

Yeah remove the readline flags

tawdry mirage
#

might explicitly need --disable-readline?

#

if it looks for it on it's own by default

surreal path
#

using this flag causes these errors

#

works without enable readline tho

#

clearly still dying

#

fuck

#

does my bash recipe look wrong?

green elbow
#

remove the --with-installed-readline too

surreal path
#

oka

#

bash is STILL Dying

#

bruh#

green elbow
#

do you actually print stderr now?

surreal path
#

i tried

#

its printing nothing

green elbow
#

you should just always print that

surreal path
#
void syscall_write(struct syscall_frame *frame, struct per_thread_cpu_info_t *ptr)
{
    int fd = frame->rsi;
    void *buf = (void*)frame->rdx;
    size_t count = frame->r10;
    if (fd == 1)
    {
        // SINCE WE DONT HAVE DEVICES WE JUST WRITE DIRECTLY TO FLANTERM
        flanterm_write(ctx, buf, count);
        frame->rdx = 0;
        frame->rax = count;
        return;
    }
    else if (fd == 2)
    {
        flanterm_write(ctx, buf, count);
        frame->rdx = 0;
        frame->rax = count;
    }
    else {
        kprintf("syscall_write: failure at fd: %d\n", fd);
        frame->rdx = -1;
        return;
    }
    
}
#

i clearly do

green elbow
#

solid

#

why does it still say failure tho

surreal path
#

wait

#

im stupid

#

it did get to

#

bash

#

but then it exited

#

lemme remove all the debug messages

#

unknown error code?

#

its looking for bashrc

#

like what

green elbow
#

that shouldn't be fatal

surreal path
#

okay this is what cleaner output looks like

elder shoal
#

I think the reason why it exits is orobably related to your read

surreal path
#

why?

elder shoal
#

What does your read return

#

Or do you even handle stdin

surreal path
#

-1 if err

#
void syscall_read(struct syscall_frame *frame, struct per_thread_cpu_info_t *ptr)
{
    int fd = frame->rsi;
    void *buf = (void*)frame->rdx;
    size_t size_of_buf = frame->r10;
    struct process_info *pro = get_cur_process_info();
    struct FileDescriptor *d = &pro->Descriptors[fd];
    if (d)
    {
        if (d->ptr)
        {
            kprintf("Buf: %p Offset: %d, fd: %d\n", buf, d->offset, fd);
            kprintf("Addr of vnode: %p\n", d->ptr);
            int hm = d->ptr->ops->v_rdwr(d->ptr, size_of_buf, d->offset, buf, 0);
            if (hm != -1)
            {
                kprintf("old offset is %d ", d->offset);
                d->offset += hm;
                kprintf("new offset is %d\n", d->offset);
                frame->rdx = 0;
                return;
            }
            frame->rdx = -1;
            return;
        }
        else {
            kprintf("Clearly exists\n");
            frame->rdx = -1;
            return;
        }
    }
    frame->rdx = -1;
    return;
}

legit the entire function

elder shoal
#

Do you have a stdin

surreal path
#

no

elder shoal
#

Thats probably it then

green elbow
#

yah could be that it's just reading EOF

#

and exiting

surreal path
#

wha

#

now ur making me confused

green elbow
#

add a log to syscall_read and log the fd

surreal path
#

oka

#

it just reads fd 0 a bunch

green elbow
#

yes that is stdin

#

that should be reading from the keyboard buffer

surreal path
#

now its not reading fd 0

#

as im making sure that remains allocated

green elbow
#

allocated?

surreal path
#

as in

#

used

#

i have a bitmap that says which fds are used

#

and which fds are not used

green elbow
#

do you know what stdin is

surreal path
#

standard input

green elbow
#

right

#

where does that come from

#

in your kernel right now

surreal path
#

i dont have it rn

#

at all

green elbow
#

okay that is probably your issue

surreal path
#

fair

green elbow
#

to test it you can even make it infinitely return "a" or smth

surreal path
#

on read?

green elbow
#

yea

#

in syscall_read add a special case for fd 0 that always returns "a"

#

in principle that means that your bash prompt will just be filled with "a"

surreal path
#

ok

unkempt relic
#

or even \n

#

should make bash reprint her prompt

surreal path
#

something like this i suppose

tawdry mirage
#

you need to return the amount of data writteen

green elbow
#

^

surreal path
#

right

#

mlibc still panicking

tawdry mirage
#

presumably because exit is unimplemented?

surreal path
#

im not trying to exit tho

#

why is bash wanting to exit

green elbow
#

what does your sys_read look like?

surreal path
#
void syscall_read(struct syscall_frame *frame, struct per_thread_cpu_info_t *ptr)
{
    int fd = frame->rsi;
    void *buf = (void*)frame->rdx;
    size_t size_of_buf = frame->r10;
    if (fd == 0)
    {
        // stdin
        if (size_of_buf > sizeof(char))
        {
            ((char*)buf)[0] = '\n';
            frame->rdx = 0;
            return;
        }
    }
    struct process_info *pro = get_cur_process_info();
    struct FileDescriptor *d = &pro->Descriptors[fd];
    //kprintf("syscall_read: reading fd %d\n", fd);
    if (d)
    {
        if (d->ptr)
        {
            // kprintf("Buf: %p Offset: %d, fd: %d\n", buf, d->offset, fd);
            // kprintf("Addr of vnode: %p\n", d->ptr);
            int hm = d->ptr->ops->v_rdwr(d->ptr, size_of_buf, d->offset, buf, 0);
            if (hm != -1)
            {
                // kprintf("old offset is %d ", d->offset);
                d->offset += hm;
                // kprintf("new offset is %d\n", d->offset);
                frame->rdx = 0;
                return;
            }
            frame->rdx = -1;
            return;
        }
        else {
            // kprintf("Clearly exists\n");
            frame->rdx = -1;
            return;
        }
    }
    frame->rdx = -1;
    return;
}
elder shoal
surreal path
#

its because i do this in my syscall

#

*bytes_read = count

#

returning bytes_read properly doesnt solve it tho

green elbow
surreal path
#

wdym concern

green elbow
#

you should properly return how many bytes are read lol

#

how did you fix it?

surreal path
#

i return the amount of bytes read

#

properly

#

as asked

#

still dont know why bash is quitting tho

#

its like fuck this shit im out

wide nexus
#

just to mess with u

unkempt relic
#

bash instantly exits if it thinks it's not getting any more input, something like that

surreal path
#

but im giving input

#

'\n' remember

unkempt relic
#

does it actually get as far as calling sys_read()?

tawdry mirage
#

maybe it bails because of poll failing?

unkempt relic
#

i had this problem when i first ported bash, it instantly exited, i forgot the details of what was going on

wicked loom
#

likewise

surreal path
#

im back after 4 days

#

isnt that crazy

#

yall thought i left again trl

finite summit
#

didn't you say somewhere you would take a break from osdev because school

surreal path
#

i did

#

for studying

#

i have the exams in a few days but

#

i've done my studies

#

i can breath now

#

anyways last thing we were trying to do on nyaux

#

hmm

#

that was bash unexecpectingly quitting

#

ah yes

wicked loom
surreal path
#

thats a lil mean

wicked loom
#

because it happened before like twice

surreal path
#

but i gotten so far

#

in this iteration

#

its not gonna happen again

wicked loom
#

that's true

plush hearth
surreal path
#

yes

#

๐Ÿ˜Ž

ionic jetty
#

Mindblowing

surreal path
#

absolutely

ionic jetty
#

Indeed

surreal path
#

just wanna let yall know that nyaux is not dead im just not feeling up mentally

#

to be honest

#

so its difficult to do anything really atm

#

im sorry

#

ill try to resolve these mental issues as soon as possible so i can continue to work on the project

green elbow
#

take it easy bro no pressure

surreal path
#

i will be back on monday tomorrow

#

to work on nyaux

#

i had an appointment with my therapist and i feel a little better

surreal path
shut laurel
surreal path
#

fair

#

anyways okay so what we were doing

#

right

#

bash

#

so we loaded bash

#

but uhhhhh

#

no stdin

#

so bash goes like fuck u

#

right

#

and ofc

#

weird ass page fault

#

happening on my system

#

cause im using wsl this time

#

great

#

which is like wtf

#

and ofc make run-uefi isnt working on wsl cause fuck me

#

hmmmmmmmmmmmmmmmmmmmm

#

how tf am i gonna debug this

#

lovely

#

its a general protection fault

#

when using xsave????

#

bru

elder shoal
#

Check alignment

#

Of the address you pass to xsave

#

It has to be 16 bytes aligned iirc

surreal path
#

wha

#

its happening at line 22

#

in this function

#

on the asm instruction

#

what i do

surreal path
surreal path
#

cause the cpu hates me

#

like usual

elder shoal
surreal path
elder shoal
#

Protected Mode Exceptions

surreal path
#

okay so its def not cause of cpl

#

not xcr either

#

could be the third exception

#

umm

#

hmmm

#

ughhh what is the issue nooo

#

i lit set xcr 0 to 7

#

if the cpu has avx

#

i cant remember how the layout of the xcr registers are but

#

im sure thats valid

#

as it worked before

#

why now is there an issue

elder shoal
#

Does your host cpu have avx? Idk if qemu software emulation emulates it

surreal path
#

yes it does

#

on linux is worked

#

it *

elder shoal
#

Try running with kvm and see what it does

surreal path
#

solves issue on kvm?

#

tf???

#

I CHECK FOR AVX????

#

HUH???

elder shoal
#

Then the checking code is bad or smth or its a qemu issue

surreal path
#

i believe this is correct

#

so like wtf???

#

?????

#

maybe this is not worth fixing, ill just make a linux vm or smthin

#

fuck wsl honestly

elder shoal
surreal path
#

whats wrong with that

#

wait

#

oh

#

yea

#

but wait

#

no wait

#

shouldnt it like

#

wait

#

my brain is confused

#

shouldnt it work fine cause like its a

#

if statement-ish

elder shoal
#

Read that statement slowly

surreal path
#

no

#

sorry

#

my brain is actually tard

#

poop

#

i dont know

#

like im ANDing the bit

#

so i should get just that one bit right???

#

why is this statement an issue

#

as u can tell its been quite a while

#

i forgot a lot of things

#

and maybe minus 20iq points

elder shoal
#

Youre checking the edx register for something in the ecx register......

surreal path
#

oh my god

#

am i

#

that stupid

#

wtf

#

โ˜ ๏ธ

#

๐Ÿ˜ญ

#

anyways more issues yay

#

setting xcr 0 to value 2 is an issue for some reason

#

fuck where was that diagram of the xcr registers in the sdm again

elder shoal
# elder shoal https://www.felixcloutier.com/x86/xsetbv

Currently, only XCR0 is supported. Thus, all other values of ECX are reserved and will cause a #GP(0). Note that bit 0 of XCR0 (corresponding to x87 state) must be set to 1; the instruction will cause a #GP(0) if an attempt is made to clear this bit

surreal path
#

the value of 2 does not clear bit 0

#

wait no

#

it does

#

โ˜ ๏ธ

#

it should be 3

#

okay now thats fixed

#

now we have vfs issues

#

yay !!!!

#

fuckin hell

#

truly a

#

moment

#

bash is not compiling???

#

wheres my mlibc???

#

WHERES MY SHIT

#

๐Ÿ˜ 

#

YO JINX

#

WHERES MY USERSPACE

#

yea where tf is my userspace huh

#

why didnt jinx build mlibc or

#

bash

#

or anything

sleek gazelle
#

you made an os and a somewhat usable but still shitty userspace in a span of a month yet my dumb autistic possibly adhd brain still can't figure out how to do smp and apic

surreal path
#

its not shitty userspace

#

its pro userspace

#

๐Ÿ˜Ž

sleek gazelle
#

my mistake

surreal path
#

u sound like me a bit ago

#

i dont even have smp in my kernel

#

and apic is actually kinda easy

#

its just

sleek gazelle
#

lol

surreal path
#

a bunch of registers u write to

sleek gazelle
#

i do have smp though its still somewhat shit

surreal path
#

im actually quite mad

#

wheres my damn userspace

#

compile it jinx

#

rawr

elder shoal
sleek gazelle
#

i somewhat have problems with doing apic since theres no comprehensive code and docs for apic that i can reference

surreal path
#

maybe i need to do dist clean?

#

maybe something fucked up with the build or something

#

and jinx didnt compile bash and mlibc for some whatever reason

#

this compile may take like

#

30-40 minutes

sleek gazelle
#

and some apic code written in zig doesn't really fit in with (how i setup) my code

surreal path
#

anyways i will try to run

#

make dist-clean

#

and see if jinx will be epic gamer and compile mlibc and shit for me

surreal path
#

why isnt jinx

#

compiling bash

#

i did dist clean

#

STILL

#

i believe it was my makefile

#

should be solved now hopefully

#

๐Ÿคž

#

now we are back to the same point we were before

#

where bash poopies for some reaosn

#

reason*

#

uhhhhh

#

okay so why does bash do this hmm

elder shoal
#

Likely because it thinks it hit an end of file

surreal path
#

huh??? why????

#

with what??

#

????

elder shoal
#

See what read returns

surreal path
#

this doesnt get printed

#

nor this

#

so clearly something else is happening???

#

huh???

#

is it cause i error out when someone asks to duplicate a file descriptor?

elder shoal
#

You dont need dup for a basic bash promot

#

Whats your whiole read function both mlibc and kernel side

surreal path
# elder shoal Whats your whiole read function both mlibc and kernel side
void syscall_read(struct syscall_frame *frame, struct per_thread_cpu_info_t *ptr)
{
    int fd = frame->rsi;
    void *buf = (void*)frame->rdx;
    size_t size_of_buf = frame->r10;
    if (fd == 0)
    {
        // stdin
        if (size_of_buf > sizeof(char))
        {
            ((char*)buf)[0] = '\n';
            frame->rdx = 0;
            frame->rax = sizeof(char);
            kprintf("read(): stdin was read\n");
            return;
        }
    }
    struct process_info *pro = get_cur_process_info();
    struct FileDescriptor *d = &pro->Descriptors[fd];
    //kprintf("syscall_read: reading fd %d\n", fd);
    if (d)
    {
        if (d->ptr)
        {
            // kprintf("Buf: %p Offset: %d, fd: %d\n", buf, d->offset, fd);
            // kprintf("Addr of vnode: %p\n", d->ptr);
            int hm = d->ptr->ops->v_rdwr(d->ptr, size_of_buf, d->offset, buf, 0);
            if (hm != -1)
            {
                // kprintf("old offset is %d ", d->offset);
                d->offset += hm;
                // kprintf("new offset is %d\n", d->offset);
                frame->rdx = 0;
                frame->rax = hm;
                return;
            }
            frame->rdx = -1;
            return;
        }
        else {
            kprintf("read(): descriptor of value %d was not found\n", fd);
            frame->rdx = -1;
            return;
        }
    }
    frame->rdx = -1;
    return;
}

mlibc:

int sys_read(int fd, void *buf, size_t count, ssize_t *bytes_read) 
{
    __syscall_ret ret = __syscall(3, fd, buf, count);
    if (ret.errno != 0)
    {
        return ret.errno;
    }
    *bytes_read = count;
    return 0;
}
elder shoal
#

You should add a system call log

surreal path
#

i have

#

i have a syscall log

#

???

elder shoal
#

Also fix the bytes read to be what you return from the read syscall

surreal path
#

yea changed that

#

to which it solved nothing

elder shoal
#

What fd is it trying to read from?

surreal path
#

lemme see

elder shoal
#

Is mlibc complaining about any missing functions? How is your bash recipe

surreal path
#

doesnt seem like it?

#

this is my bash recipe

#
name=bash
version=5.2.26
revision=1
tarball_url="https://ftp.gnu.org/gnu/bash/bash-5.2.21.tar.gz"
tarball_blake2b="6789c9a0d9eb1ad167d4199bf1438d77934a7bbeae9f9fdd7167cae006b17b3894852440248db1bb6e9cf6d930e8a18b6448a3bb4db8831b2e6d1445b56a2065"
source_allow_network=yes
source_imagedeps="curl"
source_hostdeps="autoconf automake libtool pkg-config"
imagedeps="gcc"
hostdeps="gcc autoconf automake libtool pkg-config"
deps="core-libs ncurses readline"

regenerate() {
    curl -Lo bash52-022 https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-022
    curl -Lo bash52-023 https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-023
    curl -Lo bash52-024 https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-024
    curl -Lo bash52-025 https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-025
    curl -Lo bash52-026 https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-026

    for f in bash52-02*; do
        patch -p0 < $f
    done

        AUTOHEADER=true \
    autotools_recursive_regen
}

build() {
    autotools_configure \
        --with-curses \
        --without-bash-malloc

    make -j${parallelism}
}

package() {
    make install DESTDIR="${dest_dir}"
    ln -s bash "${dest_dir}${prefix}"/bin/sh

    # post_package_strip
}
elder shoal
surreal path
#

yes

elder shoal
#

Readline needs poll

#

Yeah thats why its breaking lol

surreal path
#

idk what readline is so

#

ima remove the dep

elder shoal
#

What lets you line edit in bash

surreal path
#

huh

#

ok building without readline

#

still same issue

#

so sad

#

what is ncursers

#

do i remove that

#

is that causing the issue

#

??

elder shoal
#

Could be, try removing it too

surreal path
#

okay

elder shoal
#

And remove --with-curses

#

From the configure

surreal path
#

okay

#

so

#

yea

#

linker errors

#

for some reason

elder shoal
#

I think its trying to build with its internal readline

#

Do --without-readline

surreal path
#

okay

#

still

#

even with

elder shoal
#

Wait its

#

--disable-readline

#

This one worked without poll

surreal path
#

compiles now

#

OKAY IT WORKS

#

LETS GO

#

AND MY FUNNY \n STDIN SHANNGAINS

#

WORKS TOO

#

WOHO!

#

okay do i hook up my ps2 driver to stdin

#

or what

green elbow
#

that would be a solid next step

elder shoal
#

You make it a device

surreal path
#

i dont have devices

elder shoal
#

You create them

surreal path
#

i think thats bash

#

is that normal

#

i think thats normal right

surreal path
#

i have zero idea how to implment devices

elder shoal
#

Theyre vnodes just like any other file

surreal path
#

uh huh yea

#

i get that

#

but what extra functionality do dev devices need or whatever

elder shoal
#

They have major and minor numbers you use to see what device the vnode points to

green elbow
#

not much except they have different implementations of read() and write()

#

and sometimes seek is meaningless on them

surreal path
#

my brain has just exploded

#

๐Ÿ’ฅ

green elbow
#

you don't need that

#

device files are just files which are not backed by a filesystem but instead by some mechanism

#

for example /dev/zero is just a file with a read() function that looks like

int read(char *data, size_t amount) {
  memset(data, '\0', amount);
  return amount;
}```
surreal path
#

so for my case

#

i could have a file like

#

/dev/keyboard

#

and its read could look like

#

it could return the thing in the keyboard buffer and stuff

#

and its write??? will do nothing i suppose

#

is this a good way of implmenting this?

elder shoal
#

For terminal io it gets a bit more complex

surreal path
#

oh

elder shoal
#

But yeah for a keyboard file its p much that

surreal path
#

i want to implment this correctly

elder shoal
#

Look up tty demistified

#

I think thats the name of that article

#

And ig you can also look at astral shittyโ„ข๏ธ code for some implementation

surreal path
#

๐Ÿ’ฅ

green elbow
#

read it again

surreal path
#

i am trying

#

my brain is still cooked trying to understand any of this

green elbow
#

dont read about cooked mode then

surreal path
#

bru

elder shoal
wicked loom
#

nyaux

green elbow
#

yah and then add it to a stir fry

surreal path
#

yes what about nyaux

surreal path
#

2 flour

#

1 cool bean

#

mix together

#

anyways i may take a nap

#

be back in 2 hours

leaden hinge
#

like mmap

surreal path
#

ok back

surreal path
#

so

#

hm

#

what was i doing again

#

right

kind root
surreal path
#

๐Ÿ˜ 

kind root
#

i know i am

surreal path
#

i have a tty to implment

#

what about you hm??

#

exactly

#

๐Ÿ˜Ž

kind root
#

just opened a pr

surreal path
#

fair

kind root
#

but im still not happy about it

surreal path
#

i keep rereading the tty demystified article but nothing of what it says makes sense to me at all

#

maybe im stupid

finite summit
#

I doubt I'd understand ttys

#

they seem like a dumb concept

surreal path
#

yea

kind root
#

e.g. i wrote code to hijack a working tty's stdin and it helped me reinforce my understanding

surreal path
kind root
#

read again and again until u do

#

what is it u dont understand

finite summit
#

inb4 everything

surreal path
#

like this whole line displince thing

#

yep

kind root
#

often times u need multiple source to grasp something

#

google line discipline

#

see different explanations

#

look on youtube

#

different sources

#

if you dont put in effort you dont get the knowledge

surreal path
#

i am

kind root
#

then you'll get it

surreal path
#

looked through a bunch of resources and i still dont, i think im clearly braindead

#

maybe the 3 weeks of me being away from nyaux has made my iq go down by 20 points

#

i think i played too much valorant during that time

elder shoal
#

if you want an implementation to look at you can take a look at astral io/tty.c, io/pty.c (for the pseudo terminal backend) or io/console.c (for the /dev/console backend)

steady flume
#

nya?

edgy pilot
#

ux

kind root
#

master

plush hearth
#

4.0

ionic jetty
#

OP

marble surge
#

Jun 8, 2024

kind root
#

looked through a bunch of resources and i still dont, i think im clearly braindead

marble surge
plush hearth
marble surge
#

Ohh okay ๐Ÿ˜…

plush hearth
plush hearth
kind root
#

i think i played too much valorant during that time

median goblet
#

You need advanced stage brainrot to do that

plush hearth
#

yes, but by you replying to me like that, it makes me think you don't understand what is happening

kind root
#

Because they dont

thorn bramble
kind root
#

lol

kind root
#

Looks like nyaux died

finite summit
#

RIP

finite summit
#

@surreal path You good?

ionic jetty
#

They promised us that theyโ€˜d return, right?

#

Last seen 28 days ago

plush hearth
#

There was a lot of progress fairly quickly at the start of this, and then it just seemed to die

ionic jetty
#

I hope the thing that I tend to do is not happening, being incredibly interested in something for a while and then suddenly not really caring about it anymore

finite summit
#

linuxmaster seems to have disappeared along with his OS

plush hearth
#

It happened again

thorn bramble
#

rip

wicked loom
#

i called it

kind root
#

It was obvious tbh

#

Tty ended up being too hard to understand

#

And people weren't spoon-feeding as much

thorn bramble
#

i've been wanting to give up on my osdev journey for like 6 months at this point

#

writing code that doesn't suck and isn't fundamentally flawed too hard :D

finite summit
#

I'd give up on osdev but I got nothing else to do

#

except game dev

#

but osdev > game dev

elder shoal
#

holy shit

#

where is nyauxmaster...

kind root
#

But looks like hes alive at least which is nice

finite summit
#

so I'm not the only one who thought he died or something

#

good

ionic jetty
#

@surreal path

surreal path
#

HI

#

im back

#

for the

#

fuckin trillionth time

#

@kind root guess whos still alive

surreal path
surreal path
#

just want to say sorry to everyone for being gone again

#

for the billionth time

#

my motivation to do anything is like nearly 0

#

๐Ÿ˜ญ

#

so i just stopped doing any kind of anything

#

for a while

surreal path
#

i dunno what to do now, continue the project. scrap and rewrite? not rewrite and just continue? idfk

#

im still alive (sadly)

#

which is the worst thing

#

time to check if nyaux still compiles

kind root
#

Its been like months lmao

surreal path
#

!!

kind root
surreal path
#

i could not escape the big depression

#

anyways im gonna verify if nyaux still compiles and go from there

magic kernel
#

welcome back

#

you were making pretty good progress, so looking forward to see what's next

surreal path
#

thank you !!!

#

time to wait forever to jinx do setup the container

#

or whatevs

#

lovely

#

clearly something bad

#

is jinx outdated

#

probs

#

okay got the newer jinx

#

oh yeah btw @kind root forgot to ask, hows life going with you? hows the uacpi project going?

leaden hinge
#

welcome back

surreal path
#

hi solar

leaden hinge
#

howve you been

surreal path
#

not great which is why ive been gone for a while

#

but im back now

leaden hinge
#

ah i see

#

well i hope things are better

#

and nice to see you back

surreal path
#

nice to see you too

leaden hinge
#

gonna continue with nyaux?

surreal path
#

yep

leaden hinge
#

it was going pretty well last i recall

surreal path
#

right back where we left off

#

i believe it was

leaden hinge
#

super

#

usually this would be the point where i rewrite everything for no reason

surreal path
#

something with implmententing device files

leaden hinge
surreal path
#

yep !

leaden hinge
#

i just finished doing that the other day actually

surreal path
#

im just recompiling nyaux

#

see if everything still compiles well

surreal path
elder shoal
#

Holy shit nyauxmaster 4.0 is back

plush hearth
#

welcome back

ionic jetty
#

no way

#

They have returned

#

whatโ€˜s on the agenda

kind root
#

nice to see that ur back

unkempt relic
#

ought to be fun

leaden hinge
#

"whats aml" incoming

unkempt relic
#

it will be full of people denouncing ACPI as the devil's daughter

leaden hinge
#

or that yes

kind root
#

that would be cool lmao

surreal path
surreal path
surreal path
kind root
#

yeah this is new stuff

surreal path
#

yea ik

#

okay got it to compile

#

huh weird

#

it takes forever

#

oh im running out of ram

#

lmao

#

huh it still stays stuck here

#

something weird

#

is happening

#

not cool

#

fun

#

yea clearly this is a nonsense address

desert haven
#

Welcome back ๐Ÿ˜

surreal path
#

hi r4

desert haven
surreal path
#

๐Ÿ˜ญ

leaden hinge
surreal path
#

good question

surreal path
leaden hinge
#

my favorite kind of error

surreal path
#

truly

#

no interrupt happened as well

#

and no cpl change

#

so somehow the cpu is jumping to some weirdo address and just doing whatever tf

desert haven
#

Maybe take a look at what the other codes are doing

leaden hinge
#

did you iret?

#

or sysret or whatever

surreal path
#

this shouldnt happen tho

#

cause all interrupts are handled with an iret

leaden hinge
#

you might be messing the stack up before iret

surreal path
#

possible

#

somewhere here

#

there seems to be an issue

#

could be cause uacpi changed a fuck ton while i was gone

desert haven
#

Yes it certainly has

surreal path
#

lovely that ossdev wiki is down for the billionth time

#

so i cant see how the api changed for uacpi

leaden hinge
#

osdev.wiki is up for me

surreal path
#

its hella slow for me

#

wait its coming back

#

i dont see a problem with how im trying to get the madt table

#

hmm

#

man i love maintaining really old code

#

ie code i wrote 3 months ago

#

thats correct

#

also correct

kind root
surreal path
#

good question

#

yea still not working

#

the urge to rewrite everything

kind root
#

madt = table is wrong as well

#

do u not have warnings or what

surreal path
finite summit
finite summit
thorn bramble
#

holy fucking shit

#

i thought this day would never come

#

welcome back king

elder shoal
#

The nyauxmaster has come to save us all

surreal path
#

๐Ÿ˜Ž

#

okay so

#

the code in nyaux is WAY too crusty

#

difficult to wrap my head around what the fuck i was trying to do a few months ago, nearly unreadable code

#

i think the best option is to do a rewrite

#

NOW BEFORE anything hear me out

thorn bramble
#

please no rust

surreal path
#

trl ๐Ÿ˜ญ

thorn bramble
#

or, actually, go have fun :^)

#

i should try rust osdev one day

finite summit
#

no rust

#

but I'm serious /j

leaden hinge
#

it takes longer to rewrite than to get used to your old code

surreal path
#

ill see what i will do

surreal path
#

on a trip on italy btw

elder shoal
#

nyauxmaster 4.0 travel arc

frigid cliff
#

Have fun

surreal path
#

okay got my laptop pluggedi n

#

brung it with me for italy

#

lets

#

fuckin

#

do this

#

rewriting nyaux day 1

kind root
surreal path
#

i cannot spell

#

๐Ÿ˜ญ

#

im working on nyaux in vc0

elder shoal
#

nyaux in rust real

surreal path
#

real

#

yep i got macros wokring

steady flume
kind root
steady flume
#

๐Ÿคฆ of course

surreal path
steady flume
#

LETS FUCKING GO

kind root
steady flume
#

probably

surreal path
#

btw i got some nice pics of Italy, u wanna see @kind root ?

kind root
#

Yes

surreal path
#

wait

#

@kind root thats me btw face reveal crazy ik

kind root
#

lol nice

#

u look like ur pfp

surreal path
#

i do indeed

#

i get that a lot

#

anywayssss time to get some memory management goinggg

#

maybe ill do a bitmap allocator this time around

#

nah

wicked loom
#

bruh you look like a child

surreal path
#

bro im 17 mint ๐Ÿ˜ญ

#

why does everyone say that

wicked loom
#

wtf

#

off of that pic i'd say you were 14 or smth lol

surreal path
#

๐Ÿ˜ญ ๐Ÿ˜ญ

wicked loom
#

maybe even less

surreal path
#

idk why i look that young

wicked loom
#

i mean it's not necessarily a bad thing

#

to most people at least

surreal path
#

yea i guess

#

cool got memory entries

#

lets heckin

#

throw a bunch of freelist nodes into each free page ๐ŸŒž

#

๐Ÿ˜Ž

#

and link em all

#

then boom done finished freelist allocator

#

kkkk nice

alpine mulch
#

are you on the run

surreal path
#

no ๐Ÿ˜ญ

alpine mulch
#

we can hide you

#

theyll never get more of us osdevers alive

surreal path
#

!!!

#

rust is a mistake

finite summit
#

common rust L

surreal path
#

truly

surreal path
#

hi guys so still working on the PMM

#

im sorry im not at the speed i should be at

#

difficult when on holiday and doing it in a completely different language

#

but its a fun learning experience

surreal path
#

๐Ÿ˜ญ

#

i was expecting to use unsafe a lot more actually

#

only rlly needed it for dereferencing raw pointers

#

thats great btw it works

#

my memory allocation works !!!!

#

what abouttttttt

#

500 pages

#

it did it very nice

#

and its not even running under kvm

#

thank you @thorn bramble for the suggestion of using this kind of allocator

finite summit
surreal path
#

thanks for being really supportive

finite summit
#

Always know that no one here is going to pressure you to work on this

surreal path
#

thanks again

#

im def just gonna work on it whenever i have free time

#

problem now tho

cinder plinth
#

when did you learn rust

surreal path
finite summit
surreal path
#

exactly

#

actually the rust compiler has been really nice to me

#

i dont fight with it too much

#

only for raw pointers

#

anyways slab allocator is next

#

man i love

#

making the terminal look pretty

finite summit
#

who doesn't

surreal path
#

ikr

thorn bramble
#

i got past the "must look pretty" phase

#

i like informative logs

#

i like to pack as much info as possible without making the line too long

finite summit
#

my logs have mainly been:

bonjour``` for the past few days
thorn bramble
#

ew frenchie

finite summit
#

#1141057599584878645 message

finite summit
#

and I was thinking of something I could log in my irq handlers so I would know they got hit

#

so I chose 'bonjour'

#

and also 'hola'

#

don't worry I'm not french

thorn bramble
#

thank god

elder shoal
#

my logs are
modulename: slop

plush hearth
surreal path
#

apologies i dont get much time

#

difficult to work

#

but im trying my best

#

anyways

#

we need a PMM working do we have that yes we do

#

but deallocation

#

oh hell nah

#

gonna be difficult

#

lets do this

surreal path
#

dealloc works i think

finite summit
#

if it's a freelist you just make a node add it to the list

surreal path
#

no its a bit different

finite summit
#

with a page count?

surreal path
#

yep

finite summit
#

same thing

#

just add the node to the end

#

and set the page count

surreal path
#

right

finite summit
#

you can ignore all from size_t nMemoryLeft = nPages * OBOS_PAGE_SIZE; to the end of the function

#

that's just so the kernel can wait for physical pages to be freed

surreal path
#

where the structs

#

like freelist node

finite summit
#

top of file

surreal path
#

right im stupid

#

sorry

finite summit
#

npnp

surreal path
#

wait

#

i think i have a better design

#

im thinking wait

thorn bramble
#

yea i kinda trolled u with the pmm

#

but as oberrow said you can add single pages back to the list as new regions

#

but in general what i do in my kernel is i have N lists of free blocks of order N, what that means is that each block is of size 2^(N+12) and is aligned to that boundary

#

i still have that "memory region" thing just to make sure whenever im freeing memory it does belong to a valid memory region + i reserve some memory out of each usable region for the page info storage

median goblet
#

i just dont deal in more than 1 page at a time.

#

has served me well enough

surreal path
#

im just gonna do a freelist

#

im not getting trolled

#

yea inserting it in EVERY page

#

is stupid

#

but idc

#

okay freelist is done actually

#

its the same simple one page allocation freelist

#

but it doesnt take forever to boot

#

thankfully

surreal path
#

hi all just implmented the gdt into nyaux, cause rust is a bitch when it comes to asm files i have to fuckin do this janky ah system with using build.rs to compile my asm code

#

and

#

it uses

#

gas syntax

#

๐Ÿคฎ

#

so i got a tool online to convert nasm syntax to gas

#

cause i dont know how to write gas synta

#

call it skill issue idc

#

ull never find me writing gax syntax

elder shoal
#

Liquid syntax when

surreal path
#

tf is a liquid syntax???

molten grotto
surreal path
molten grotto
#

and it uses intel syntax because its parsed by rust the same way as inline asm (well it is inline asm just loaded from a file)

surreal path
#

wait nvm its still gas syntax

molten grotto
#

no

#

you have to use gas directives but the syntax is intel

#

meaning eg. instead of global you use .global

surreal path
#

how do i do a relative jump in gas

#

its easy with nasm

#

but im unsure how to do it in nasm

#

gas*

molten grotto
#

lea rax, [rip + whatever]

surreal path
#

works

#

lets gooo

#

๐ŸŒž

#

๐Ÿ˜Ž

#

triple fault!

#

lovely

#

time to see the issueeee

#

WHERES MY DAMN LOG QEMU ๐Ÿ˜ญ

#

it should give me some

#

debug

#

where is the debug output

#

i see nothing in my terminal angr

#

yea no matter what flags i put

#

no debug output

#

amazing !

ionic jetty
#

normally itโ€˜s because of kvm

#

but you donโ€™t seem to have it enabled

#

try logging to a file instead

surreal path
#

sorry i havent used qemu in a while ๐Ÿ˜ญ

ionic jetty
#

-d int -D qemulog -serial file:seriallog

finite summit
#

but I do agree that at&t "GAS" syntax is dogshit

finite summit
sleek gazelle
#

if you thought gas syntax was dogshit, you haven't seen plan9 syntax

#

they use untypeable unicode symbols

#

that you need to either copypaste or type with the compose key if you have that

surreal path
#

Will be back soon me and my family going to the beach

finite summit
#

have fun

surreal path
#

thanks Omar

shut laurel
#

:

surreal path
#

nekoneko nokonoko dostantan

shut laurel
finite summit
#

Lies.

surreal path
#

u cannot escape the brainrot

surreal path
#

nvm

#

page fault

#

me when rust

#

how tf

#

am i supposed to debug this

#

help

#

so its happening at reload cs

#

how do i make this possible to debug with rust

thorn bramble
#

look at the disassembly

surreal path
#

oh im idiot

#

i forgot i dont have a tss

#

done

#

now we have gdt

#

๐Ÿ˜Ž

#

uhhhh whats next

#

right

#

page tables

#

fun

#

lets open the sdm and get to work!!!

surreal path
#

okay i did the things for the flags and stuff

#

love bitflags great crate

#

now im uhhhshit

#

my brain is gone

kind root
#

There's a crate for... flags?

surreal path
#
#define FLAG_w (1 << 2)

things like this right

#

this crate gives me that functionality

kind root
#

Why is a crate needed for that?

surreal path
#

i dont fucking know

#

to be honest

#

but its whatever

edgy pilot
#

when rust:

surreal path
#

literarly

#

okay im gonna go read back all the things from last month

#

from everyone explaining paging to me

#

and be back in like 20 minutes

#

will have a page table manager done then after like 25 minutes hopefully

edgy pilot
surreal path
edgy pilot
#

write allowed

#

it's always readable when page is present

surreal path
#

okay i renamed it

#

one thing im guessing is i need to map the kernel binary

#

if im going to create a new page map

#

as well as the hhdm?

#

wait

#

no looking back at my old code

#

now im completely confused

#

my brain has exploded fuck

#

okay thank god old rayan made a diagarm for me to go off by

#

i need to copy the hhdm and the kernel virtual mappings into the new pagemap

#

right in order to map the kernel

#

i need the kernel size in bytes

#

which i do NOT know how to get in rust

#

C its easy with the linker script