#Nyaux

1 messages · Page 46 of 1

surreal path
#

but i already realized the issue

#

was to why we page fault

#

its a stupid issue really

#

on sched_yield i never push the userspace regs

#

i just assume its already been done

#

therefore im corrupting the stack

rigid fable
#

@surreal path is it true what nyaux supports 64 bit hpet ????!!?!!!

surreal path
#

it supports both 32 bit and 64 bit hpet now

surreal path
molten grotto
#

only thing you have to be careful with 32-bit hpet is overflow

surreal path
molten grotto
#

I wonder how do you even solve that, I haven't really though about it

surreal path
#

just a bunch of if statements

#

read src lol

molten grotto
#

like if the counter wraps around every 7 minutes or whatever (with 10mhz) and a thread sleeps for 8 minutes

surreal path
#

wha

#

i dont have thread sleeping yet

molten grotto
#

yeah you don't but its something that I am not completely sure how do you solve

surreal path
molten grotto
#

if you don't save them somewhere else like an interrupt frame then probably

surreal path
#

yep

#

and also i still dont understand @flat nymph thing he found that is an issue

#

or well with my design

#

ill have to ask him more questions on that in the meantime

#

im wayyyyy too hurt to work my finger hurts typing this

#

😭

kind root
molten grotto
# molten grotto yeah you don't but its something that I am not completely sure how do you solve

actually nvm, I guess you just install an irq and then you keep some kind of 64-bit offset to which you add the current counter value when reading and when you get a wrap irq you increment that by UINT32_MAX?

In non-periodic mode, the OS programs one of timer's comparator registers with value of main counter that is to trigger an interrupt. If the timer is set to 32 bit mode, it will also generate an interrupt when the counter wraps around.

elder shoal
#

Yeah I just use an irq for 32 bit hpet

rigid fable
#

now i can test nyaux on my pc !!!

surreal path
#

anyways i think ill be good on saturday to work my arm and leg are feeling better

#

im taking off the plasters and like

#

the um

#

wounds look pretty bad

#

😭

surreal path
#

however fast my body decides to heal

#

im still in pain sadly

rigid fable
#

@surreal path can you say what hpet you supported earlier

plush hearth
rigid fable
#

poor nyaux

surreal path
#

i took off most of the plasters

#

the wounds look worse then i thought

#

thought they were scrapes or smt

#

but they are like

#

ew

#

i dont even wanna describe it

#

its good tho we will do work after i sleep

#

i know how to fix the yk what

surreal path
#

and its been nearly a week

plush hearth
tender gorge
surreal path
#

my bad

#

was sleeping

#

btw

#

i promise u monday i cannot do today or tmrw its my brothers birhtday and my dads not letting me use my laptop because im always on my laptop on the birthdays and hes mad abt that nooo

#

monday tho i SWEAR

#

no excuses

#

hold me accountable for monday, monday is where ill fix most things and get started on the vfs after fixing the issues with the kernel mutex

plush hearth
surreal path
#

im lucky yea

surreal path
#

:^)

surreal path
plush hearth
surreal path
#

😭

#

even my gf is mad about it

plush hearth
#

You could fix it

#

The simplest way is just to stay up until a reasonable bed time tomorrow for you

surreal path
#

i cant

#

legit cant

#

lol

plush hearth
#

The other option is to slowly improve it by going to bed later and later over time until you get to a normal time

#

You can

surreal path
#

im good

surreal path
rigid fable
#

who ping

surreal path
#

hi chat

#

lets work on

#

nyaux!!

surreal path
#

bru

surreal path
#

yo i have been debugging this for a while

#

things are weird

#

there is a bug where it dies on push into list??

#

like

#

i made sched yield actually have the threads registers before calling schedd

#

save*

#

like

#

the behavior is so weird

#

i couldnt figure it out

#

but ill keep trying to

surreal path
#

not just that

#

usually it still dies

#

idk its weird

surreal path
#

now its not even doing that anymore\

#

idk

#

this shit weird

#

;no

flat nymph
#

fix your sleep schedule angr

surreal path
#

no

surreal path
#

this is one of the behaviors

#

its mostly consisent

#

no idea whats causing it tho

#

at all

finite summit
#

lesgo nyaux development is back

#

!!!

surreal path
flat nymph
surreal path
#

how

#

HOW

#

i changed how i do scheduling

#

from putting it on the kstack to

#

putting the frame on the thread itself

#

:(((

#
global sched_yield
extern schedd
global load_ctx
global save_ctx
extern memcpy
save_ctx: ; (new frame in rdi, old frame in rsi)
    test rsi, rsi
    je .escape
    mov rdx, 176
    call memcpy
    .escape:
    ret
load_ctx:
    mov rsp, rdi
    add rsp, 8
    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
    iretq
sched_yield:
    mov ax, ss
    push ax
    push rsp
    pushf
    lea rax, [rsp+8]
    mov ax, cs
    push ax
    push rax
    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 qword 0

    ; push gs                  ; Save previous state of segment registers
    ; push fs
    mov rdi, rsp
    call schedd
#

my code

rigid fable
surreal path
#

bru

#

still not figuring it out

surreal path
#

sigma sigma boy sigma boy

#

hi guys im awake

#

i slept at 6am

surreal path
rigid fable
surreal path
surreal path
#

hi i keep sleeping

#

im still eepy

surreal path
#

yoyo after i eat in like an hour

#

we will get back to debugging

surreal path
#

okok

#

we back

surreal path
#

this is a struggle to debug im going to be straight honest

#

i need to proof read the code ig

#

for ze scheduler at least

surreal path
#

i have to sleep now cause i have an appointment tomrrow

surreal path
#

no im awake

#

no

#

no im not giving up

#

never i will never EVER give up on nyaux

#

i just found out somethings up with the context switching itself

#

its going back to the same instruction

#

and repeating it

#

so our saving context is not working?

#

i believe this is where our issue lies

#

everyone is asleep

#

😭

thorn bramble
#

memcpy is crazy

surreal path
#

whats wrong with memcpy chat

thorn bramble
#

nothing

#

just

#

an Interesting way to accomplish the task

#

that's exactly what a C compiler would do

surreal path
#

bad way?

thorn bramble
#

any particular reason

#

this isn't written in C?

thorn bramble
#

so no, not bad

#

but the magic numbers go crazy

#

or rather one magic number

#

i know what it is im js

surreal path
#

nahnah i get you

#

its good man dw

thorn bramble
#

so what doesn't work today

#

i am not keeping up at all with this thread

surreal path
#

kernel mutex and the context saving

thorn bramble
#

or any other thread

surreal path
#

kernel mutex is a difficult one sinec its a race condition

#

its hard to catch

thorn bramble
#

interesting

#

i'm not good at that so good luck i won't be able to help

surreal path
#

its okay dw

kind root
#

hows nyaux

surreal path
#

umm

#

well

#

struggling on a bug with context switching

#

specifally conterxt saving

#

to which im not finding out ze issue

#

im afraid

kind root
#

find it 😡

#

I had a dumb uacpi bug yesterday

#

val = func() | func() << 8

surreal path
surreal path
surreal path
#

"small nap"

#

famous last words

#

i just fucking woke up now

surreal path
#

okay

#

that is very weird

#

@finite summit

#

yo

#

heyyy

#

how are you

finite summit
#

hi

#

good

#

alhamdulillah

surreal path
#

yea fair 😭

finite summit
#

yeah idk what's happening

#

with ur bug

surreal path
#

me either

#

how long have we been having this bug now

#

a day

#

ig

#

so i have to keep debugging

#

more

#

if my debug skills are gonna be improved i gotta do this for a few days

#

before asking for help

#

if i dont find it on friday or whatever ill ask for help

#

anyways

#

@finite summit wanna watch me live stream debugging nyaux?

#

in #voice-0

finite summit
#

going to sleep

#

in a few minutes

surreal path
#

ahhhh fairrr

finite summit
#

after cleaning up the receive code

surreal path
#

goodnight man

finite summit
#

gn

#

gl on your debugging

surreal path
#

thanks

#

i found ze issue

#

frame is unsued

#

unused

finite summit
#

lesgo

surreal path
#

💀

#

that wasnt the issue

#

this is the issue

#

memcpy takes 3 parameters as yall know

#

dest src and cnt

#

i have put the new frame as the destination

#

which is fucking stupid

#

💀

#

☠️

#

@finite summit no way right

finite summit
#

bru

surreal path
#

@thorn bramble thats insane isnt it

#

all fixed

#

well

#

not the kmutex

thorn bramble
#

cool stuff

#

good work

surreal path
#

thanks

#

but i gotta fix the kmutex

thorn bramble
#

u got this

surreal path
#

thanks man

#

yield is broken it seems

#

wait no

#

thats not yield

#

uh whats going on

#

gdb time

#

i may need to do this no 1

#

because i am corrupting other functions stacks

#

i need to do a mov rbp, rsp

#

as c is treating me like a function

#

shit

#

i have no idea

#

how to make this work

#

because id be overwriteing rbp

#

overwriting

#

what

thorn bramble
#

how tf can u use this terminal filter

#

i dont get it

surreal path
#

open windows terminal

thorn bramble
#

i know

surreal path
#

open ubuntu

thorn bramble
#

im js

#

i dont understand

surreal path
#

right click ubuntu

thorn bramble
#

how u can

#

BEAR IT

#

i know how to set it up

surreal path
#

oh

#

i like it

thorn bramble
#

i just couldn't

#

☠️

surreal path
#

fair

surreal path
#

im unsure

thorn bramble
#

yeah i like my text readable yk

#

yeah i think

#

why do you think

#

it's a problem

#

stack traces? or what

surreal path
#

cause

#

im being called by c

thorn bramble
#

so what

#

as long as you leave the stack in the same state as it was before leaving

#

you are fine

surreal path
#

i wont leave

#

sched yield wont leave

thorn bramble
#

why

#

you will eventually

#

return to where you yielded from

#

or maybe not

#

but in the case you will

#

yield has to return to the caller

surreal path
#

okay

#

but

#

i dont think this is correct for getting the rip

#

plus im overwriting rax

#

which i somehow shouldnt so this makes it so difficult cause like how am i gonna do anything without any registers

#

i have an idea

#

hacky but it works

thorn bramble
#

LMAO

#

epic

surreal path
#

no i didnt try it yet

#

💀

#

its 48 not 40

#

thats not the rip

#

💀

thorn bramble
#

like genuinely how do you read this

#

am i just blind

surreal path
#

yes

thorn bramble
#

fair enough

surreal path
#

thats also wrong

#

this is still wrong

#

ima take a break for like a short while

#

cause my head isnt there right now

#

good to know we fixed one bug today

#

just one more we need to fix today

#

well two if i can somehow figure out kmutex

#

today

#

what ze fuck

#

then the ffffffff is here

#

wtf

#

thought i was gonna take a break btw

#

but

#

nah

surreal path
#

ughhhhh

#

this is so hard to write

#

this is so hard

#

ughhhh

#

yea i need a break for a bit

#

cpu is trolling me i swear

rigid fable
#

a

#

I wrong read

rigid fable
supple robin
#

just call a c fn

flat nymph
#

why am I seeing you mess with segment registers

surreal path
surreal path
#

i need to push ze registers

#

was busy today

#

so didnt have time to check discord

surreal path
#

ok im gonna be straight honest

#

i need to fix my sleep schedule

#

like

#

i REALLY

#

need to fix it

#

i will attempt to sleep early and wake up 2pm

#

not feeling like i wanna work on nyaux rn

#

will see in a bit

#

dont feel amazing

surreal path
#

fuck you im working on it

tawdry mirage
#

okay

surreal path
#

im questioning if i have to save the old rsp val too

#

looks like i have to worry about this too

surreal path
#

hate my life

#

im writing addresses down like a mad man

#

im losing it chat

rigid fable
#

what are you trying to do

surreal path
#

sched yield

#

im gonna throw myself out the window

#

for some reason the cpu isnt dereferencing rsp??

#

like BRO

rigid fable
surreal path
rigid fable
#

with []

#

if you want to get a value in rsp + 8

#

just move it to rax mov rax,[rsp+8]

#

or just push it push qword [rsp+8]

surreal path
#

that solved that yes but

#

getting the old rsp value is giving me garbage

#

old rsp right

#

now its garbage

rigid fable
#

for what you need this

surreal path
#

to recreate a stackframe

#

to iretq later on

rigid fable
#

and how src looks

surreal path
#
global sched_yield
extern schedd
global load_ctx
global save_ctx
extern memcpy
save_ctx: ; (old frame in rdi, new frame in rsi)
    test rsi, rsi
    je .escape
    mov rdx, 176
    jmp memcpy
    .escape:
    ret
load_ctx:
    mov rsp, rdi
    add rsp, 8
    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
    iretq
sched_yield:
    push rsp ; old rsp val + 8
    push rax ; + 8
    push qword [rsp+16] ; + 8
    mov ax, ss
    push ax ; + 8
    
    push qword [rsp + 24] ; + 8
    pushf ; + 8
    ...
odd flame
#

🤷 idk either

#

also that terminal hurts to look at

rigid fable
#

like is it called by interrupt

finite summit
surreal path
odd flame
rigid fable
surreal path
surreal path
cinder plinth
odd flame
odd flame
#

but i play the tenor

rigid fable
odd flame
#

how tf did you know

cinder plinth
odd flame
cinder plinth
#

i used to at school

#

tenor

odd flame
odd flame
cinder plinth
#

i was literally coltrane

rigid fable
#

@surreal path can you comment on what exactly you are pushing

surreal path
#

im pushing a stackframe

#

my scheduler expects this

#

read function schedd

#

in src/sched/sched.c

odd flame
#

what the fuck

rigid fable
#

[rsp + 24] you are getting on it as a result of push rsp

#

in 34 line

#

also this adds,subs is bad

surreal path
#

all fixed now thanks to @thorn bramble 's help

odd flame
#

@thorn bramble basically quantum physics in a nutshell

#

everytime you look it's all good

surreal path
#

i think it might be nyaux's best interest to move on from the kmutex bug and focus on other kernel things

#

yes kmutex doesnt work

#

yes we dont get schedule for work completion or any of the goodies therefore ec driver might shit on some hardware as @kind root said

#

but weve been on this for 2 weeks now

#

and kmutex isnt CRITICAL to the kernel

#

at least for the time being

#

yes even i feel shit about just leaving the kmutex bug

#

i will make a poll for this

surreal path
#

its a bug with the scheduler

surreal path
#

it seems not to be an issue of the run queue

#

it seems to be

#

something else entirely

#

context switching maybe

#

and the behavior is differetn each time

#

after a while it seems it just doesnt wanna execute code

#

wtf is going on

#

save context is broken it seems

#

it would explain all the weird shit that was going on

#

it wasnt a bug with kmutex

#

lets pull out gdb

#

what ze fuck

#

why is rip zero

#

in the old frame

#

what

#

rsi is the ne frame

#

new*

#

and the old frame

#

is the stackframe

surreal path
#

idfk

#

something really weird is going on

#

and then it doesnt even write it

#

like wtf

#

tf is it doing

#

oh

#

yea

#

makes sense

#

well ofc it would be

#

because

#

fucking

#

idk

surreal path
plush hearth
rigid fable
#

you need to call it from assembly

#

a wait

#
  1. you don't need a memcpy in asm...
#

2.you jump to memcpy

#

it's bad idea

#

because you don't push RIP to return

#

so you need call memcpy

#

anyway do it in C

molten grotto
#

also I still have no idea why use an irq frame and iretq for context switch lol

molten grotto
#

yeah but you don't need to do that in your sched switch

#

it can just switch between kernel mode threads

#

and then interrupts handle the actual returning to usermode

rigid fable
#

then what will be better than iretq ?

molten grotto
#

normal ret

#

and you only need to save callee saved regs to the stack inside sched switch in that case

rigid fable
#

how about rflags or can it be changed by other instructions ?

molten grotto
#

there are multiple ways to do scheduling ofc this is just one of them that I think works pretty well

molten grotto
molten grotto
flat nymph
flat nymph
flat nymph
surreal path
surreal path
#

plus i was called

#

by c

#

so i should have the return address

#

so the ret should work

surreal path
flat nymph
#

it is not

surreal path
#

it is

#

also mishakov

#

im in ur walls

flat nymph
#

you're doing something weird

surreal path
#

how is it weird

#

like nah it isnt

#

its good

#

i js need to figure out why its shitting itself

surreal path
#

wake up

flat nymph
#

🤷‍♂️

surreal path
#

i must spend time with my gf

#

then i will work on nyuax

kind root
#

or is that a differnt one

surreal path
cinder plinth
#

I think different

surreal path
#

nah but seriously

#

its different ya

cinder plinth
#

bro is the rizzler

kind root
#

lol

cinder plinth
#

mogging us fr

surreal path
#

real

kind root
#

nyaux gets new gf evry week

#

insane

surreal path
#

nah but this girl is actually kinda obsessed with me

#

so i think

#

the relationship will last

#

i hope anyway

#

lets not jinx it

kind root
#

but no nyaux is unironically good looking so its understandable

cinder plinth
kind root
#

lol

surreal path
#

phd code = no maidens

cinder plinth
#

I think you can actually make a correlation lol

#

it probably doesnt have meaning

#

but it is a fun coincidence

surreal path
#

nyaux will work soon

#

™️

cinder plinth
#

at the end of the spectrum you have like

#

astral, keyronex and mintia

#

I dont think matthew has a gf iirc

#

and will is gay

#

so

kind root
surreal path
kind root
#

no gf no working ps2 driver

cinder plinth
#

outlier I can think of is managarm

surreal path
#

does infy have a wife yet

kind root
#

no

surreal path
#

get one

kind root
#

but i dont change gfs every week so who knows

surreal path
#

bru

#

😡

kind root
#

lmao

#

its harder for me anyway because im not as good looking

surreal path
#

ok im sure ur not THAT bad

kind root
#

at least ive been able to consistently have decent weight and exercise etc

surreal path
#

yea u got what u need

#

just be a little more confident

#

when it comes to girls

#

and youll be good

#

who knows

kind root
#

my gf might not like if im being confident around other girls

surreal path
#

wait u have a gf

kind root
#

lol

surreal path
#

well

#

if u actually have one

#

marry her

#

soon

#

real

kind root
#

if 💀

surreal path
#

☠️

#

why am i giving a 25 year old dating advice chat

#

am i just that rizzy

kind root
#

yup

surreal path
#

real

kind root
#

its funny because if u asked me id have to think how old i was for a second

#

u kinda forget after 20ish

surreal path
#

howd u

#

forget ur own age

#

i cant imagine

kind root
#

its just not a number u think about

unkempt relic
kind root
#

i generally subtract current year from my birth year to confirm

surreal path
unkempt relic
#

i suppose because 25 is sort of a milestone

elder shoal
unkempt relic
#

i expect i'll remember my age better when i'm 30, then forget it even harder into my mid 30s

cinder plinth
#

im 17 and I forget my age sometimes 💀

surreal path
surreal path
#

nahhh

#

nahhh bros my age

cinder plinth
#

noted

cinder plinth
unkempt relic
kind root
cinder plinth
#

I'm born in summer

surreal path
#

lol

#

haha

cinder plinth
#

yea same

#

but when

surreal path
#

march

#

14th

#

get

#

trolled

cinder plinth
#

yea im younger

surreal path
#

exactly respect ur elders

#

😡

kind root
#

wtf

#

imagine nyaux as your older brother

surreal path
#

i believe @finite summit is also younger then me

cinder plinth
#

the scariest young person here is pitust

#

but I'm younger so that's an excuse trl

surreal path
#

he lives in my country so im double scared of that dude

#

bro could pull up to my house

kind root
#

uk?

surreal path
#

ireland

#

he lives in ireland

kind root
#

so uk trl

surreal path
#

bru

cinder plinth
#

north ireland or ireland

elder shoal
#

(I dont really have time, university and work take up too much already)

surreal path
#

i mean

kind root
#

i already suggested it lmfao

surreal path
elder shoal
#

😭

surreal path
surreal path
#

not the british place

kind root
#

become a mormon as well

unkempt relic
kind root
#

i've only heard people from ireland use the word grand

surreal path
#

is fadanoid also irish..

kind root
#

like not even in this server

cinder plinth
kind root
#

yeah

cinder plinth
#

🏴󠁧󠁢󠁳󠁣󠁴󠁿

surreal path
kind root
#

lol

#

close enough

unkempt relic
cinder plinth
#

if I were scottish id play golf

surreal path
#

unless u bring pizza

#

then ur welcome

kind root
unkempt relic
cinder plinth
#

I do play golf here but we get like a 4 months only when its playable

unkempt relic
#

they have to because a few of them work at a golf club

#

and i'm 5 miles away from one of trump's controversial courses

cinder plinth
#

turnberry?

unkempt relic
#

balmedie

cinder plinth
#

turnberry is apparently the most beautiful course in the world

#

i think trump decided to buy a bunch of courses in scotland because of his mother's lineage or something

unkempt relic
#

this guy and his mother were victims of that

unkempt relic
finite summit
unkempt relic
#

the isle of lewis (also the namesake of part of managarm) is devoutly religious and not loud, obnoxious, or arrogant at all

cinder plinth
#

it's a nice home

finite summit
surreal path
cinder plinth
#

scotland seems chill

#

I'd do a paul mccartney and buy a farm there for the meme

plush hearth
unkempt relic
cinder plinth
#

huh didnt know that existed

#

is any member of the team scottish?

#

I thought they were all german/dutch/polish

unkempt relic
cinder plinth
#

they ran out of deities?

unkempt relic
#

the isle of lewis was part of the kingdom of the isles, a kingdom established by the vikings

cinder plinth
#

I don't think I'll ever run out of deities with my greek theme meme

unkempt relic
#

and possibly the word is norse:

Derived from Scottish Gaelic Leòdhas, of uncertain origin; traditionally referred to Old Norse Ljóðahús, from ljóð (“song, poem”) + hús (“house”); but may be related to the Pictish name of the island recorded in Ptolemy's Geography as Λίμνου (Límnou).

cinder plinth
#

it's not like I have more than 4 components with names

plush hearth
cinder plinth
#

I try to make it logical too (atlas being the "support" library, as he is the one who supports the skies)

unkempt relic
#

you'd be in more trouble if you picked a monotheistic religion

cinder plinth
#

the name nyx is mostly a wordplay on unix tho meme

unkempt relic
#

but i suppose you could use angels etc

cinder plinth
#

yea or prophets

#

I mean templeOS had a naming scheme somewhat

#

the root of the filesystem was called Adam

unkempt relic
#

azrael can be the reaper

cinder plinth
#

moses is the AI assistant

#

he speaks the voice of god

unkempt relic
cinder plinth
#

maybe I would've called that genesis

#

or something

#

idk

cinder plinth
#

there's a store called solaris here

flat nymph
unkempt relic
flat nymph
#

Spanish

unkempt relic
#

oh i see it now

flat nymph
unkempt relic
#

extintor de incendios or something like tyhat

flat nymph
unkempt relic
#

i thought it said extintor de incendiao which sounds portuguese

supple robin
surreal path
#

i pissed of my gf today :)

#

off*

#

anyways

#

im gonna like

#

relax for a bit

#

before i go back to debugging hell

#

:^)

rigid fable
surreal path
#

nahhh we good now

#

as for if im done relaxing

rigid fable
surreal path
surreal path
#

give me like

#

an hour

#

idk

#

i cant stop watching undertale videos

#

and ksp videos too

#

average 17 year old experience

rigid fable
#

eat 7pm

surreal path
#

mhm

tawdry mirage
#

3:30am

surreal path
#

yes

plush hearth
tawdry mirage
#

did you eat 8 hours ago

surreal path
#

like

#

3am

#

was hungry

surreal path
#

dont think i feel like working on nyaux today

#

js a little exhausted

#

tmrw tho we debug

rigid fable
#

@surreal path do you fat or you are thick

surreal path
#

im thin

#

actually

rigid fable
surreal path
#

bru

surreal path
#

yea hi

#

i feel shit today as well

#

im sorry

#

but i need like to fix my sleep schedule

#

i cant live like this anymore

#

my dad said he will somehow fix it tmrw

#

by making me stay awake

#

if he suceeds on that ill work monday

#

otherwise ill force myself tmrw to work if i still have the shitty sleep schedule

#

its too difficult to work on anything like this

#

everyone is asleep

#

ur only awake

#

its dark and everything just feels depressing

#

i know u said yesterday id work tmrw

#

but please let me have this time to focus on just sleeping normally again

#

nyaux code quality will increase if i have better sleep

#

so there is a benefit to this

surreal path
#

i have a few ideas on how to debug the scheduler actually

#

even tho i want to work on it i just need to focus on sleeping normally

#

im sorry again

#

and i hope yall understand why im doing this

#

sorry about nyaux having really slow progress the last 3 weeks now

rigid fable
#
  1. you don't need gf
  2. your asm code in scheduler is terrible
flat nymph
tender gorge
surreal path
#

also

#

hi

#

my dad didnt wake me up

#

cringe

#

he said he was sleepy

#

himself

#

idk he said he ll do it monday

#

which is tmrw

surreal path
surreal path
surreal path
#

hi

#

we work today

#

just give me an hour or 2

surreal path
#

okay lets work

#

okay

#

so the fact its doing different behavior makes me think we have a race condition of some kind

#

yea i dont think so?

#

i feel like i might be corrupting something

#

maybe our timer is not firing?

#

lets check if interrupts are disabled

#

no they are enabled

#

okay so

#

weird?

#

in gdb ive been seeing where it iretqs too

#

to

#

and it iretqs to each thread normally?

#

but its stuck because someone has the terminal lock?

#

it shouldnt hto

#

because theres no kprintf call in each function

#

interrupt handler

#

or the scheduler

#

this is fucking

#

weird

surreal path
#

yea im absolutely unsure whos holding the kprintf lock

#

im still suspecting its a bug with the scheduler

#

idk i just feel like it

surreal path
#

sorry

#

something happened

#

im back

#

back to debugging

#

still dont know whats going on

surreal path
silver yarrow
#

this emoji is should be the mascot of Nyaux

surreal path
#

i keep

#

fallijng asleep

#

now im sleepy

#

my sleep schedule is still so ass

#

ugh

surreal path
#

because i am having mega pain

#

debugging this weird ass issue

#

but now

#

im really sleepy

#

help

fringe loom
#

:nyaux:

flat nymph
tender gorge
surreal path
surreal path
#

i was even prescribed new sleeping medication

#

which doesnt work

tender gorge
#

your doctors/therapists cant help you if you dont talk to them about things like this

surreal path
surreal path
#

time to debug some more

#

if i cant figure this out today im gonna actually ask for help cause im sick of this issue nooo

surreal path
#

this is hell

#

actually hell

#

i need help

#

actually

surreal path
#

i figured it out

#

the bug

#

so basically

#

the scheduler is not saving the context even tho i am

#
extern memcpy
save_ctx: ; (old frame in rdi, new frame in rsi)
    test rsi, rsi
    je .escape
    mov rdx, 176
    jmp memcpy
    .escape:
    ret
#

so what basically happens

#

they all want to do the first thing in the code

#

print something

#

so funny kprintf deadlock occurs because well

#

they want the print to the screen but oh no

#

im back at the start

#

of the function

surreal path
#

because i dont remember

#

but

#

i remember something about

#

idk

#

there was some bug that got solved with a jmp

#

im genuinely unsure why

#

could be switch queue maybe

#

i might just do it in c

#

since

#

its not actually having the context

#

okay ima try this

#

quite simple

#

nvm

#

the bug didnt solve itself

#

in fact

silver yarrow
#

this is not how I would do this at all

surreal path
#

that wasnt the bug

#

how would u do that

silver yarrow
#

push/pop

#
  1. push all registers on stack
#
  1. swap rsp
#
  1. pop all registers from stack
#

thats a context switch

surreal path
#

kk will try

surreal path
#

because

#

load ctx does that

#

not push

#

but pop

#

i dont understand

#

what are you trying to say @silver yarrow

silver yarrow
#

wdym load ctx

#

there is only switch

#

(in my impl)

#

I dont see a reason to have a save and load separately

#

that just overcomplicates things a ton

surreal path
#

okay well

silver yarrow
#

at least my impl relies on the fact that the switch happens at once

surreal path
#

can i see ur impl

#

so i can understand what ur talking about

#

cause i dont get how save context is done

silver yarrow
#

yeah, just its probably the worst to read part of my kernel

surreal path
#

in the same function

#

idc

#

let me see

silver yarrow
#

here is the assembly part

surreal path
#

ohhh ur impl is way different then mine

#

u dont store the frame inside the thread

#

u did it on the stack

#

yea what ur saying doesnt apply

#

i did it before but

#

it causes problems

#

so i switched to the simple approach

#

@silver yarrow

silver yarrow
#

what ur doing is not simple

#

id argue just saving on the stack is actually far simpler

surreal path
#

some people here aruge otherwise

silver yarrow
#

who

surreal path
#

hold on

#

i need to get their names

#

wasnt it u @thorn bramble

#

i cant remember

#

either way @silver yarrow i dont know whats going on with my bug

#

idek know whats going on in the first place

#

i thought it was that

#

but no

#

i dont know whats happening

#

something it works

#

sometime it doesnt

silver yarrow
#

can I see ur context switch

surreal path
#

yea

#
extern memcpy
save_ctx: ; (old frame in rdi, new frame in rsi)
    test rsi, rsi
    je .escape
    mov rdx, 176
    jmp memcpy
    .escape:
    ret
load_ctx:
    mov rsp, rdi
    add rsp, 8
    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
    iretq
#

im reusuing the stack frame for the interrupts

#

btw

silver yarrow
#

what is test rsi, rsi supposed to do

surreal path
#

ignore it its reduent code

#

basically previously i would have escaped if rsi was null