#Nyaux

1 messages ยท Page 2 of 1

surreal path
#

๐Ÿ˜ญ

#

how much memory should i allocate for the entire queue,

#

since like

#

they will be growing and shrinking

finite summit
#

sizeof(queue)

surreal path
#

and shi

finite summit
#

the queue is a linked list

#

not an array

surreal path
#

okay so just allocate memory for each thread_t struct, and have that link

#

cool

surreal path
#

so i setup a "thread" i guess to represent the kernel

#

okayyy

#

okay it worked as expected

#

i guess i have a "thread queue" now

#

@finite summit okay what should i do now ๐Ÿ˜ญ

kind root
#

bruh this aint a scheduler

surreal path
#

what is it then

kind root
#

this just memcopies regs

wicked loom
#

it's spinup code, i guess

#

ideally spinup code should be separate from the scheduling algorithm

#

that said this is once again a purity argument just like yesterday and vmms vs not-a-vmm

#

i mean, this is more of a reasonable argument

#

at least it's not just semantics/definitions

kind root
#

have u looked at switch task?

#

it literally doesnt switch task

wicked loom
#

scheduling algorithm: raw maths, portable
spinup code: platform specific, not portable

wicked loom
kind root
surreal path
#

sorry if this sounds stupid โ˜ ๏ธ

kind root
#

to switch task to the context provided

surreal path
#

okay

kind root
#

well rip is also a register

#

so if u load it

#

u already jumped to it

surreal path
#

yea

wicked loom
#

technically rip isn't quite a register

#

at least not in the normal sense, on x86

kind root
#

yeah

wicked loom
#

i assume when they say registers they meant more like GPRs and control registers

surreal path
#

i really dont know what to do, is switch_task called when an interrupt happens? is this at least correct

wicked loom
#

it's just a function

#

you call it wherever you think it is appropriate to do so

#

which could be from a scheduler

#

which itself could be triggered by an interrupt

#

(this is how it is done in Vinix/Lyre)

surreal path
#

okay then triggered from an interrupt

#

lets go

#

okay so for the sched interrupt i should probs have it without the pop instructions cause yea

#

or it doesnt rlly matter anyway

surreal path
#

i dont know what im doing

#

๐Ÿ˜”

#

i rlly do not know how to implement a scheduler, i dont know how its supposed to be implemented

#

๐Ÿ˜ญ

#

i think i may have a case of the big stupid

surreal path
finite summit
#

indeed

surreal path
finite summit
#

indeed

surreal path
finite summit
#

cool

#

lgtm

#

except maybe the page map should be in cpu_context_t

surreal path
#

yea fair

finite summit
#

as that's related to the context of the thread and not the thread itself

#

also you might want to consider storing the tid of the thread in thread_t

surreal path
#

tid?

finite summit
#

thread id

surreal path
#

fair

#

okay so function switch_task will just get the next thread in the queue then switch_context will be an asm stub to load the context?

#

yea?

finite summit
#

yeah

surreal path
#

okay now i have to somehow get this struct from c into asm and use it, since im getting the address of the context struct into rdi i guess thats how ill access it

surreal path
finite summit
#

doesn't really matter what order you do it in

#

I just do it in that order because I can just add rdi, size_of_member

#

and continue on with the next element

surreal path
#

kk

surreal path
#

and what if i get to the instruction where i have to like

finite summit
#

just mov rsp, rdi and popaq

surreal path
#

oh fair

#

lmao

finite summit
#

then of course you can skip over any int number/error code things

#

and iretq

surreal path
#

this should work then

#

i think

#

how can i like test this

#

i dont have the interrupt for a scheduler setup, how is this gonna like work with the isr stubs

#

im like rlly confused

#

@finite summit im gonna like eat u i swear (not sexual intent)

#

๐Ÿ˜ 

surreal path
#

shows how we have devolved as a society

cinder plinth
#

ideally you should just pass the stack in every isr stub and have your scheduler one be a normal isr stub

cinder plinth
#

fuck

#

wish i had my wsl

surreal path
cinder plinth
#

to show you code

surreal path
#

then just get your wsl setup

#

fix ur wsl

#

easy

#

๐Ÿ˜Ž

cinder plinth
#

this'll have to do

cinder plinth
#

even a fresh debian wont open

#

I'll fix it someday

surreal path
#

ok back from shower

surreal path
#

those instructions will never be run

#

so why

#

are you having those instructions there anyway

finite summit
#

They might

#

Check if anything returns in whatever intr timer handler does

surreal path
#

but like

#

it shouldnt execute lapic_eoi or the return instruction cause we do a context switch

finite summit
#

It's probably there for completeness

surreal path
#

and for some reason theres this function call AFTER it??

#

after we do the cpu_switch_context

#

in the sched_tick function

finite summit
#

Then what probably happens is context switch just copies the regs

#

Into the rsp

#

Returns

#

Then it returns into intr timer handler

#

Which returns into the asm stub

#

Which returns into the new thread context

surreal path
#

it just copies the registers into the frame

surreal path
#

makes my life easier ig

#

๐Ÿ˜Ž

finite summit
#

What if you want to free the thread stack

#

You'd need to keep the base and size somewhere in the thread context

surreal path
finite summit
#

you should've sent that message one minute later

#

then they would've been an hour apart

surreal path
#

im just in the hospital rn

#

so kinda hard to like

#

do stuff

#

when your getting your blood tested and ecg n' stuff

finite summit
#

uhh

#

maybe wait until you are discharged

#

from the hospital

wicked loom
#

the ishowspeed incident of 2023

surreal path
#

mint suki more like mint coki which also means mint cookie so that comfirms that mintsuki is a mint cookie in real life

#

๐Ÿ˜ฑ

wicked loom
#

mint chip

surreal path
#

chippi chippi chapa chapa

#

im big brain chat

#

(not really)

#

this should be epic gamer

#

this should actually work now

#

but i need

#

a function to like

#

create threads

#

okay lets make a create_thread function or smthin

surreal path
#

๐Ÿ˜Ž

#

lets go

#

๐Ÿ˜Ž ->->->your mom

#

hmmm weirdddd

#

its page faulting at the if statment

#

and the rip of the current stack frame is the hcf function in main.c (which is what i do after sched_init)

#

i triggered the interrupt manually

#

in sched_init

#

okay fixed that but now its halting somewhere

#

oh so the instruction where i try to pop r15 causes it to go broken

#

okay so this is causing everything to go fkn'd up

#

dont know why

#

okay i fixed

#

but still triple faulting

#

probs gp'rd

#

MORE DEBUGIGGN!!!!

#

cr3 before switch, cr3 after switch

#

yea somethings wrong here

#

tf ๐Ÿ˜ญ

#

oh wait no its valid

#

so if what im doing is valid

#

why is it triple faulting, this stack should be mapped????

#

oh wait

#

forgot to cast

#

to address

#

โ˜ ๏ธ

#

still triple faults

#

!

rigid fable
surreal path
#
isr_stub_32:
    push 0 ; fake error code lmao
    push rbp
    push rax
    push rbx
    push rcx
    push rdx
    push rsi
    push rdi
    push r8
    push r9
    push r10
    push r11
    push r12
    push r13
    push r14
    push r15
    push 32
    mov rax, 32
    mov rdi, rsp ; put value of stack pointer into paramter 1 of c interrupt handler
    mov rax, [idt_handlers + rax * 8]
    call rax
    mov rsp, rdi
    add rsp, 8 ; skip int number
    pop r15
    pop r14
    pop r13
    pop r12
    pop r11
    pop r10
    pop r9
    pop r8
    pop rdi
    pop rsi
    pop rdx
    pop rcx
    pop rbx
    pop rax
    pop rbp
    add rsp, 8 ; skip fake error code
    iretq
#

this is the stub

#

cpu registers look like this

#

wtf

#

rsp doesnt look valid

rigid fable
#

as you can see here the x86 processors (amd64) do not support push imm64, which you are trying to do with pushing the value 32. You are then trying to skip that 4 byte value by adding 8 bytes.

surreal path
#

oh

#

โ˜ ๏ธ

#

wait

#

lemme fix this

#

push QWORD 32

#

okay

#

okayokay

#

i get u

#

still triple faulting tho

#

lemme see log

#

this time a general protection fault and OH MY GOD

#

WTF

#

WHY DO THE REGISTERS LOOK ALL FUCKED LIKE THAT

#

๐Ÿ˜ญ

rigid fable
#

Let me write it better, with some extra research

surreal path
#

okay

rigid fable
#

In hope someone else reads this, and improves instead of just stating it is wrong

rigid fable
#

The issue: when using the instruction push 32
both NASM and FASM generate the same as push byte 32
which means they generate the values 0x64 0x20
What you may want to do is push qword 32
Unfortunately that is not possible on the amd64 instruction set.
From the image above you can see there is no push imm64 instruction.
On a side note:
NASM will simply continue to produce a push byte 32
FASM will produce a push dword 32

#

now. You are probably trying to get the number as a 64 bit value (uint64_t in the struct) and you are also trying to add 8 to the rsp, while assuming that the number is 64bit wide

surreal path
#

you may be right

#

i know how to fix this

#

please wait

rigid fable
#

I would also just write a macro in assembly to easily generate the push num push err and then jump to a common stub

surreal path
#

heres what ill do

#

im gonna make the interrupt number just an int

#

and add rsp, 4

rigid fable
#

can you show me your struct?

surreal path
#
struct StackFrame
{
    uint64_t intnum, r15, r14, r13, r12, r11, r10, r9, r8;
    uint64_t rdi, rsi, rdx, rcx, rbx, rax;
    uint64_t rbp, error_code, rip, cs, rflags, rsp, ss;
} __attribute__ ((packed));

what it looks like currently now

kind root
#

it pushes the byte as a qword

#

so their code is right

surreal path
#

im gonna decompile and see what the code looks like

kind root
#

misaligned pushes are not a thing

#

in 32 bit mode all pushes are 32 bits, in 64 bits - 64

#

upper bytes are zeroed

surreal path
#

this is decompiled

surreal path
#

so WHATS CAUSING IT TO FKN THE STACK ๐Ÿ˜ญ

#

it should just work

#

like what the actual fuck

rigid fable
surreal path
#

sorry

#

WE HAVE SCHEDULING

#

๐Ÿฅณ

#

WE HAVE A SCHEDULER

#

WE HAVE A FUCKING WORKING SCHEDULER

#

CHAT

#

LETS FKN GOOOOOO

rigid fable
#

Do not be happy. You should still check for major bugs in your code

surreal path
rigid fable
#

are you doing this stub for each interrupt?

surreal path
#

cause it returns value

#

which goes into rax

#

yea

rigid fable
#

is this the timer interrupt? Why do you want it to return a value?

surreal path
#

sure "timer" interrupt

#

i need to return the stack frame

#

cause yea

#

to reload the registers

#

@finite summit omar guess who has scheduling

#

i do ๐Ÿ˜Ž

#

@kind root will i try and setup uacpi maybe now? halfmemeright

#

i have a scheduler

kind root
#

i mean give it a try

surreal path
#

kk

#

๐Ÿ˜Ž

kind root
#

it doesnt need a scheduler unless u want event which u dont at this point

surreal path
#

๐Ÿ˜Ž

kind root
#

events are things like power button presses etc

surreal path
#

in order to init

#

and create the acpi namespace

surreal path
kind root
surreal path
#

lemme just test my scheduler

#

with 2 THREADS????

#

๐Ÿ˜ฑ

#

2 kernel threads

#

what will happen chat

#

we have 2 threads working

finite summit
surreal path
#

i dont have disk drivers

finite summit
#

io is port io

#

outb()

surreal path
#

oh

#

lmao

#

โ˜ ๏ธ

finite summit
#

and stuff

kind root
finite summit
#

My kernel is so cool that it can implement all of the kernel api

#

without bugs*

kind root
#

Why would acpi need disk drivers

surreal path
#

IDK

finite summit
surreal path
#

what is this for????

#

huh??????

finite summit
#

it's a handle type thing

#

that is for port io on x86-64

#

read my kernel api code

kind root
#

Acpi is not x86 only

sleek gazelle
#

yeah but port io is x86 only

#

acpi isn't x86 exclusive though

#

its just there for x86 pcs with acpi

kind root
sleek gazelle
#

?

#

mmio != port io

kind root
#

Port io is a thing on all architectures

#

On some its done as mmio tho

#

Not a separate instruction

#

Run qemu-system-arm and do info pci

sleek gazelle
#

yes it does exist on architectures other than x86 but doesn't the architectures supported besides x86 don't have port io?

#

only mmio?

kind root
#

No

sleek gazelle
#

you're just making it more confusing man

kind root
#

PCI has io ranges on every architecture

#

Dont shoot the messenger lol

sleek gazelle
#

i was talking about port io as in the ones in x86

#

not pci

kind root
#

Yes I was talking about that as well

sleek gazelle
#

which means its only available on x86 and other architectures with port io

kind root
#

No

haughty kite
tawdry mirage
#

aml can talk to pci

kind root
haughty kite
#

ah of course

kind root
#

All power management and chipset specific stuff is there

surreal path
finite summit
#

memory mapped io

wide nexus
#

timer and scheduler

surreal path
wide nexus
#

jk idk u do u

#

thats how I did it

surreal path
#

i have a scheduler

#

how do i get like

#

a timer

#

how do even

#

timers work

wide nexus
#

pit?

#

hpet acpi timerw

#

u should look into pit first

surreal path
#

i dont think ill be touching pit

#

thats like

#

legacy crust

wide nexus
#

but it works wonders for simple schedulers

#

anyways if u want something new then go with acpi timers

#

"new"

#

new enough ig

finite summit
#

I use HPET for calibrating the LAPIC timers

surreal path
#

smp looks way too complex

#

i dont think my os will have smp

#

thats a feature!

#

!!!

#

๐Ÿ˜ฑ

elder shoal
surreal path
#

how is smp fun

elder shoal
#

Fun as in you will have to redo a lot of things because they werent built with smp in minds

surreal path
#

thats for

#

future me to deal with

#

๐Ÿ˜Ž

finite summit
#

in my previous kernel

#

it took me weeks to fix all smp-related bugs

#

I recommend you at least code with SMP in mind

#

So you don't feel like shooting yourself if you ever change your mind

surreal path
haughty kite
#

whats the problem?

#

string.h is the header that contains like strcmp and shit

kind root
#

read the readme my man

surreal path
#

reading it

#

what are theese for???

cinder plinth
#

printf

surreal path
cinder plinth
#

these are for printf

surreal path
#

i dont have printf

#

i have my own functions for logging sure

#

but i dont have the actual "printf" implemented

kind root
#

this is unrelated to printf

#

well it is and isnt

#

its the standard inttypes.h header that your compiler ships

#

you can just include that and copy this

surreal path
#

i use gcc

cinder plinth
#

PRI literally means print doesnt it

kind root
#

these specifiers are used inside *printf* functions

kind root
kind root
surreal path
kind root
#

that doesnt tell me anything

surreal path
kind root
#

uhh

surreal path
#

it doesnt think the include exists

kind root
#

pretty sure that's a freestanding header

surreal path
#

tf

#

if it is

#

why isnt it

haughty kite
kind root
#

oh well

#

ill just spell it out

#

or rather

#

just copy oberrow's header

haughty kite
#

im sure it has zero correlation to these screenshots im posting

kind root
#

ohh damn lmao

#

inttypes defines that crap? TIL

surreal path
#

im looking for it

#

wait

#

found it

kind root
#
#define PRIx64 "x"
#define PRIX64 "X"
#define PRIu64 "u"

he does this which doesnt look correct tbh LULW

#

it should be "lx" "lX" and "lu" if using LP64

surreal path
#

LP64?

#

i do not follow

surreal path
kind root
#

yeah thats correct

#

oh wait i was looking at his old kernel

kind root
#

In computer architecture, 64-bit integers, memory addresses, or other data units are those that are 64 bits wide. Also, 64-bit central processing units (CPU) and arithmetic logic units (ALU) are those that are based on processor registers, address buses, or data buses of that size. A computer that uses such a processor is a 64-bit computer.
Fr...

haughty kite
#

thats why its not freestanding

#

so plz stop using it

kind root
#

very smart decision by the standard

haughty kite
#

a classic

kind root
# haughty kite so plz stop using it

i mean, it specifically says in the readme

exports a minimal subset of libc helpers that uACPI utilizes. This should only be overriden if your kernel's standard library is fundumentally different from libc.
#

if you dont have inttypes.h u just override the header

surreal path
#

doing that doesnt work

#

it still saying

#

that error

kind root
#

which

surreal path
#
src/ACPI/uACPI/include/uacpi/internal/utilities.h: In function 'uacpi_truncate_phys_addr_with_warn':
src/ACPI/uACPI/include/uacpi/internal/utilities.h:12:48: error: expected ')' before 'PRIX64'
   12 |             "truncating a physical address 0x%"PRIX64
      |                                                ^~~~~~
kind root
#

ffs

#

i thought i fixed that..?

surreal path
#

?

kind root
#

that's supposed to be using UACPI_PRIX64

#

lemme fix that real quick

#

no isolated builds so this never came up

surreal path
#

bruh

#

tell me when u fix

#

so i can git clone

kind root
#

1 second

cinder plinth
#

meanwhile you could just #define PRIX64

kind root
#

yeah just do that for now ^

#

have both defined

surreal path
#

ok git cloning

kind root
#

what

surreal path
#

git cloning uacpi?

kind root
#

but i didnt update anything LULW

surreal path
#

โ˜ ๏ธ

cinder plinth
#

git pull

surreal path
#

no

#

i do it

#

the worst way possible

#

๐Ÿ˜Ž

kind root
#

@surreal path okay git pull

#

thats for finding the issue

surreal path
#

ok git cloning

#

@kind root dont have strncmp or strcmp or strnlen or snprintf but compiler didnt complain about that?

#

weird

kind root
#

Wait until u get to linker

surreal path
#

oh do i need these functions

#

i dont have strncmp or strcmp

kind root
#

Ofc you do

kind root
surreal path
kind root
#

Steal from somewhere then

surreal path
#

kk

kind root
#

Also for printf there are stand-alone headers

#

Although I dont remember their names

surreal path
#

TRY REMEMBER THEM RN !!!

kind root
#

There's an stb printf that oberrow implemented I think

cinder plinth
#

nanopritnf

kind root
#

Or that

surreal path
#

stole this strnlen from apple

#

size_t
strnlen(const char *s, size_t maxlen)
{
size_t len;

for (len = 0; len < maxlen; len++, s++) {
    if (!*s)
        break;
}
return (len);

}

#

๐Ÿ˜Ž

#

literarly

kind root
#

I doubt thats what they use but seems to work

kind root
#

I mean thats prob some default fallback

surreal path
kind root
#

Its offsetof

surreal path
#

what

#

oh thats a function

#

never heard of it before

surreal path
#

time to steal some implmentation for it

#

๐Ÿ˜Ž

kind root
#

Just include stddef

surreal path
#

i did

#

yea it should work

#

ok now its time

#

for kernel api

#

yay

kind root
#

Yay

surreal path
#

just do this for every function ๐Ÿ˜Ž

surreal path
#

iodk

kind root
#

Yes

#

That works

surreal path
#

ok ez

surreal path
kind root
#

This is a normal malloc

#

So almost always this will be a few tens of bytes

#

Sometimes a few pages

surreal path
#

ima do a check

#

to make sure

#

else ill allocate a vmm region

kind root
#

That should probably be handled by slab alloc instead but yeah

surreal path
#

tried defining at top of file

#

compiler still complained

kind root
#

Do u know how C works?

surreal path
#

yes

kind root
#

This define must be propagated to all of uACPI

#

So it must me defined by the compiler or at the top of that header

surreal path
#

okay

kind root
#

If u just put it in that C file it only affects that

#

I mean it cant magically change all callsites right

surreal path
#

didnt work

kind root
#

What's the error?

surreal path
kind root
#

I mean

#

It says kernel api header defined it as one parameter

#

U sure u put it in the right place?

surreal path
#

after pragma

#

once

#

wait no

#

now its compiled

#

compiling*

kind root
#

Huh

surreal path
#

okay fixed the issue about UACPI_SIZED_FREES

surreal path
#

i dont have a timer

#

i dont have ticks

#

i dont have anything

kind root
#

Return some random constant number

surreal path
#

just random number?

#

any number?

kind root
#

46644

surreal path
#

kk

kind root
#

Lmao

surreal path
#

๐Ÿ˜ญ

kind root
#

Did you actually believe it has some special meaning?

surreal path
#

yes

kind root
#

In that case

#

Return 384728

surreal path
#

โ˜ ๏ธ

#

i cant do this

kind root
#

384726 is known to cause segfaults

kind root
surreal path
#

๐Ÿ˜ญ

kind root
#

Just dont spin

#

No one will notice I promise

surreal path
#

๐Ÿ˜ญ

#

okay

#

i dont have a mutex

#

what do i give uacpi

kind root
#

Stub out

surreal path
#

i can?

kind root
#

Anything thats not null

kind root
surreal path
#

uhhhh

#

i give it 0

#

๐Ÿ˜Ž

kind root
#

That will be treated as out of memory

surreal path
#

uhhh

#

1

#

๐Ÿ˜Ž ๐Ÿ˜Ž

kind root
#

Lmao

surreal path
#

๐Ÿ˜Ž

kind root
#

Yes

surreal path
#

instantly happens

kind root
#

That's because your kernel is too fast

surreal path
#

exactly

#

๐Ÿ˜Ž ๐Ÿ˜Ž

#

what do i do?

kind root
#

What do you think?

#

Same thing u did before

surreal path
#

return 1;?

kind root
#

Yes

surreal path
#

bruh

kind root
#

Looks like you aren't compiling printf

surreal path
#

how

#

ITS RIGHT THERE

kind root
#

Thats just the header

#

You're probably supposed to compile it somehow

surreal path
#

yea the entire thing is the header

kind root
#

Read its manual

surreal path
#

oh i fixed

#

uh oh !

kind root
#

Yeah disable floats

surreal path
kind root
#

Yeah u implement it only in one file, not all of them

surreal path
#

only here i did

kind root
#

Thats a header file

surreal path
#

oh

kind root
#

Its copy pasted into every c file

surreal path
#

โ˜ ๏ธ

#

Tf is this

kind root
#

Yeah this one you will have to steal

#

Mint had a library for this

surreal path
#

give

kind root
#

@wicked loom remind us pls

finite summit
surreal path
#

im setting up uacpi

#

im just trying to get it to compile ๐Ÿ˜ญ

finite summit
#

I mean you could use libgcc

kind root
#

Alternately tell gcc ur running on a cpu with popcnt

surreal path
tawdry mirage
kind root
surreal path
kind root
#

Coo

#

Yeah im predicting your allocator just getting obliterated

surreal path
#

IT COMPILED

kind root
#

Cool

kind root
#

Ask oberrow KEKW

surreal path
#

oh no

#

oh noes chat

#

im scared

kind root
#

But maybe not who knows

#

Now initialize it

surreal path
#

so sketch

surreal path
kind root
surreal path
#

it does

#

my vmm always zeros memory

kind root
#

OK then

kind root
surreal path
kind root
#

Same place u looked for pri

kind root
finite summit
#

show what, allocator region init code

kind root
#

uACPI init code

finite summit
#

k

#

but why mine specifically

surreal path
#

just give it rsdp?

kind root
#

Managarm is more scattered around

kind root
surreal path
#

kk

#

does limine give the rsdp address + hhdm

#

or is it a physical address

kind root
surreal path
#

im guessing uacpi wants physical

#

so

#

gonna remove the offset

kind root
#

Yee

surreal path
#

this might just

#

die

#

well see chat

kind root
#

Lets see

surreal path
#

INSTANT

#

PAGE FAULT

#

like

#

INSTANT

#

nah thats crazy

kind root
#

Lol

surreal path
#

nano print shit

wide latch
#

love that you didnt rename it from limine-c-template

surreal path
surreal path
#

!!

kind root
#

Lol

surreal path
#

okay now why is nano print shit

#

page faulting

#

hmst

#

chat what am i doing stupid (ive never used va_list)

kind root
#

Looks correct to me

surreal path
#

so why tf

#

page faulting

#

๐Ÿ˜ญ

kind root
#

vsnprintf

surreal path
surreal path
kind root
#

Takes in a list

surreal path
kind root
#

Yup

surreal path
#

why is it saying that

#

what is needed here

#

to "enter acpi mode"

#

or whatever tf

kind root
#

raw memory helpers

surreal path
#

i no understand

#

me brain ๐Ÿ’ฅ

kind root
#

Read

#

Header

#

Look at oberrow code

#

Then give up

surreal path
#

โ˜ ๏ธ

kind root
#

I'm off to bed but will check your progress tomorrow

surreal path
#

okay

#

goodnight

#

!

kind root
#

Thx

surreal path
#

np

surreal path
#

๐Ÿ‘๏ธ

steady ermine
#

sucessfully linking a library into an os kernel is a minor achievement in itself anyway

finite summit
# surreal path

very descriptive and professional variable names we got here

#

uint64_t rsdp nah we got uint64_t shit

steady ermine
#

perfect fit to be a ms windows dev

wintry ermine
#

Suggestion,
Info -> mrrp
Warn -> nyaa
Error -> kyaa
Panic -> x.x

surreal path
#

hi chat im back

#

when i come home from my doctors appointment ill

#

get back to

#

setting up uacpi!

#

@kind root you love my os dont you!!!! because i use uacpi !!!!

surreal path
#

!!!!!

#

I SHOULD DO THAT

#

@wintry ermine THAT WOULD BE SO KAWAII >.<

wintry ermine
surreal path
wintry ermine
#

I'm nyot a catgirl for nyothing 894768044025462804

surreal path
#

!!!!

#

real !

wintry ermine
#

:3

surreal path
#

okay i will now try to

#

intialize uacpi

#

will it explode

#

who knows

#

yea cause basically

#

im allocating pages

#

for very small sizes

#

what should i do @kind root , add another slab to my slab allocator to handle these sizes or ?

kind root
#

No idea

#

Oberrow does tho

surreal path
#

ill do what omar does for the billtionith time

#

!!

wintry ermine
#

Nya panics

surreal path
#

still running out of memory

#

i have these many slabs already

#

is there nothing i can do

#

@kind root

#

wtf do i do

#

it just

#

runs out of memory

tawdry mirage
#

how are you running out of memory

#

are you failing to allocate 4 pages?

kind root
#

How much memory do you have lol

surreal path
#

gave it 3G

kind root
#

And after 3 allocations u run out of memory?

surreal path
#

somehow

#

wait

#

yea wtf

#

its happening in

#

calloc

#

oh

#

andddd

#

of course its my slab allocator

#

here

#

slabs are full

#

tf is going on

#

some weird shit is going

#

on

#

wtf

#

theres something VERY

#

weird

#

going on

#

sometimes it page faults

#

sometimes it goes out of memory

#

sometimes it

#

just waits a while

#

THEN goes out of memory

#

wtf

surreal path
#

something VERY weird

#

the compiler is doing something

#

everytime i compile and change a few lines that SHOULDNT affect anything

#

i get different error

kind root
#

Welcome to oberrow hell

surreal path
#

fuck

#

@finite summit is this what you were talking about

#

do i have to

#

redesign my entire

#

memory

#

management

#

for this shit

kind root
#

Just

#

Fix the bug

surreal path
#

HOW

#

THERES

#

SO MANY

#

FUCKING

#

WEIRD CASES

#

EVERYTIME I CHANGE A LINE OF CODE

kind root
#

4HEad just

surreal path
#

๐Ÿ˜ญ

slow vale
#

osdev do be like that sometimes ๐Ÿ˜‚

surreal path
#

SOMETIMES IT FAULTS HERE

#

SOMETIMES IT FAULTS THERE

#

SOMETIMES IT RUNS OUT OF MEMORY

#

its my fucking slab allocator

#

HAS

#

to be

slow vale
surreal path
surreal path
#

tf

#

i didnt

tawdry mirage
#

node->flags = vmm_head = node

surreal path
#

realize

slow vale
surreal path
#

โ˜ ๏ธ

#

chat i just

kind root
surreal path
#

fixed but

#

still

#

that stupid

#

that stupid stupid stupid

#

slab allocator

#

FOR SOME REASON

elder shoal
#

You should add a register dump to your panic

surreal path
#

SLABS SHOULD BE SETUP

#

WTF

#

NO HEAD?

slow vale
surreal path
elder shoal
elder shoal
# surreal path yea

I dont think you should be calculating how many objects fit in the slab by dividing the pagesize by the object size then

elder shoal
#

4096 / size

tawdry mirage
#

you need to account for the header when computing the amount of elements that fit

surreal path
#

that better?

tawdry mirage
#

no

#

how large is a slab_entry

surreal path
#

8 bytes ig

tawdry mirage
#

afaicu what you want is a slab_header at the start, then pairs of slab_entry and space for the object?

#

in which case size needs to include the slab_entry size

surreal path
#

okay so (4096 + (size * sizeof(struct slab_entry)))

#

correct?

tawdry mirage
#

no

surreal path
#

okay im stupid

slow vale
surreal path
#

andy is 15

#

bro got xorg on his os

#

โ˜ ๏ธ

slow vale
#

so? there are people who are 70 who don't know how to use a mouse, cut yourself some slack

surreal path
tawdry mirage
#

(4096 - sizeof(slab_header)) / (size + sizeof(slab_entry)) ?

sleek gazelle
#

use mine as reference i guess

surreal path
#

pain

sleek gazelle
#

also i use slab for allocations bigger than 1024 so it should be fine

elder shoal
#

Id send mine but mine is overengineered

#

So wouldnt be helpful

surreal path
#

i cant read c++ code very well

surreal path
elder shoal
surreal path
#

okay at this point im gonna have to rewrite the entire slab allocator

#

this design is shit

#

i dont understand it cause this was made for my old os

#

which i just yoinked

#

so like

#

yk

elder shoal
#

You should read more about slabs to understand them and how to implement them

surreal path
#

read more about them

elder shoal
#

I understood them from a chapter in a book I read but you can probably read the slab paper too

#

I dont have the link rn

surreal path
#

whats it called

#

the book

elder shoal
#

Unix Internals: The New Frontiers

surreal path
finite summit
#

I'm happy I escaped from it

surreal path
#

i might implement the SLUB allocator

#

the slub allocator looks fun

#

to implement

#

and im watching a great lecture

#

on it

#

.<

#

@kind root @finite summit yall think i should do it ? >.<

#

it would be so kawaii

finite summit
#

sure

#

idc

surreal path
#

๐Ÿ˜ 

#

i have the urge

#

to rewrite

#

the entire memory management system

#

cause everything rn is held up together with tape

#

โ˜ ๏ธ

surreal path
tardy hull
#

:3

rigid fable
#

:3

surreal path
#

actually

#

im not rewrting the slab allocator

#

i learned more about slabs to the point i think i can solve the issue

surreal path
#

actually i think i may have a way

#

to instantly fix this

#

but it will

#

take a lot of memory

#

more slabs troll2

#

nvm

#

this is pain

#

this is hell

#

get me out of this hell

#

memory management hell

#

help me lord please

#

give me mercy

surreal path
#

I HATE THIS I HATE THIS I HATE THIS I HATE THIS

GET ME OUT

#

LET ME OUT

#

LET ME OUT

#

LET ME OUT

#

LET ME OUT

jaunty hingeBOT
#
Anti-spam Message

Possible spam detected for user: linuxmaster2.0. Please contact a moderator to be unmuted.

finite summit
#

lol

#

should I tell the mods

#

they'll notice on their own

surreal path
#

okay so

#

everytime i try to implement a slab allocator i fail

#

like every fkn time, i tried doing from scratch but it just faulted

#

and i cant seem to fix it

finite summit
#

just copy my allocator

surreal path
#

no

finite summit
#

yes

surreal path
#

why would i copy your shit

finite summit
#

MIT license

finite summit
surreal path
#

its c++ code anyway

finite summit
#

C++ code that can be easily ported to C