#Nyaux
1 messages ยท Page 11 of 1
!!!
oh wow he did it
YOU THINK I WAS JOKING HMM???
I WILL MAKE NYAUX RUN FUCKING USERSPACE IF ITS THE LAST THING I DO
Why you think my dad angry at me cause Iโve been skipping school to do osdev

okay wtf this thread has 9993 messages already and it was posted only 21 days ago??
9995th message
So this thread is pretty cool
Like cool
Pretty cool ngl
Idk what to say
10000th message
bruh
bruh x2
30 second slowmode has been enabled to encourage members to produce longer messages
NOOOOOOOOOOOOO WHO PURGED OLDER MESSAGES
no older messages got furged?
it says 9975
probably a discord moment
sms my head someone probably did it on purpose
i have this also
bruh
i know!!!! ๐
it shows how much grind i put into this os ๐
yea, been working on this OS for a straight MONTH ๐ i skip school for this
everyday i dream of kernel code. when i wake up i open vscode and start writing code
everyones trying to get the 10,000th message but yall know thats gonna be me

first osdev thread with 10,000 messages?
If you are working so much on your OS, why do you talk so much on Discord? 
ummm 
HEY LISTEN, its been a month working on my os and im already close to userspace ๐
just gotta implement syscalls and whatever and we epic gamer
I mean
last time I started writing an OS from scratch, I got to userspace in 2 weeks
well
it wasn't quite userspace
since real mode
... aaaaand that was the 10000th message
well real mode is much easier because the true power of your cpu hasnt been unleashed yet
so it wasn't you
oh frick u ๐
just delete some of your old messages until its 9999 then send one more
(dont do that)
well at least u didnt have to learn everythiing from scratch
which i did ๐
thee true power of ur cpu
ok everyone no more procrastination, time to setup syscalls!!!!
starting to feel really discouraged i guess. i feel like maybe i was being spoonfed all this time and maybe i dont understand anything and maybe i should stop doing osdev cause im stupid and dumb and i never understood anything
idk what this feeling is called ig
Dunning kruger effect
Bro why tf are you skipping school for this
Give me some of that 3am motivation
don't be
you have made excellent progress
impostor syndrome?
impostor syndrome is really stupid
as in, the concept or having it?
the concept i guess
"oh no despite the fact that i have no reason to feel like this i will choose to feel like i'm not actually who i am and feel bad about it"
like ??? lol
it's not a choice tho
i know
Yeah, imposter syndrome kinda just happens unfortunately

a vulnerability in the human brain, I guess
i am talking about the concept of impostor syndrome: it's like cancer, it's bad and no one should suffer from it
idk
well, by "finding the concept really stupid", I understood implying that impostor syndrom is not real
I kinda took it as mint saying imposter syndrome like as a concept sounds dumb on paper
like i feel like im just inherently too stupid to continue with osdev but maybe thats just wrong or
I dont think thatโs true
ill just keep trying ig. to not make the time i spent on nyaux a waste of time and a waste of time on others for helping me reach to this point
It wouldnโt be a waste for anyone, Iโm sure the people who have helped enjoyed helping, and weโre all here to learn together anyways. I donโt think you should stop OS dev because you think youโre not good enough for it
don't give up
im definitely not good enough for osdev
we all learn
and yet here i am
im not going to stop i just feel a bit overwhelmed with everything thats all
neither am I
take a break
and sleep
just ease back on it a bit
Then take some time off of osdev
don't stay up until three am doing osdev
instead of like 6-7 hours a day or whatever you're doing, just work on it for an hour or two
Yeah
or yeah take a break for a couple days
Good idea
one thing you have which i think a lot of people dont(including me) is being able to work consistently for hours on end
Very relatable
even if i work on something for a full day, i still would take breaks for at least 30 mins every few hours minimum
i cant function without taking a break to go outside or drink tea or something
okay im ready to come back to this now
not exactly an hour but 
anyways
the gs msr can store anything i want right?
its unused by the cpu
can i use it to store the stack pointer for the kernel stack cause syscall doesnt change that automatically
fs is for thread local data
i dont have to worry much about it other then making sure i save and load the state of this msr as needed
At some point my attention span just goes ๐จ
I thought it was?
For โnormalโ interrupts from tss.rsp0
usually it's used for processor info
Not from IA32_SYSENTER_ESP?
like what smp info?
only intel
fs register is used for thread local data by the userspace program
I'm talking about GS
how do u load the kernel stack from a syscall instruction
since the syscall doesnt do it for u
where do u store the kernel stack
???
can i store this in the smp info thing
or is that not good
you can do that
that's what I did
also move any global variables in the scheduler there
if you're planning ahead for smp, you really need to think
no
it's obviously a real thing
okay so for my thread struct i need to modify it to
struct thread_t
{
...
struct smp_info *gs_base;
uint64_t fs; // points to thread local data
}
struct smp_info
{
uint64_t kernel_stack_ptr;
}
void create_thread(...)
{
...
new_thread->gs_base = kmalloc(sizeof(struct smp_info);
new_thread->gs_base->kernel_stack_ptr = kernel_stack_ptr;
}
// in isr stubs
isr_stub_usr:
swapgs
// do saving registers
// do loading registers
swapgs
iretq
isr_stub:
// if not an error stub: rsp:8, else rsp:16
cmp USR_CODE_SEL, [rsp:8]
je swapgs
// syscall handler
syscall:
swapgs // we always come from usermode
// load kernel stack from gs
mov rsp, [gs:0]
// do whatever
swapgs
sysret
is this a correct way of doing it
or am i misunderstanding again

sure that's a write way
write? 
no write ๐
wait osdev wiki says i should disable interrupts in the syscall handler to avoid a race condition with interrupts and stuff
correct?
guess not?
ill try it ig
doesnt it trying!
!!!
shit
this is fuckin cursed
but ill just assume swapgs is a 1 byte op code!!!!

how tf am i gonna skip one instruction in a asm stub where i cant make any fuckin labels cause its a macro and itll fuckin duplicate this label everywhere

this would be easier if i was using gas
but i use nasm

im dying of nasm cancer
wait i have a very cursed idea


oh frick u
why cant i do this instruction bro

i may be the worst asm programmer in existence
why cant i fuckin
rsp+16
like bro
swap the operands
nope
assembler still fuckin hates me

no wait
now its saying operation size not specified
tf
add qword before [rsp...
yea was just about to try that
ok compiles
lets see if my interrupt handler doesnt gpf or smthin!
and this check for usermode works!!!
yep works
(i think)
okay now i gotta heckin setup gs base and kernel base or whatev
okay i think im understanding it
also where tf is my auto completeion
๐
man i hate vscode
okay so heres what im gonna do now,
if an interrupt was called and i came from the userland i will run swapgs to put whatever was in gs base into kernelbasemsr
then i shall read from the kernel base msr and put whatever that points to into the per_thread_cpu_info_t struct for the current thread
then after im done with that, i select the next thread. load its per_thread_cpu_info_t into the kernelbasemsr
Thread and process names should be fixed length buffers
then run swapgs, done ๐
char name[64] etc
if this is a syscall:
i will run swapgs
get kernel stack from gs
do syscall stuff
swapgs
sysret
Because its strange to allocate these separately
E.g. Linux allows up to like 8 chars for the thread name I think
Or approximately that amount
so threadname should be
char name[8]
Well whatever limit you decide
well because my kernel is SO much better then linux (#real) i will allow for a max thread name of 16 chars!!!!
OH MY FUCKING GOD 16 CHARS????
๐ฑ
32 chars!!!!

232323 tiagashits
okay
now i will uhhh
right ik
for each thread do i need to allocate a kernel stack????
isnt that like
waste of memory
???
what about multiple kernel stacks per thread
but why tho???
why would you want that?????
tf?
and? so what if u preempted while in the kernel
how many kernel stacks do u need then?
1 per thread?
u just said multiple kernel stacks per thread
now ur saying 1
๐ญ
???
yeah i was joking
you want 1 kernel stack per thread to run the syscall handler on
okay
wait so
my interrupt frame
has a field called rsp to store the stack pointer for the interrupt frame
if a interrupt happened that was a context switch to kernel mode from usermode and we did swapgs and stuff and we saved the old thread cpu info and loaded the new thread cpu info into kernelgsbase
wait
yea i dont have to worry
its fine
nvm
ill only have to worry when making a new thread for usermode
in which i must give a userspace stack
into the interrupt frame.rsp
and i may need to take an additonal field for the kernelstack
as for threads that are kernel mode
uhhh
wait
im lost now

this gets overly complicated now
this is my new cpu context function
for creating a frame
which i use to make a kernel mode thread
now issue is
i have to worry about kernel stack ptr now
fuck

this gets really fucking complicated
bruh
me rn
okay so if i want a kernel mode thread right?
should the kernel stack ptr for the syscall handler and the uhhh kernel stack for the thread be the same or different?
cause im very VERY confused
kernel threads don't need a syscall stack?
oh okay
im guessing i will have to check if cs came from usermode to save the old thread cpu info
ig
right?
something like
i will need to also read fs and put that into my thread
ok
now i think my scheduler is ready
I like your magic numbers magic man

anyways
now that i save fs and gs
and now i have swapgs in my isr stubs
its time for syscalls now????
lets gooo????
also my os still page faults in bios mode
idk if i should care lmao
i think it happens when looking for da ps2 keyboard
or whatever
idk bios stuff
okay so
syscalls
seems like i need to write to a few msrs
so i need to write the syscall handler RIP to LSTAR
huh???
okay
i enabled the syscall extension now
now i neeed to configure syscall
who tf
userland CS will be loaded from STAR 63:48 + 16 and userland SS from STAR 63:48 + 8 on SYSRET
designed this
Its the same fucking msr
bro

what do i have to rearrange my gdt
userland code
userland data
to
userland data
userland code
???
wtf
who the actual fuck designed this shit
what
theyre just different offsets
write userland cs to star + 16
and ss to star + 8
no? the msr has a single value, and it adds 8 to get user ss, and 16 to get user cs
oh
mb I forgot it worked like that
IM THIS FUCKING CLOSE TO GETTING SYSCALLS TO WORK
BUT THIS STUPID SWAPGS ISSUE WHERE GOING FROM A USER THREAD BACK TO A KERNEL THREAD 
CAUSE CS IN INTERRUPT FRAME IS USER WHEN WE COME IN THE SCHED
AND WHEN WE COME OUT OF THE SCHED FUNCTION ITS THE KERNEL CS AND WE DONT SWAPGS AND THIS CAUSES ISSUES !!!!!

DO U SEE HOW CLOSE WE ARE
THATS A FUCKING SYSCALL

It was just popcount
Oh
FUCKING GG
๐
THATS A SYSCALL
RIGHT THERE
!!!!!
@kind root LOOK AT THIS SHIT!!!!! ๐ฑ SYSCALLS AND FUCKING USERMODE!!!!
and i was yapping yesterday about fucking giving up
๐
thats crazy
Nice
i know!!!!
guys soon bash
once i figure out how to parse an elf
and load fuckin userspace programs
and oh shit.
dynamic linking.
thats gonna be fucking pain

and my vmm doesnt give out userspace virtual addresses
shit

well its not that painful
it's pretty simple from the kernel's pov
the libc does it, you just basically load the interpreter and the program binary to memory
oh
but this might be a problem...
just load the interpreter into the address space along with the main executable, use the interpreter's entry point, and pass stuff about the original binary via aux vectors
my brain go ๐ฅ
i will have to watch videos about elf files
and how to parse them
and read some shit about elfs
first
however this may be a big problem
i will need to have my vmm manage userspace addresses
but as i have my vmm designed it only deals with in between allocated regions
meaning that well. im fucking screwed
cause regions at the start look like this
kernel allocated hhdm region -> kernel allocated binary region
and then my vmm deals with the virtual addresses in between
but i need to somehow manage userspace addresses at the same time
and what about separate fucking page maps
oh shit

just make your allocator not depend on any global variables
and store an instance of it inside each process
store an instance of the allocator regions?
whatever the allocator needs
struct pagemap
{
struct vmm_region *pagemap_regions;
uint64_t pml4:
}
but what about userspace addresses
you could probably even make the kernel have its own process and then have one allocator for all kinds of processes (whether kernel or not)
I half-did it like that, there is a kernel process that contains the kernel pagemap but I have a separate allocator for userspace processes
what??????????? why tf
because then you don't have to write multiple allocators
well ig for the kernel it could also live in some global variable but whatever
wha
๐ฅ
this is confusing
kernel pagemap? is that gonna store every region in the virtual address space thats allocated or smthin?
like huh
a pagemap that is used for kernel only threads
why would u want this
because they have to use some pagemap, what else would they use
they have their own pagemaps
and i will represent the entire kernel higher half as allocated in this user pagemap
?
so i dont give out kernel virtual addresses
yeah you don't want to allocate stuff from there to userspace
that makes sense then, and then i will switch to the kernel pagemap whenever i need to allocate memory for the kernel
you don't really need to do that either, you can just copy the upper 256 pagemap entries from the kernel pagemap to each user pagemap
then you can use the user pagemap to access whatever kernel stuff you want
no cause i will be giving out user addresses
when doing vmm_region_alloc
on the user pagemap
i will need to switch to the kernel pagemap before allocating any memory at all for the kernel
also btw im not the hyensky of vmms

you want to have a flag or smth so you can allocate all kinds of memory
you don't want to switch to the kernel pagemap just to immediately switch back to the user one for no reason
as in a flag, that if true. switches to the kernel pagemap to allocate the memory?
or smthing
why would you have to switch the pagemap to allocate memory?
cause otherwise im going to be giving userspace addresses?
I don't really understand why
i think i should explain my vmm in further detail
sorry my bad
my vmm has regions that represent an allocated regions, vmm_region_alloc scans this region list to find a space in between this region to fit a new region and returns the base address and modifies the region list accordingly
currently at the moment my region list looks like this at the beginning
kernel hhdm allocated region -> [vmm space inbetween] -> kernel binary region allocated
vmm region scans for that space in between
right?
just have a separate vmm instance which you use to allocate kernel memory
and one inside each process that you can use to allocate user memory
wdym vmm instance???
a struct that stores the region list
yes
what about pagemaps tho
should i store the address to pagemaps too?
struct vmm_instance
{
struct vmm_region *list;
uint64_t pml4;
}
struct thread_t
{
...
struct vmm_instance *instance;
}
yes that would work
and i can just make a global variable for the kernel vmm instance
n use that
when allocating kernel memory
also regarding this, it only works nicely if you prefill all the 256 higher half pml4 entries (if you don't then if some thread allocates kernel memory which doesn't have a present pml4 entry yet then that entry wouldn't be updated in the other threads), then if you do ```c
memcpy((uint64_t*) user_process->pml4 + 256, (uint64_t*) kernel_pagemap->pml4 + 256, 0x1000 / 2);
yea okay
okay changed my vmm properly to have a pagemap vmm instance thing like this
that was easy to do
actually
all i need to do is
make a create_pagemap function
and uhhh
make a vmm_region_alloc for userpagemaps
yea
good progress
i would honestly prefer if mlibc did this by just running ld.so /bin/executable
hi mint suki
guess who got syscalls
hi
๐
yeah gg
thank uuuuu
that would also be nice if you want to run executables whose interp is different from the ld.so you want to run it with
You may hold the servers record for userspace right there (or was there someone faster once?)
that could probably be arranged but for the normal case where ld.so is found via interp we still have to do it the current way
uhhhh
do I?
do i get a prize

yeah, iirc you can detect that from the lack of AT_BASE?
Give me some of your motivation pls 
step 1: have no life

step 2:
ig if mlibc's ld.so supported being run as a standalone program then the kernel could just find interp and reexec with the path as a param (but that breaks for memfd etc?)
My mum would murder me
Better doing osdev in the mental facility than not doing osdev type mindset
(I agree fully)
Write a phone os then
โฆ
why
bruh
(i am a zoomer too)
what are aux vectors
ok fair i guess
they are explained in the ELF spec
on google
the internet
the wikipedia page on it isnt terrible for the basic structure
but it doesnt go into much detail about other stuff like relocations or symtab
see the part where it says executable and linkable format specification
there's only one absolutely massive problem
its horrendously insecure
you mean using ld.so program? yeah there's toctou between the kernel reexecing program as ld.so program and ld.so reading the executable again
yeah with setuid
unless you have statfd i guess
then you can restat in the child to make sure setuid is cleared properly
also just load it the normal way smh
and if you dont have statfd then you can just ban setuid
- i dont know what any of yall are talking about. 2. elf spec looks very complicated and maybe im too stupid idk 3. this is gonna be pain

you can read the Vinix code for this
i dont wanna steal
it's rather straight forwards
well it's not about stealing, first off it's in V
it's more about comparing it with the ELF spec and seeing what you're supposed to do
ok
just compile the v code to c and then copy it 
lmao
bruh
autofree bugs included
lmaooo
fuck
multiple pmm page allocation 

guess who has a freelist allocator that doesnt allocate contagious pages
#me
!!!!
tf am i supposed to do!!!!
๐ฑ
why would you need contiguous physical addresses
also lol contagious
wait ur right
i can just loop over
every page
and allocate and map to virtual address as needed
yea
also
elf spec doesnt say anything about aux val?
what is that
you don't need that
that's just how Vinix's pmm works
okay but like, aux val
elf spec says nothing about this
like at all
it may be in the sysv itanium abi spec
fuckin wha
dw about it
thats fine
you never need that
except for iommu memes sometimes
i am completely and utterly lost
like a cow in a field of no trees or grass
why is every step to making an os getting more complicated then the last

.
i cant find it
wait is this it
i think
you can get an up-to-date copy here btw https://gitlab.com/x86-psABIs/x86-64-ABI
i give mlibc AT_ENTRY, AT_PHDR, AT_PHENT, AT_PHNUM
do i manually hard code this stuff, do i always assume the elf executable in question will be linked will mlibc
hardcode what?
so i always provide these auxilary vectors
the phdr ids? or the values?
you should provide them regardless of what the elf file is
you always provide them, of course
wh
lmaoo its gonne be so much fun
okay so heres what im gonna do ig
im gonna just try and load a statically linked elf file and see if that works
something simple
no libc no nothing just a simple asm program compiled to a elf file
i run it from my tmpfs file system
just to get started
i thought you already have done that?
no i hardcoded the program
ah

fun
lol
sure
I believe early NT also had a cap in its process names
Like instead of YoinkerSploinker.exe it would say YoinkerSploinke.exe
8 is traditional on unix
at least i thought it was
looks like from unix research 6 to unix 4.2 bsd, user->u_comm was DIRSIZ long
that was 14
by 4.4BSD it was moved into struct proc, p_comm was MAXCOMLEN + 1, MAXCOMLEN being 16
modern linux
/*
* Define the task command name length as enum, then it can be visible to
* BPF programs.
*/
enum {
TASK_COMM_LEN = 16,
};
``` lmao, bpf really will be linux and linux will be bpf
eBPF (which doesn't and indeed never stood for anything) is the best technology ever!
and remember, oceania was always at war with eastasia
you cant deny how useful bpf is tho
i am going to implement this shit into keyronex just so that i can loudly call it "Extended Berkeley Packet Filter"
do dtrace
or even better, implement your own
call it ktrace or something
i mean if windows has dtrace you can too
true
you should implement your own mechanism that is highly portable to other hobby OSes
it is highly fashionable nowadays to maintain cross-os tooling in these circles
found the issue
vnode_path_lookup
i need to rewrite this entire function cause clearly its causing some string fuckery
thats my bad for copying astrals implementation of path parsing
guess kara
karma
i fucking hate dealing with strings
surprised this bug didnt come up until now
I sense a skill issue

should i just rewrite this entire function at this point
fucking memory corruption with the strings
and i cannot solve it
no matter what i do
this bool is never true for no fucking reason and if i try to do strlen + 1 it causes funny memory corruption
@elder shoal i dont know what u did with astral but even tho my implmentation of this string parsing is very similar to yours it doesnt seem to be working 
fuckin hell
it is clearly failing to create the directories properly
it finds the usr directory but the bin directory doesnt exist
of course
because my kernel hates me
and there will be probs a bug with the elf loader that will make me have to rewrite it too even after i fuckin fix this vfs bug, probs user stack fuckery or smthin idk
all of this just for bash

What does your vfs create function look lije
uh huh
this:
int vfs_create(struct vnode *indir, char *path, int type, struct vnode **res)
{
if (path[0] == '\0')
{
return -1;
}
char *component = kmalloc(strlen(path) + 1);
struct vnode *our_par = vnode_path_lookup(indir, path, true, component);
if (!our_par)
{
kfree(component, strlen(path) + 1);
return -1;
}
struct vnode *created = NULL;
if (type == 0)
{
// CREATE DIRECTORY
our_par->ops->v_mkdir(our_par, component, &created);
kfree(component, strlen(path) + 1);
*res = created;
return 0;
}
else if (type == 1)
{
kprintf("Created file\n");
our_par->ops->v_create(our_par, component, &created);
kfree(component, strlen(path + 1));
*res = created;
return 0;
}
else
{
// not supported
return -1;
}
}
ive tracked the problem to vnode_path_lookup
but i dont know why its not able to create the right directories
as shown here its failing to
create the vnodes for
them
my vnode_path_lookup function
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
this is pain

Pastebin isnt loading for me
Just add printfs in every error or something to try figuring out whats happening
i solved the vfs issue i think
okay so solved vfs issue
but now
very fuckin weird issue
when trying to open bash
wtf
why does /usr/bin/bash have an elf header type of 24930
like
wtf
????
im writing into the file fine
when unpacking and loading the tar
into the tmpfs file system
so why tf
looks fine
looks fine here too
so why tf

ummm
thats clearly not valid
why

pain
fucking pain
help
yea size is valid
um yea
thats the first part of the bash file?
so why tf
is it not copying it to the file right

um yea
thats correct
yea the memcpy operation went fine?
as you'd expect
tf???
23???
(char)
thats just casting the address
into a char type
lol
yes
what the fuck...
thats not the correct
file data
wtf
why is THIS the data
this makes
zero sense

im losing my mind
right
great
fucking memory corruption
my favourite
im going to
fucking idk
is this the fucking issue
yea seems like so
name is valid
but this memcpy is clearly
not working right
fucking hell
I dont know how to set that up
sorry
i dont know how to setup asan
idfk whats the issue anymore
somethings memory corrupting something
and i cant figure it out
this is fucking hell
yea where tf is it getting these names
xfce?
thats not in the sysroot folder
what in the actual fuck
oh it is there
so i fixed the name corruption issues but
not the memory corruption
im stuck
im rlly fucking stuck
i added kprintfs in every fucking known place
and i dont know where this memory corruption is going on
this fucking address
0xffff8002503e1000
shouldnt be allowed
what the fuck
kmalloc will NEVER return an address like that
what in the actual fuck
int vnode_create(struct vnode *dirtocreatefilein, const char *name, struct vnode **newfile)
{
if (dirtocreatefilein->type == NYAVNODE_DIR)
{
// create name lol
struct tmpfs_dir *dir = dirtocreatefilein->data;
char *thename = kmalloc(strlen(name) + 1);
memset(thename, 0, strlen(name) + 1);
strcpy(thename, name);
// create dir entry
struct tmpfs_dir_entry *new_dir_entry = kmalloc(sizeof(struct tmpfs_dir_entry));
memset(new_dir_entry, 0, sizeof(struct tmpfs_dir_entry));
new_dir_entry->name = thename;
new_dir_entry->next = dir->head;
dir->head = new_dir_entry;
struct vnode *newnode = kmalloc(sizeof(struct vnode));
memset(newnode, 0, sizeof(struct vnode));
newnode->type = NYAVNODE_FILE;
newnode->data = (struct tmpfs_node*)kmalloc(sizeof(struct tmpfs_node));
memset(newnode->data, 0, sizeof(struct tmpfs_node));
newnode->ops = &tmpfsops;
new_dir_entry->ptr_to_vnode = newnode;
*newfile = newnode;
return 0;
}
else
{
return -1;
}
}
somethings clearly wrong in this function
however im doing it
what
what????
WHAT THE FUCK
BRO
WHAT
no wait that makes sense
okay this looks like a normal address
๐
okay this makes sense
as its using my big ol vmm region alloc for this
cause 206 pages
for this bash executable
so wtf is going on
someone is clearly corrupting our ->data field
someone is corrupting both our ptr to vnode field
for the dir entry
and the -> data field
wtf
i need help i dont know what to do
i cant figure this out
i've looked over the code so many times, i dont know where this memory corruption is happening
the urge to give up on all this is very strong
so after looking into it more
its not memory corruption
rather
how im searching for the vnodes and such
seems to not be right cause
there could be a directory named
fuckin
bash
and then a file named bash
and seems like something with
this if statement never true
meaning
somethings going off
no??
its finding it
its fucking
its a fucking directory
i cant do this fucking
shit
anymore
five straight fucking hours i have been debugging this
i cant figure it out
why in the actual fuck
why
whats the problem
i dont fucking know
thats the problem
i dont fucking know why this is happening
something very funky is going on
my vfs is shitting itself
and not giving me the right vnode
the right fucking vnode
and it cannot be memory corruption because i tried with asan and nothing violation in a userspace program
im fucking
lost
wrong printfs/not enough
you're loggin size as a string
i legit read every fuckin warning for vfs.c and tmpfs.c and tar.c
i cannot find this issue

somehow this check succeeds but not in the v_lookup function above
which makes
zero sense
what soever
which is like
what
so like bro
why
PART IS FUCKING BASH
BRO
bashbug?
oh.
oh
OH
OH MY FUCKING GOD
IS THAT THE ISSUE
U ACTUALLY HAVE TO BE LEGIT KIDDING ME IS THAT THE ISSUE????
bro
that explains everything
i finally fixed that issue
but now
we have issues with the elf loader itself
of course!
afterall
i cannot escape my fath
elf header type 2
right
why is bash dynamically linked
i thought it would use the interrupter
huh?
it is dynamically linked and it does use the dynamic interpreter (in your case at least)
you don't have to care about PT_DYNAMIC in your kernel
then why is it crashing
and page faulting
and crying
like a baby
like what the actual fuck
why is the program header
that now
huh???
wtf
okay did the memsetting thing for the .bss section
andddd
that causes a page fault
course

ok i just memset every page
as im lazy
and only write into buffer as required
okay but still
why is the program header that
???
im using hdr.e_phnum
PT_GNU_STACK? if so just ignore it
we are currently having stack problems
we can load into the linker
but page faults here
i think i need a bigger stack
most likely 4k is not enough
yea
in general you only really care about loading PT_LOAD phdrs
others like PT_PHDR and PT_DYNAMIC and PT_INTERP etc are just extra information (that you do still need)
this should work???
ummm
why is it page faulting now when i try to make a stack using this function
bruh
when i try to access it
to put the aux vecs
ugh
right i just realized
blud what
blud what
bro
oh right
switch it on
your stack is misaligned