#EvalynOS

1 messages · Page 2 of 1

hazy saddle
#

This is the helper functions

devout path
#

xd the outcome of chaos is indeed stability

#

im impressed

hazy saddle
devout path
#

LMAO

#

INDEED

hazy saddle
#

If you do the same in C++ code it would crash the same

#

I’m letting Lua devs feel my pain

#

The engine is pretty complete for the most part in terms of adding new features for games

#

The rendering pipeline is what needs the most work

devout path
#

XD

#

gimme a moment my ethernet cable that's kidna fucked up aint' working properly, i broke the thing where it connects to LOL

hazy saddle
#

I got it to play a music video by loading every frame as a texture and swapping between them and loading them in and out of vram and then calling a system media player from Luas shell execution

hazy saddle
#

It was like a 2gb somthing game tho

#

So I’m not sharing it XD

#

I also have this little thing that you give a sub set of systemd style commands to

#

And it will figure out your init ststem

#

And then execute the proper command for your system

#

So you don’t have to remember many different syntaces

hazy saddle
devout path
#

oh nice nice

hazy saddle
#

It can do all of this

devout path
#

daamnnn

hazy saddle
#

And it’s all a single C file of like 200 lines

#

But this stuff isn’t that impressive

#

Just some code I threw together and stuffs

#

I just sit in my bedroom all day on my computer and make code and play video games

devout path
#

eh i think it's just u being built diff

#

possibly u having fun making these

#

i alr got burned out

hazy saddle
#

So I am able to pace myself to keep going

#

And yeah it’s 8am with no sleep

devout path
#

copy me LMAO

#

go sleep

#

i swear

#

u will get burned out like me even though u don't code

#

i mean even if you don't code

hazy saddle
#

I’ve been doing this for the last few weeks now

devout path
#

XD

hazy saddle
#

And I keep trying to fix it

devout path
#

nah just buy monster

hazy saddle
#

And then it returns

hazy saddle
devout path
hazy saddle
#

I mean is any of my code “optimal”

#

A lot of my code is made at 3am working with no sleep

#

That’s why I also chose to live dangerously

devout path
#

i can now see a pattern LMAO

hazy saddle
#

Dangerously cheesy

devout path
#

your code says a lot about who you are

hazy saddle
#

Add the checks and other stuff etc

#

Don’t give Lua raw pointers but give handles

#

Etc etc

devout path
#

not safer code but like

#

the pattern of how it goes XD

hazy saddle
#

Tell me then

#

What kind of pattern / who am I

devout path
#

i mean like u can write safer code but chooses not to LMAO

#

that pattern

#

im operating on sub optimal braincells right now pardon if i say something out of the question

hazy saddle
#

And if stuff happens where it crashes something else already fucked up bad for the most part

devout path
#

then that tells a lot about u XD

hazy saddle
#

(For the kernel side)

#

I have no excuse for the LUA shit I’m pulling 😭

#

I should fix that

hazy saddle
#

I’m not allowed to leave my house much and I’m home schooled yaaar

devout path
#

oh zamn ;-;

hazy saddle
#

So this might just be how I get out my dangerous things since I can’t do anything fun irl

#

But like subconsciously

devout path
#

don't worry the outside world is just fucked as it is the same as the world we live in on the internet

hazy saddle
devout path
#

wat's GED?

#

as a malware analyst for quite a while now i can attest that the world we live in ain't kind as it seems

hazy saddle
#

High school diploma but not through high school

devout path
#

ooh

hazy saddle
#

It’s an “equivalent”

devout path
#

should be the same XD

hazy saddle
#

Also I have no ID 😭

#

My parents haven’t gotten it yet

#

So no job for me

devout path
#

i tihnk you received better education than the current ediucation that we live in to be honest

#

a lot of factors regarding how the external factors such as classmates, environment tells a lot that it's failing

#

and hwo they teach u

hazy saddle
#

Because my parents do nothing XD

devout path
#

i resent the current education system but yea XD

#

your work would be the US equivalent of uuh

#

what's that called again

#

AP subjects

#

yes yes

hazy saddle
#

Honestly if Covid didn’t happen I would be still in school

devout path
#

oh damn

hazy saddle
#

My life would of ended up much different and I might not of discovered my self

devout path
#

yeaa ;-;

hazy saddle
#

But I should sleep because the keys on my phone keyboard look like they are rotating

#

These are uhhh not rated right

#

Rotated

devout path
#

i think i foudn the bug

hazy saddle
#

Oooo

devout path
#

we needa keep the interrupts disabled until the idle thread is fully done and at least one real kernel thread is linked

hazy saddle
#

Even though I am tired and seeing things my brain is still mostly at full capacity for programming

devout path
#

or don't shouldSchedule = 1 until inserted an actual thread

#

should i explain how it works XD

devout path
#

i envy u a little XD

hazy saddle
devout path
#

teach me ur ways

devout path
hazy saddle
#

Partial Mental insanity?

devout path
#

yes

#

XD

hazy saddle
devout path
#

yea

hazy saddle
#

What about the cli and sti bug then

#

The qemu bug is fixed but not the physical one

devout path
#

the qemu?

#

wait that's the phyiscal bug fix XD

#

it's both a fix for it

#

try it

hazy saddle
#

Well true true

#

But the physical bug was from cli and sti

#

But I guess this has the same effect

devout path
#

ye so basiaclly in real hardware uuh

#

setup_idt turns interupts on which is sti while we're still in early boot

#

as pointed in the kernel.c

#

uuuuuuuh

#

aparently

#

wait where am i

#

ok so

#

setup_threading() immediately calls create_thread(null)

#

rihgt?

#

and it pushes null as the return address for the new thread and at the end sets shouldSchedule = 1

hazy saddle
#

But the tty code shouldn’t get executed until after the IDT no?

hazy saddle
#

If I only have one thread it executes

#

But if I have two

#

The first one never executes

devout path
#

maybe im just drunk off monster energy

hazy saddle
devout path
#

we shall see XD

hazy saddle
#

I’m gonna sleep

devout path
#

wait wait

#

before u do

hazy saddle
#

Il wake up and test the new TTY fix file the optimization

devout path
hazy saddle
#

Alright alright

devout path
#

oke so

hazy saddle
#

And maybe yall can find the issue with the scheduler because that’s interesting too with the linked list

devout path
#

tty doesn't run until later but the kernel still hits the race long before that

devout path
#

i was cross referencing to le amd64 funny book

devout path
#

the order inside kmain is

#

setup_idt() installs the idt and executes sti

#

so irqs become live!

hazy saddle
#

Which is what I would want right

devout path
#

uuuuuuuh

#

wait lemme read this again

#

im going to triple read this fuckin

#

uuuuh

#

timer interrupts start running yeh?

#

while create_thread(NULL) is still building the dummy thread

#

so the scheduler

#

switches to that thread and tries to execute a NULL poilt entry

#

point

#

would u like a comprehensive more non dumbed down explanation?

hazy saddle
#

And when the TTY renders that causes the stupid thingy issue because it sets it should shceduls

devout path
#

yes

hazy saddle
#

Is there a way to patch it to not need a null dummy thread

devout path
#

that's what im developing now

hazy saddle
#

Because that’s annoying and a waste of memory

#

Good good

devout path
#

since the 2 ppl that was helping me gave up MAO

#

i'll make a patch dw

#

this is fun learning x64 this way so

hazy saddle
#

And then once that gets PRd in to did the scheduler I can add my other patch to speed up the TTY

devout path
hazy saddle
devout path
#

yuuuuuuup

#

my brain is fried

hazy saddle
#

But why the GPF when I’m not fucking with the scheduler stuff but just interupts being on or off?

devout path
#

i needa break LMAO

hazy saddle
#

I dunno

#

You should sleep and then do thissss

#

Because I lowkey got no idea how to fix that myself 💀

#

Otherwise I would not of bundled that hack

devout path
#

becauseee

devout path
#

scheduler sees le shouldSchedue

#

it's set

#

and it ocntext switches to taht half built thread

hazy saddle
#

So it ends up falling through to the null entry because a race condition with some logic

devout path
#

iyes

#

the cpu raises the #GP

hazy saddle
#

You know I am gonna have to learn 32 bit at some point for a port on my kernel

devout path
#

XD DO NOT

hazy saddle
#

Maybe I can help with your kernel a bit XD

devout path
#

well u can look at my kernel

#

yippie !

#

tthank uou

hazy saddle
#

Maybe I can do a refactor to reorganize the files and shit

devout path
#

i'll use ur for my NUMA-aware research :DD

hazy saddle
#

A “Small” Refactor

devout path
devout path
devout path
#

i'll refactor the code once i'm ok

#

i've had too much caffeine to drink

hazy saddle
#

Yeah lmao

devout path
#

and i think it's my breaking point lMAO

hazy saddle
#

Is that libc for kernel or user

devout path
#

i fored myself to understand this

#

wai brb 2 mins

hazy saddle
#

This isn’t a bad structure for the kernel code

#

No git ignore

devout path
hazy saddle
#

Well it exists but not for binaries

devout path
devout path
#

i forgot gitignore

hazy saddle
#

No kernel free

#

You can probably adapt the code I stole for the heap part atleast

#

As long as your PMM can free pages

hazy saddle
devout path
#

yes yes ofc ofc

#

well ths is x32 so i might redesign it XD

hazy saddle
#

The PS2 code I took from there dosnt have that header because it was a smaller set and at that point I was in contact with the dev and they said to just put a small comment there

devout path
#

oooh

#

my memory management code is

#

suboptimal

#

LMAO

hazy saddle
#

The other files were a full port of the entire file lmao

#

I mean it’s a bitmap pmm so I could make a buddy allocator for ir at some point maybe

devout path
#

oh wait wat

#

oooh

hazy saddle
devout path
#

yeah i wsas wondering about that XD

#

aight

#

go sleep XD

#

imma eat dinner

#

and do a little bit of planning on how to refactor your scheduler

#

and plus on point XD

#

im researching on schedulers

#

specifically on hint based topology aware schedulers

devout path
hazy saddle
#

Talking about other kernels etc

viral bison
#

oh, lol

#

if you need help with schedulers, i might be able to help

hazy saddle
#

Btw @devout path thanks for all the help with this and il finnaly have a scheduler that dosnt need a stupid hack XD

viral bison
#

i finally fixed mine a few days ago XD

devout path
#

i'm happy to help !

hazy saddle
#

So I added that but it’s causing other issues that @devout path found so they are gonna make a PR

viral bison
#

wdym null entry?

devout path
#

thank you too for enlightening me with x64 knowledge that i wouldn't be able to have the motivation to learn

hazy saddle
viral bison
#

strange

hazy saddle
#

Because my schedular with more than one task refuses to schedular the first one on the linked list

#

For some reason

hazy saddle
devout path
#

nice

viral bison
#

linked list that should work very well

#

using templates to make it easier to use

devout path
#

ooh thakns thanks

devout path
#

@hazy saddle if you ever run into somethig that needs debugging come to me i will 100% debug it

devout path
#

just refactor it to c :))

#

XD im joking

viral bison
#

i prefer c++ bc of templates, namespaces and classes

hazy saddle
#

I use C because of a meme song mmLol

devout path
hazy saddle
#

And because for lower level stuff its “better”

viral bison
#

also, i have performance tracking on my OS too

hazy saddle
#

Ooo nice

devout path
#
    bool had_threads = (threads != NULL);

    struct thread* new_thread = malloc(sizeof(struct thread));
    memset(new_thread, 0, sizeof(struct thread));

    new_thread->stack = malloc(STACK_SIZE);
    memset(new_thread->stack, 0, STACK_SIZE);
    new_thread->stack_top = (void *)(((uintptr_t)new_thread->stack + STACK_SIZE) & ~0xFULL);

    new_thread->is_user_task = 0;

    uint64_t *stack = (uint64_t *)new_thread->stack_top;

    *--stack = (uint64_t)task_quit;
    if (entry_point == NULL) {
        entry_point = task_quit;
    }
    *--stack = (uint64_t)entry_point;
    *--stack = 0x202;
    for (int i = 0; i < 15; i++) {
        *--stack = 0x0 + i;
    }

    new_thread->rsp = (uint64_t)stack;

    struct thread_node* new_node = malloc(sizeof(struct thread_node));
    new_node->thread = new_thread;

    if (!had_threads) {
        new_node->next_thread = new_node;
        threads = new_node;
    } else {
        new_node->next_thread = threads->next_thread;
        threads->next_thread = new_node;
    }

    if (had_threads) {
        shouldSchedule = 1;
    }
}```
viral bison
#

so i can do flamegraphs

devout path
#

oh sorry didn't send in code block

devout path
hazy saddle
devout path
#

yes

viral bison
#

i would suggest something btw: you create a kernel thread that is just idling, and set it as the currently executing thread

#

so you never have a null current thread

#

i create an idle thread per core

hazy saddle
#

I mean that null thread for some reason in most cases NEVER gets executed

viral bison
#

so each core will always have a thread

devout path
#

it stops the PIT from doing funny shiz while the dummy still has a NULL :)

#

wellllllllllll

#

heh

#

lemme see im kinda stupid rn

viral bison
hazy saddle
#

I dunno

viral bison
#

and also stopping the isr handler

hazy saddle
#

the other threads execute perfectly

#

as many as i add

#

just the first one i add breaks

viral bison
#

are you creating the idle thread the same as the other?

hazy saddle
#

this is a NULL thread not an idle thread

#

i dont have idle threads mmLol

viral bison
#

make an idle thread

#

that just spams pause

#

done

devout path
#

wouldn't that be

#

not optimal

viral bison
#

it is optimal

hazy saddle
#

i can make the null, thread be a idle thread mmLol

viral bison
#

or well, you can make it request to schedule again after a few ms

hazy saddle
viral bison
#

yeah, that might cause problems

hazy saddle
#

code highlighting

void create_thread(void (*entry_point)(void*)) {
    bool had_threads = (threads != NULL);

    struct thread* new_thread = malloc(sizeof(struct thread));
    memset(new_thread, 0, sizeof(struct thread));

    new_thread->stack = malloc(STACK_SIZE);
    memset(new_thread->stack, 0, STACK_SIZE);
    new_thread->stack_top = (void *)(((uintptr_t)new_thread->stack + STACK_SIZE) & ~0xFULL);

    new_thread->is_user_task = 0;

    uint64_t *stack = (uint64_t *)new_thread->stack_top;

    *--stack = (uint64_t)task_quit;
    if (entry_point == NULL) {
        entry_point = task_quit;
    }
    *--stack = (uint64_t)entry_point;
    *--stack = 0x202;
    for (int i = 0; i < 15; i++) {
        *--stack = 0x0 + i;
    }

    new_thread->rsp = (uint64_t)stack;

    struct thread_node* new_node = malloc(sizeof(struct thread_node));
    new_node->thread = new_thread;

    if (!had_threads) {
        new_node->next_thread = new_node;
        threads = new_node;
    } else {
        new_node->next_thread = threads->next_thread;
        threads->next_thread = new_node;
    }

    if (had_threads) {
        shouldSchedule = 1;
    }
}
hazy saddle
viral bison
#

and also is harder to do than just an idle thread

devout path
#

if u are still in ur

hazy saddle
#

i am rn

devout path
#

pc

#

oke did u try?

#

wat happend

hazy saddle
#

im looking at the diff rn

#

this might make thread exit when it shouldnt?

#

leme test

devout path
#

hmmmmmmmmmmmmmmmmmmmmmmmm

#

test it

#

in theory it should work

hazy saddle
#

we arent crashin

devout path
#

YOOOOOOOOO

hazy saddle
#

can i remove dummy thread maybe?

viral bison
#

also, you will need to add xsave and xload in the ctx switch too

devout path
#

i think

viral bison
#

if you are doing SIMD stuff

hazy saddle
viral bison
#

no

hazy saddle
#

kernel should not use SIMD/MMX

viral bison
#

for all

devout path
#

theoretically.. it stops PIT from preempting while the dummy still has a null.. it only enables shouldSchedule once the run queue already has a thread

viral bison
#

you might have kernel threads too

#

and they do benefit a lot from simd

devout path
#

im only good at theory @hazy saddle pardon ;-;

hazy saddle
devout path
#

XD

hazy saddle
devout path
#

well

viral bison
#

also, why the PIT...

hazy saddle
#

lazy

devout path
#

^^ same reason

viral bison
#

it's so bad

devout path
#

if it works it works

viral bison
#

it works very bad

devout path
#

wat should a scheduler be like XD

viral bison
#

i use APIC to for scheduler

hazy saddle
#

this pit shouldnt make me need a dummy thread

devout path
#

hmm yeah makes sense

hazy saddle
#

deleting this makes me not need dummy thread it seewms?

#

(i mean adding comments)

devout path
#

most likely

viral bison
#

also, why it crashes?

#

what exception it throws at you?

hazy saddle
#

dosnt crash anymore

#

it was GPF and or PF

hazy saddle
#

wait i still need to test real hardware

devout path
#

okeoke

viral bison
hazy saddle
#

this is the diff

devout path
#

Test

#

Hi

#

My discord ain't working on my pc

#

What the sigma

devout path
#

Yra

#

Yea*

hazy saddle
#

ok let me do a real hardware test\

devout path
#

Okeoke

#

Pray it doesn't gpf

#

I would cry

hazy saddle
#

even smaller mmLol

viral bison
#

9 AM

#

wow

#

6h behind me XD

hazy saddle
#

Uhhhh sooooo errrmmm @devout path

devout path
hazy saddle
#

Your not gonna like this

devout path
#

IT GPF?!?!?

#

OMAGHGAH

#

WELP BACK TO DEBUGGING

hazy saddle
devout path
#

HUUUUUUUUUH

hazy saddle
#

This is with the inline assembly

devout path
#

i think so

viral bison
#

have you tried kvm?

#

send me the iso a sec

hazy saddle
#

Let me try it with the should schedule

viral bison
#

i'll try to load it with kvm

devout path
hazy saddle
devout path
#

The script is built for kvm

#

THAT'S CONFUSINGG

#

Maybe it is a cpu bug...

hazy saddle
#

Let’s try it without the interupt shit

devout path
#

Oke

hazy saddle
#

And shit disabling and setting should schedule

devout path
#

Absolute computer science work here

viral bison
#

lets' try on multiple kvm devices

#

and see

hazy saddle
#

Just a moment

viral bison
#

can't you just send the iso?

hazy saddle
#

There is no ISO

viral bison
#

...

devout path
#

Build -> fail-> refactor until we win

viral bison
#

how do you launch it with kvm then?

hazy saddle
#

I tell QEMU to use the project folder as a file system to mount and the bootloader can read from
There

viral bison
#

which bootloader?

hazy saddle
#

limine

devout path
#

limine

hazy saddle
#
    qemu-system-x86_64 \
        -machine q35,accel=kvm \
        -cpu host \
        -m 512M \
        -drive if=pflash,format=raw,readonly=on,file=./OVMF_CODE.4m.fd \
        -drive if=pflash,format=raw,readonly=on,file=./OVMF_VARS.4m.fd \
        -drive format=raw,file=fat:rw:. \
        -boot d \
        -audiodev pa,id=speaker -machine pcspk-audiodev=speaker
viral bison
#

how does it work without iso...

hazy saddle
#

like that nicotroll

devout path
#

so it's simulating a fat file system yeah?

hazy saddle
#

yup

viral bison
#

i use these flags, lol

hazy saddle
#

thats the patch

viral bison
#

how do i even use patch files?

hazy saddle
#

its a git thing

devout path
#

yeah

hazy saddle
#

git should let you import it

devout path
#

git apply

hazy saddle
#

cat patch.patch | git apply i think

devout path
#

oh i only run git apply <patchfile>

#

and it works

viral bison
#

it works

#

the os i mean

devout path
#

@hazy saddle i will be back in an hour tryna figure out hwo to make this scheduler

hazy saddle
devout path
#

expect me to fail so correct me XD

hazy saddle
#

not on real hardware with that patch

devout path
#

but i will be here chatting XD

#

while i code

viral bison
#

that's so strange

hazy saddle
viral bison
#

use flanterm...

devout path
hazy saddle
#

no

devout path
#

heh

#

LMAO

#

indeed no

hazy saddle
#

i diddnt know flanterm existed

viral bison
#

...

hazy saddle
#

then i made my own think

viral bison
#

lol

hazy saddle
#

and i dont wana admit defeat mmLol

devout path
#

well i mean it's quite fun building an os and having stuff completed

#

but i find more fun tryna find bugs like these

viral bison
#

gl testing on your pc without printing all the regs

devout path
#

XD

hazy saddle
devout path
#

xd

viral bison
#

how can the panic panic

hazy saddle
#

it uses the TTY

#

which is whats causing panics

viral bison
#

WHY

hazy saddle
#

because when i did it without it my code was a mess

viral bison
#

...

hazy saddle
#

its fineeeeeeee

#

It could still panic even without using the TTY mmLol

#

Some fucking how

#

@devout path we aren’t panicking yet

devout path
#

AYOOOOOOOO

#

NICE NICE

#

WE'RE GETTING SOMEWHERE

hazy saddle
#

Bad Apple is running

devout path
hazy saddle
#

It’s faster

devout path
hazy saddle
#

But it also fucks up the bad apple demo

devout path
#

oh damn

hazy saddle
#

Fuck it what happens if I grab flanterm

devout path
#

XD

hazy saddle
#

Will it be faster

viral bison
#

yes

#
  • support all bash chars
#

and has it's own allocator

#

i use flanterm + nanoprintf

hazy saddle
#

Damn nice

viral bison
#

work very good

hazy saddle
#

What font is it gonna use lmao

viral bison
#

but it should have a default one

devout path
#

she gave up XD

hazy saddle
#

Add flanterm as a git sub module maybe

devout path
#

ngl flanterm is good

viral bison
#

also, i highly recommend nanoprintf

#

very easy to implement

hazy saddle
#

Hey atleast I can say I did make a working terminal myself

#

And then I take the better one for realisies

#

@viral bison @devout path should I have an external folder where I put all the sub modules in maybe?

#

Like it will be /src/kernel/external/flanterm

viral bison
#

maybe

hazy saddle
#

And then if I need to I can make symlinks that go there from other places

viral bison
#

i just make CMake get them

#

and also update

hazy saddle
#

I use regular make files

viral bison
#

and use github to autobuild llvm for me

#

so i can download the binaries easily

devout path
#

u can always just add that to ur make file

hazy saddle
devout path
#

oh yeah

#

yes yes

hazy saddle
#

added to credits and its sub moduled in

#

uacpi can also go in that folder too

#

and nanoprintf

devout path
#

ooh

hazy saddle
#

everyone deserves credit :3

#

even stackoverflow

devout path
#

which tells me

#

i forgot to credit limine on my os

#

oh wait nvm i haven't published that

#

im using grub

#

ok im stupid

#

:D

hazy saddle
#

oh wait both of you if you want @devout path and @viral bison can be in my credits under the good friends section XD

devout path
#

oke oke :DD

hazy saddle
devout path
#

will u keep ur current scheduler or would u like me to make an optimal scheduler?

hazy saddle
#

I can probably add the full limine to the credits which u could

devout path
#

i think i already have a good idea

hazy saddle
#

It dosnt even support multiple user threads yet mmLol

devout path
hazy saddle
#

maybe mark as an issue if it dosnt have code to merge but just ideas?

devout path
#

oke oke

#

i'll put code too dw

#

so i can practice

viral bison
#

you just need to trampoline them into usermode first

hazy saddle
#

i know but they need extra context swithcing logic for see registerd

viral bison
#

no

#

only if you enable simd

hazy saddle
#

well if a thread has simd then i have to fo thoes

#

and user threads will have simd enabled

#

and it is a kernel thread that tromplines

viral bison
#

you can't enable simd just for 1 thread tho

#

..

#

why

hazy saddle
#

the context saving and switching

#

other threads arent meant to use them

viral bison
#

you just need to trampoline once i think

#

per thread

hazy saddle
#

once per new thread

viral bison
#

yeah

#

i have a function is asm specifically for that

#

instead of setting the RIP of the new thread to the program code, i set the RIP to the trampoline, and pass the program RIP as a second parameter

hazy saddle
#

it seems nanoprintf is header only so i wont submoudle it

#

but it still goes into the external folder because its not being modified

viral bison
#

you can look at my Terminal.cpp for how to use it

hazy saddle
#

hopefuly symlinks work with git

#

@devout path this looks good

devout path
#

oooh nice nice

hazy saddle
#

shit im gonna have to rethink this

devout path
#

take ur time

hazy saddle
#

i dont think sub modules are right for this exactly

devout path
#

welp

#

back to the drawing board it seems

hazy saddle
#

nah ive already got it

#

and im adding eveyrthing to creddits

#

i can use this

devout path
#

ooh nice nice

#

wat os are u using

hazy saddle
#

cachyos

devout path
#

wait wa

#

no that was not the question

#

wait what

hazy saddle
#

arch derivitive

#

linux

devout path
#

ohh

#

ohhhhhhhhhhhhhhhhhhhhhhh

#

ok nvm i thought i asked wrongly

#

nvm i thought i asked what os are u making

#

my eyes aer deceiving me now

#

oke oke

hazy saddle
#

@devout path jusr a few more patches and we are good

#

Holy shit it’s so much faster

#

I do not regret this

#

Making a printf and terminal shit is kind of an ass

devout path
#

ooh niceee

#

:000

hazy saddle
#

im gonna end up refactoring alot

#

another "Small Refactor"

#

and usinf flanterm i can restore the other print messages

viral bison
hazy saddle
#

it dose

#

when you press enter

#

it goes to the right place when the shell starts

viral bison
#

no i mean backwards and left/right

hazy saddle
#

oh mmLol

#

im too lazy for that right now

devout path
hazy saddle
#

it can print this properly now

#

with nanoprintf

viral bison
#

yep, so good

hazy saddle
# devout path XD

I’m just moving around every single header file and re structuring it nicotroll

#

I might also change the make file up a bit

#

“Small” things

#

Like also completely changing the tty and printf backend

#

Well il call it “Small” Refactor 2: Electric Boogaloo

devout path
#

xdddd

#

totally small

hazy saddle
#

And then the next will be “Small” Refactor 3: Tokyo Drift

#

Holy this shit is instant on physical hardware

#

HOW

viral bison
hazy saddle
#

Wait what

#

Isn’t it still going through the same limine frame buffer

viral bison
#

and you have the full speed of the cpu

#

instead of it being virtualised

hazy saddle
#

But my implementation was slow as shit

viral bison
#

poor code

hazy saddle
#

I mean i would write every character to the screen weather null or not etc

#

But how dose this reach this kind of insane speeds

#

Jesus Christ

devout path
#

niceee

#

ooh

hazy saddle
#

wayyyy better

#

now to di this everywehrr

devout path
#

ayeee

devout path
#

go sleep ;-;

#

imma sleep now

hazy saddle
#

no

devout path
#

XD

#

i nneda sleep XD

hazy saddle
#

im gonna finisht he headers

devout path
#

i haven't worked on the os yet cuz i have band rehearsals tmr

hazy saddle
#

then tomorrow reorganise

devout path
#

welp good luck with that XD

hazy saddle
#

and then redo VFS

#

and then commit

#

the big beautiful commit /s

devout path
#

xd

hazy saddle
#

im also gonna add an IDE setup readme for KATE

hazy saddle
#

Alright @devout path

#

And this isn’t even half way done

#

This is what I have left to do

#

I am gonna eat and then sleep

viral bison
#

it's free for community use

devout path
hazy saddle
#

a much much MUCH better panic is almost done

hazy saddle
#

back to the old 8x8 font and trying to find the best ascii art fot this

gentle quest
#

me when i want to read some info about the crash but half the screen is occupied with drawings KEKW

hazy saddle
#

this one might be a little too bgi

marble ridge
#

lol

hazy saddle
#

i think this should do

#

this is the new finished kernel panic using flanterm + nanoprintf

viral bison
hazy saddle
hazy saddle
#

added some colors to make it easier to read the seperate sections

#

may tweak them later

hazy saddle
#

@marble ridge I might of found an issue with flanterm nicotroll

I’m trying to use my 8x8 font with it and it works in emulator but on real hardware I get a TF and by changing the font to NULL it will then work on real hardware

I have tried

  • hard coding the font instead of generating it from my old font (endianness needed to be changed, it might be a nice option to be able to have flanterm flip the font too)
  • adding padding to the font so it takes up 256 glyphs which is what flanterm seems to want
  • diffrent ways of giving the pointer to flanterm

Sending code in a sec once my computer is back in linux

Also sorry about the ping

#
    ft_ctx = flanterm_fb_init(
        NULL, NULL,
        framebuffer_request.response->framebuffers[0]->address,
        framebuffer_request.response->framebuffers[0]->width,
        framebuffer_request.response->framebuffers[0]->height,
        framebuffer_request.response->framebuffers[0]->pitch,
        framebuffer_request.response->framebuffers[0]->red_mask_size,
        framebuffer_request.response->framebuffers[0]->red_mask_shift,
        framebuffer_request.response->framebuffers[0]->green_mask_size,
        framebuffer_request.response->framebuffers[0]->green_mask_shift,
        framebuffer_request.response->framebuffers[0]->blue_mask_size,
        framebuffer_request.response->framebuffers[0]->blue_mask_shift,
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, (void*)font8x8_basic_ft,
        8, 8, 1, 0, 0, 0
    );
static const uint8_t  __attribute__((unused)) font8x8_basic_ft[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ,
gentle quest
#

i think oberrow ran into that

#

the fix was increasing some buffer or something idk

hazy saddle
hazy saddle
#

Thank you

#

(Stack trace failed because this was built without symbols)

hazy saddle
#

cleaned up the dependancies section and got patching support to patch dependancoes

hazy saddle
marble ridge
#

ah

hazy saddle
#

I fixed it by increasing the size of the bump allocator

marble ridge
hazy saddle
#

Is a bit annoying to have to do that with the patch file and stuffs

marble ridge
#

interesting

#

thanks for letting me know

hazy saddle
#

Np, could just increase the default size to be a bit bigger just incase

#

Or let you specify it with a #define before including it

#

Because afaik you have to edit the .C file as it’s not defined in header file

#
-#define FLANTERM_FB_BUMP_ALLOC_POOL_SIZE 873000
+#define FLANTERM_FB_BUMP_ALLOC_POOL_SIZE 0x180000
#

this is the patch i made

hazy saddle
#

got sub modules working properly now instead of the get deps script

marble ridge
#

have you actually checked that the init function didn't return NULL because it failed to allocate?

hazy saddle
#

i have not but i am not using malloc or free with it? it should be using the internal bump allocator no?

marble ridge
#

yes but as you figured, the internal bump allocator can run out of space :p

hazy saddle
#

oh right but what would i do when it runs out of space?

#

i can catch it from TFing but then there is no tty? or i can deley it to where malloc works

marble ridge
#

well, there is something Flanterm can do

#

and it does do already, but only for big screens, not "the font is so small that it takes too much space"

#

that being limiting how big the Flanterm box will be

#

so that is something we can do, that, or obviously using your own allocator

hazy saddle
#

I’ve just implemented my patching system so it can automatically increase the bump allocated space l. I can use my own allocator but I don’t wana setup a ring buffer to store a few prints before that gets setup

hazy saddle
#

Once nice thing would be to be able to define that define from my own code and not having to patch it myself

gentle quest
hazy saddle
hazy saddle
hazy saddle
devout path
#

XD nice

hazy saddle
#

Oh and I got sub modules working

#

And patching of sub modules is supported

devout path
hazy saddle
#

That

devout path
#

XDD

devout path
#

fell asleep last night so i couldn't reply

#

took a short nap of 14 hours

hazy saddle
#

I’m gonna work on some more and sleep again

#

I think all I have left is the VFS rework

#

Having it all in one list will make ls be way easier to implement too

devout path
#

yeaaah

hazy saddle
# devout path yeaaah

I mean even if it’s linear it’s still a VFS with the read write function indirection

#

And caching can be done easily

#

If a file is searched for a lot put it to the cache that gets searched first

#

And I can cache ls operations

#

I could even use a hash map for the cache so that would be really fucking fast?

#

It gives me a lot of flexibility to make things be super simple but still be possible to be fast

devout path
#

wat if a balanced binary search tree?

#

oh wait nvm

hazy saddle
#

And the cache is just pointers

devout path
#

less complex = less of a headache

hazy saddle
#

@devout path so much simpler

#

now to make things register properly

hazy saddle
#

i think mega refactor is complete

#

except the makefile ugh

hazy saddle
#

and we are LIVEEE

#

i forgot to edit the readme about the get deps script 💀

#

it dose it automaticaly on make with the sub modules

#

well next commit with page table switching can fix that mmLol

devout path
#

nicee ;000

hazy saddle
devout path
#

yes

#

i ahven't done any os dev today so xd

hazy saddle
#

My friend can’t get theirs to work so they are gonna steal mine once it’s done

devout path
#

XD

#

how are u oging to design the scheduler @hazy saddle

#

a simple roundrobin scheduler?

hazy saddle
devout path
#

oh im stupid

#

i completely forgot

hazy saddle
#

But I need to extend support for user tasks better

devout path
#

o oke oke

hazy saddle
#

And there is no such thing as sleep mmLol

#

So I might extend it to do that too have have awake timers

devout path
#

im tryna make a scheduler that implements redblack trees

hazy saddle
#

And to reset the PIT timer

#

Because the bad apple program expects that functions

hazy saddle
#

I could maybe implement that safer and changing the speed and then putting it back after coming to another thread

#

Or just add sleep mmLol

devout path
#

just

#

add sleep XD

#

cuz

hazy saddle
#

Also my kernel has a sleep thread

#

It’s the kernel main

#

That has a halt loop

devout path
#

oh

hazy saddle
#

So when there is nothing to schedule it should? Drop back to there and sleep

devout path
#

ooh

#

that's a hacky solution for it

hazy saddle
#

It just happened naturally XD

devout path
hazy saddle
devout path
#

oh nvm XD

#

fair point

devout path
#

this*

hazy saddle
#

So much as changed

devout path
#

wat da sigma

#

and u did this in a day ? crazt

#

crazy

hazy saddle
devout path
#

XD

#

daamn

#

go slep or somethin

hazy saddle
#

I’m staying up to 8pm

#

To get regular schedule

devout path
#

i slept a good 14 hours earlier

#

xd

devout path
hazy saddle
#

Was this really a lot of work tho XD

#

Just some refactoring of stuff

devout path
#

im just lazy iz all XD

#

my brain wouldn't comprehend a shit ton of refactoring

#

that's why i plan in advance

hazy saddle
#

It’s just shuffling some stuff around and fixing up systems

hazy saddle
devout path
#

ooh

devout path
#

or well i just compliment alot

hazy saddle
#

@winged basalt moving over here

winged basalt
#

I've started building System level tools and utilities in C to get started for my own OS project

#

It'll take a few months but definitely worth it 😊

hazy saddle
#

Small update: the day after tomorrow I should have some more time to start working on things

#

@warped ermine because you wanted the link too il also ping you here

#

Just incase

warped ermine
#

hai

#

:3

hazy saddle
#

:3

hazy saddle
#

I do need to put stack trace symbols into the initramfs so I don’t have to compile twice for builds

#

That should be part of this next update

hazy saddle
#

i have now gotten a basic serial port driver working finnaly

#

it will not take in input as thats still through PS/2 but il be making a /dev/kbd to glob all the keyboard inputs together along with a /dev/term/serial for outputting to the serial device directly and for now printf and /dev/term/tty will goto serial

#

Reading from /dev/term/tty will give keyboard input from there and writing will output there of course

#

I should maybe reroute reads to /dev/term/tty to that new /dev/kbd for inputs

#

I know this isn’t the new userspace stuff but I’m working on another secret project that needs me to document the serial port and I need quick serotonin by making something work ralseisplat

#

oh wait i diddnt even call my init function and it still works XD

#

there we go. it now properly calls it and code respects checking if it properly was setup before using it just incase

hazy saddle
#

serial port now acts as a keybaord!

#

and it works in the shell thing too with qemu

devout path
#

ooh noice noice

hazy saddle
#

aswell serial and ps2m input get globbed into /dev/kbd

#

it will cause desyncs with other buffers but if they all use one its all good

#

and when i have open and close il flush the buffer when opening to fix that

#

also wait @devout path im commenting my code

#

why would i ever do this

hazy saddle
#

@devout path guess what. Tomorrow when I wakeup if I have the energy I am going to get multi app userspace working and then start being able to port a ton of fun stuff

#

And then it’s gonna be like

#

And then il probably add signals pipes forks other stuff after doom and basic other stuff perhaps

devout path
#

nice nice

hazy saddle
# devout path wai wha

I try to avoid magic numbers and funny stuff in code so I don’t have to comment it a lot

#

But this is just a ton of magic numbers go brrrr

hazy saddle
#

None

#

I’ve been a bit busy with other projects

#

I am starting to get the scratch to work on it more

#

And the code base has been for the most part fully cleaned up so should go smoothly

#

And then I’m gonna be porting a libc + doom and core utils

#

Maybe il get multi frame buffer (monitor) support and SMP later?

#

So I could have two instances of doom at once

#

And once I get USB I could have one computer two people playing doom multiplayer maybe with a crude TCP/IP that’s loopback only?

#

Could be neat

#

Hey loop back networking could be something my kernel has and windows dosnt heh

#

(They broke it in one of the updates XD)

devout path
#

aww

#

i've been tryna learn zig xd

#

sorry late reply i slept the whole day

#

ooh nice nice

devout path
hazy saddle
#

@devout path I think I’ve got page cloning half way done

#

This code dosnt crash the system

#

So really fucking good

#

And it should be creating the top level dummy pages

devout path
#

uuuuuuuuuuuuuuuuuuuuuh

hazy saddle
#

So when I go and clone them it should all work

#

That get next level function also allocates with the true flag set

#

So that’s why it looks kinda stoopid

#

But this should mean the top 256 parts of the PML4 should be allocated

#

And they won’t get deallocated

devout path
#

oooh fair fair

#

should work in theory yes yes

hazy saddle
#

Next should just be a memcpy of the PML4 I think

devout path
#

yes yes

hazy saddle
#

@devout path hows this look

#

Wait I did malloc the wrong size

#

thats better

#

This is using services from the VMM but they shouldn’t be used until after init so it’s fine

#

The service being malloc

sudden mirage
#

Let me tell you that I've did this and lost a lot of precious code I wasn't able to find again :<

hazy saddle
#

my kernel was originaly remaking that one

sudden mirage
#

Since then I started making a temporary directory for performing any git operation besides add/commit/push

hazy saddle
#

could prolly automate that

devout path
#

very sad moments in life

devout path
#

this looks perfect

hazy saddle
#

im reallyt nervous here haha

devout path
#

wait why xd

hazy saddle
#

because its looking like its going good

devout path
#

hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm

hazy saddle
#

and im not gona have to bang my head against the wall heh

#

and thats usureaboutthat

#

a lil sus

devout path
#

for redundancy

devout path
hazy saddle
#

my create thread is gonna take in a page map

#

and if its null it will be the kernel page map

devout path
#

yeaaa

#

uuh do u have a lower half

hazy saddle
#

yeh yeh thats where my userspace is

#

i have code runnign in ring3 already

#

just no proper mapping switches etc

devout path
#

so the line copies the entire pm4 table right?

#

im lazy to check so lemme ask u

hazy saddle
#

which line

devout path
#

it won't completely start a new process with a completely empty userspace no?

#

u didn't map it to userspace, the kernel pagemap i mean

hazy saddle
#

cloning happens from the root kernel mappings

#

which will have nothin down there

#

eg this

devout path
#

dya use recursive paging?

devout path
#

oke oke

hazy saddle
#

the kernel page map is the clean one made by the kernel pre userspace

#

so i can use that easi;ly

hazy saddle
devout path
#

where the last entry points to pml4 itself

#

oke i guess u don't

#

anyways

hazy saddle
#

i never understood it

devout path
#

i dont mind

#

i mean i think it's all good

#

what the hell came out of my keyboard im sleepy as hell

devout path
#

kinda avoids the which comes first problem

#

of needing page table entries

hazy saddle
#

it dosnt have the type

#

its in the header file

#

and its included

devout path
#

heh???

hazy saddle
#

oh i forgor the name

devout path
#

oh

hazy saddle
#

XD

devout path
#

OH

#

YEAH that's kinda funnny XD

hazy saddle
#

WE ARENT CRASHING

devout path
#

LES FUCKIN GOOOOOOOOOOO

hazy saddle
#

Now I would want to make some test programs that run in the same virt but diff phys