#Nyaux
1 messages ยท Page 17 of 1
13th bit
Size:
โข This bit is a 0 to indicate that the main counter is 32 bits wide (and
cannot operate in 64-bit mode).
โข This bit is a 1 to indicate that the main counter is 64 bits wide (although
Rust crate skill issue
wahhhh
fine ill use the new
NEW
uacpi rs
bindings
how
I mean idk how u get that field
fn init_lapic(&mut self, e: &mut ACPIMANAGER) {
let addr = rdmsr(0x1b);
self.lapic_addr = addr & 0xfffff000;
println!("addr of lapic for cpu: {:#x}", self.lapic_addr);
unsafe {
core::arch::asm!(
"mov rax, {0}",
"mov cr8, rax",
const 0,
out("rax") _,
);
let q = HpetInfo::new(&e.0).unwrap();
let mut it = (q.base_address + HDDM_OFFSET.get_response().unwrap().offset() as usize) as u64;
if it & (1 << 13) != 0
{
println!("Capable");
}
else {
println!("nope");
println!("{:#b}", it);
}
};
}
bro
the config register
is at offset 0
Wtf is APICMANAGER
lets not talk about that
the acpi manager
I mean idk what it has at index 0
*aml
Id love to see that
this is what the register looks like
COUNT_SIZE_CAP
is what im looking for
to be 1
which it isnt???
Yes
thats not supposed to happen
it means the hpet is 32 bit
and qemu has a 64 bit hpet
so wtf
000-007h General Capabilities and ID Register
using the acpi crate
which gives me the address to the hpet
and there is data there
Maybe the way you're using the crate is wrong
i read the documentation
kk
bro come on
they want me to use hpetinfo
not
the actual fucking table
wt
wtf
rust devs omg
Yeah no idea
what address do you get for the hpet itself
with hpetinfo
sec
this one @tawdry mirage
physical address of course
that's correct at least
yea
so wtf
ill push the changes so you can also take a look
pushed
please someone hlep
๐ญ
:(
@molten grotto can i at least use your uacpi rs thing if you can implment scanning tables for me pretty please
cause currently you cannot scan tables
im kinda desperate
you are and'ing the hpet base address
yep
buts its okay
we learn through this
we all started as idiots
lets be honest
@kind root we learn through this
andddd a page fault
guessing cause mmio isnt mapped in the hhdm right qwinci?
yes
how do i map it
I was saying yes to this
I dont actually know
It should be under 4g
yea so wtf
didn't you do that
yea
it looks like the memory map doesn't contain all the regions so if you want to map everything just find the highest address in there
wha
i dont understand
Not always (?)
On qemu
yes because its likely not contained within the memory map
so how do i map it
either you get the highest base + length from the memory map and then map that much to the hhdm or alternatively you map the devices separately
Doesn't uACPI request memory maps?
and for the first option doing it with 4kb pages is bad, its going to take ages to do and take a ton of memory
how to map the devices separately
qemu with ovmf has put the nvme bar above 4gb
im unsure how to do that
you just map them before the first time you access them to somewhere
I have vmem in my kernel for everything
Were talking about hpet but yes
either to the hhdm or to a separate virtual memory allocated specifically for the device
okay ill just map it to the hhdm
simple
done
oh
still should map it tbh just to be sure
it works now yayyyy
QWINCI I WILL MAKE YOU A SHRINE IN MY OS
REAL
FOR THE HELP YOU HAVE PROVIDED ME
YOU ARE SO KIND
OMG
enabled the hpet
๐
now i need to figure out calibration math
uhhhhh
fuck
at least there is the speed readable from the registers which is nice
just that its in femtoseconds or whatever
i feel like this is wrong
guys is this wrong
or is this accurate
im unsure
stupid fucking timer
// unmasked, periodic, interrupt 34
// (1 << 17) sets to periodic
// read sdm for more info
self.write_lapic_register(0x320, 34 | (0 << 16) | (1 << 17));
i literarly
wrote to it
bro
BRO
DUMB AH
FUCKING
LAPIC
I HATE THIS LAPIC AH
RAHHH
// 0x100 enables the interrupt, 33 is the interrupt number for a surprious interrupt
self.write_lapic_register(0xf0, 0x100 | 33);
// divide by 4
self.write_lapic_register(0x3e0, 1);
// one shot timer, unmasked on interrupt 34
// 1 << 16 masks the timer
self.write_lapic_register(0x320, 34 | (1 << 16));
// calibrate the lapic, set the inital count
self.write_lapic_register(0x380, 0xffffffff);
self.ksleep(10);
let mut lapic_ticks_per_10ms = self.read_lapic_register(0x390);
lapic_ticks_per_10ms = 0xffffffff - lapic_ticks_per_10ms;
println!("lapic ticks per 10 ms {}", lapic_ticks_per_10ms);
self.write_lapic_register(0x380, lapic_ticks_per_10ms);
// unmasked, periodic, interrupt 34
// (1 << 17) sets to periodic
// read sdm for more info
self.write_lapic_register(0x320, 34 | (0 << 16) | (1 << 17));
this is literarly all i fucking do
and yet
it doesnt work
IT DOESNT WRITE TO THE REGISTERS WHY TF

what does write_lapic_register look like?
fn write_lapic_register(&self, reg: u64, val: u64)
{
unsafe {
*((self.lapic_addr + reg) as *mut u64) = val;
}
}
me when rust doesnt listen to me for the billionth time
where volatile
bru
using volatile doesnt solve it
ITS STILL NOT WRITING TO THE REGISTERS RAHHHHH
Recently, one of the developers of the Rust for Linux project, Wedson Almeida Filho, resigned from the project. In his parting message, he linked a video of a filesystem maintainer shouting at him. Afterward, Asahi Lina, developer of the Appleโฆ Continue reading โ
Related about rust on Linux
No idea
๐
Meow meow meow :3
btw qwinci are you still working on those uacpi-rs bindings, if so could you put scanning for tables on top of the priority list. this acpi crate is really fucking weird and i dont want to keep using it
i really want to use uacpi
but the lack of functionality of the bindings atm stops me from using it
debugging further
still cannot find the source of the issue atm*
im unsure why
i will step through the lapic init function and see
debugging more
-trace
i wonder if you can trace (l)apic
-trace apic_mem*
that will print all memory accesses to any apic in the system
its not writing
at all
apic_mem_readl 0xf0 = 0x000000ff
apic_mem_writel 0xf0 = 0x000001ff
apic_mem_writel 0x350 = 0x00008700
apic_mem_writel 0x360 = 0x00008400
apic_mem_writel 0x300 = 0x000c4500
apic_mem_writel 0x300 = 0x000c4610
apic_mem_readl 0x30 = 0x00050014
these only show up with limine boot
not when in the kernel
well then u did something wrong
lol
whats your "lapic base"
sorry lapic_addr
print that bitch
thats the virtual address of the lapic base
in the hhdm
i manually mapped it
it looks ok
let addr = rdmsr(0x1b);
self.lapic_addr = (addr & 0xfffff000) + HDDM_OFFSET.get_response().unwrap().offset();
what i do
assuming hhdm offset is 0xffff800000000000
yea
unsafe {cur_pagemap.as_mut().unwrap().map(self.lapic_addr, addr & 0xffff000, VMMFlags::KTWRITEALLOWED.bits() | VMMFlags::KTPRESENT.bits()).unwrap()};
this is how i manually map it
BRO
ONE F
still didnt solve it tho even after readding the one f
still not writing ๐ญ
cause
just map first 4GB
its not in the memory map
- any additional usable entries
above 4GB
literally what limine does for you already
so just follow that
its good
how do i do that even
you... map all the memory from 0...4GB
okay sce
and then you loop over your memory map
and if any usable entries are above 4GB
you map them too
4gib or 4gb
in the hhdm
1024*1024*1024*1024*4
wait i think i might be dumb
yeah 1 1024 too many
basically 0x100000000
its just 3
0x100000000
okay
lets divide that by 4096 so i go over each page
0x100000
okay
lmao
bro was about to whip out the let mut i = 0; while i < 0x100000000 { ... }
if you wanted to you could probably use 2MB/1GB pages so mapping it all isnt dogshit slow
but first get that working
for i in (0..0x100000000).step_by(4096)
{
q.map(
HDDM_OFFSET.get_response().unwrap().offset() + i as u64,
i as u64,
VMMFlags::KTPRESENT.bits() | VMMFlags::KTWRITEALLOWED.bits()
).unwrap()
hhdm_pages += 1;
}
it didnt solve it
lol
STILL
no write
well something is Properly Fucked
Nyaux try not to get stuck on random shit every day impossible challenge
๐
god just hates me
to be fair
fair, I can add that and ig re-export the tables from uacpi-sys
thank you
WHY WONT IT WRITE TO THE LAPIC
RAHHHHH
Don't you need to do writes as 32 bit ints? (May be not)
no?
the registers are 32-bit wide
oh
That's what I'm doing in my kernel at least
its still a *mut u64 tho right?
no
It's the same as with hpet
wait no
it would be *mut u32
now its there, it might be slightly inconvenient to use because of the re-exported tables and whatever but I don't want to spend the whole day writing nice accessor functions for the fields within the tables
LOL
01a2
lmao
loooool
yea i dont know rust macros
help
i cannot figure out this
macro_rules! exception_function_no_error {
($code:expr, $handler:ident, $meow:tt) => {
#[naked]
extern "C" fn $handler() {
unsafe {
core::arch::asm!(
"push 0x0",
"push rax",
"push rbx",
"push rcx",
"push rdx",
"push rsi",
"push rdi",
"push rbp",
"push r8",
"push r9",
"push r10",
"push r11",
"push r12",
"push r13",
"push r14",
"push r15",
"push {0}",
"mov rdi, rsp",
"call {1}",
"add rsp, 8",
"mov rsp, rdi",
"pop r15",
"pop r14",
"pop r13",
"pop r12",
"pop r11",
"pop r10",
"pop r9",
"pop r8",
"pop rbp",
"pop rdi",
"pop rsi",
"pop rdx",
"pop rcx",
"pop rbx",
"pop rax",
"iretq",
const $code,
sym $meow,
options(noreturn)
);
};
}
};
}
im trying to take in
the function
and get the symbol
but it doesnt work
:c
because tt is a token? you want ident
still having a 0xd general protection fault
e=01a2
?????
wtf
i dont know whats going on
help why isnt it working
debugger
right
What do you mean by re exported tables?
And thanks for your work btw
as in re-export bindgen generated tables
Ah
how can i look at the idt with gdb
though ig you could also just add uacpi-sys to your project along with uacpi rs so then you could use them directly from there (the enum names and whatever are annoying though because they are very long, I re-created some of them as constants but not all)
because it prefixes the c enum value name with the enum name itself so its eg. acpi_madt_entry_type_ACPI_MADT_ENTRY_TYPE_LAPIC
is there a way
i cant breakpoint at the idt stub for some reason
did you try to breakpoint at the function by name
Ooh thats very annoying
What is uacpi sys?
now that I searched for that apparently there is a bindgen option to disable that lol
Nice
a crate that contains the raw bindgen generates bindings for uacpi, its in the same repo
yep
Ah I see
keeps saying its not defined
add #[no_mangle] to the handler
right
still keeps saying not defined
rahhh
File src/idt/mod.rs:
269: fn NyauxKT::idt::InterruptManager::start_idt();
196: fn NyauxKT::idt::div_error();
139: fn NyauxKT::idt::double_fault();
139: fn NyauxKT::idt::general_protection_fault();
117: fn NyauxKT::idt::idt_set_gate(u8, usize);
196: fn NyauxKT::idt::invalid_opcode();
139: fn NyauxKT::idt::page_fault();
101: static fn NyauxKT::idt::exception_handler(u64);
@molten grotto look at this
wtf
it isnt
in the symbols at all...
nyaux try not have something go wrong for billionth time moment
Nyaux when gdt loaded 
:(
still cant figure it out
i think i know the issue
rust is omitting
the stub
for it
how do i stop that
:(
scream at the compiler
louder
use it somewhere?
i did
or maybe marking it as pub would solve it
didnt solve it
im pushing everything to github if u wanna take a look at the code
done
you don't ever set 0x34 to anything in the idt
oh im fucking stupid
also in your exception stub ```x86asm
push {0}
mov rdi, rsp
call {1}
add rsp, 8
mov rsp, rdi
how?
wait
the function that you call is allowed to use it for whatever
and there is no reason to move anything into rsp anyway
ah yeah I forgot that too, you pass a physical address there
i fixed that but
wha
#[no_mangle]
pub extern "C" fn scheduler(registers: u64)
{
let got_registers = unsafe {*(registers as *mut Registers_Exception)};
println!("tick");
let mut addr = rdmsr(0x1b);
addr = addr & 0xfffff000;
addr = addr + HDDM_OFFSET.get_response().unwrap().offset();
CPU::send_lapic_eoi(addr);
}
this is all i do
you don't ever discard the error code you push to the stack in the stub either
you do have a lot of bugs lol
wdym
i do
add rsp, 8
oh wait
NVM
SORRY ๐ญ
you discard the number but you don't discard the error at the end before iretq
the other stub likely has the same problem, you need to take it into account even when its pushed by the cpu
okay i solved it
but
it only ticks once
:(
righg
cause i call it manually
but
why isnt the lapic firing the vector
i unmasked it?
bro???
its unmasked
I'd bet you aren't installing the handler for the same vector
no its 34
because you are using 34 as the vector for the lapic and maybe you install 0x34
okay i fixed that but still dont work
no interrupt still
pushed on github
sti instruction does nothing
because your hcf disables them
oh
IT WORKS
OMG THANKS QWINCI AGAIN
THANKS FOR HELPING ME FIND THESE BUGS UGHHHH

istg naux is written by qwinci at this point

you can implement vfs on top of tar
not that its the greatest idea ever but like its an option
size
I actually do vfs ops on top of the literal tar file without unpacking it into anything better
yea octal size*
fun
I guess that reduces boot time?
but then file access is slower
yeah and finding files
okay time to learn about vnodes again and implment vfs for nyaux once again!!!!
ext2 backed by ram 

wouldn't probably be a terrible idea tbh
right wheres that sun paper on vfs
thank you
wait the one that I posted was the vmem one 
it was the slab
๐ญ
i think i can do vnodes with traits
rust traits
the operations at least
every directory/file has a vnode right
yea i see
every open file/directory, they aren't something that's always there for all files
wha???
it would take a ton of memory if all files on the disk would have an in-memory vnode at all times
the way that I understood that they work (and how I have implemented them) is that each vnode has a lookup function that can be used to create a vnode for the next component of the path on-demand
how would that work
VNode* root = root_vfs.get_root_node();
VNode* usr = root.lookup("usr");
VNode* bin = usr.lookup("bin");
VNode* bash = bin.lookup("bash");
and what would the lookup function look like
depends on the mounted filesystem
tmpfs is completely in RAM
i knwo
yeah that's what I do too
im looking at my old code
would ptr_to_vnode be an Option<*VNode>
if its None you create the VNODE based on the information?
or smthin
ptr_to_vnode would still be a pointer no?
ptr to vnode sorry
But encased in an option type
oh
hashmap for dents?
if it's in memory, why not?
Option<*mut VNODE>
I was just wondering
maybe I should do that
would speed up lookups
also you likely want to allow multiple vnodes to reference the same in disk (or in ram) file/directory so the actual file/directory entry shouldn't care about what vnodes are pointing to it
rn I do a linear search
yh
the vnodes have a 1:1 correspondence with e.g. UFS or ext2 inodes
which is not that bad, but I guess it could be bad for large directories
oh i see
okay how would a lookup function work
say
i had
a directory
lets call it usr
and i called .lookup
on it
what would that look like
think about what your vnode actually stores
it'll become clear how to construct it as well
scan for directory entries with the name being looked up
stores flags and operations
yeah
right
its just a abstraction over the overlying fs
keep an opaque pointer to some fs-specific structure
right
or i should say (hopefully) the directory entry with that name (or none)
that just sounds like a namecache?
unless I'm mistaken?
what if a vnode doesnt exist
as in there is only one vnode at a time for one disk inode? though I don't see why you couldn't have multiple vnodes pointing to the same disk inode
kinda I guess
create it?
yes but point is lil bro here is implementing tmpfs
this would be for a tmpfs, extent at the vfs layer rather than above it
using the information of the fs node right?
so it's all in ram
a vnode is just an abstraction, you're not really creating anything
the vnode is the virtual counterpart of inode, maybe there are multiple open file structures which point to it
right so "create" the structure if it doesnt exist
its really just an abstraction yea i get you
you're not creating anything
wdym?
i thought you cannot keep vnodes in ram all the time
cause of perfomance issues
wait you shouldn't
oopsie
not a performance issue, more like ram issue 
ideally you put as many files in ram as possible
https://github.com/NetBSD/src/blob/trunk/sys/fs/tmpfs/tmpfs_vnops.c#L129 here is an example of how an actually existing fs does a lookup op
this is why on macOS when you have 16gb of ram you have like 8gb ram usage idle, but on a 8gb system you don't
ah, ig I have been doing it differently then as I have just been basically using vnode as open file
ok so it does a linear search or use the namecache directly
I guess you could also have a hashmap per directory
tho idk how good that is space-wise
okay so i wont have a vnode like an open file
there will be a vnode in ram that the tmpfs node points to
i think thats fine
depends on your hashmap load factor limits
yeah, it is the old fashioned approach where the namecache is basically a library that filesystems call, instead of a superior layer in the stack so to speak
thats how the paper says it tho
so im gonna follow the paper
i dont think it has ram issues
makes sense
a namecache is always good to have no matter what
also sounds simple enough to implement
afterall the vnode structure is lit a few bytes
๐
@molten grotto please dont treat your vnodes like open files
my tmpfs node just has a vnode as the first struct member so that you can do a pointer cast
i will just have a ptr to the vnode
as the paper does it
cause it makes me feel all scientific
๐
there's no tmpfs in the paper
idk what issue is there with that tho
in the solaris tmpfs it does implement a tmpfs tmpnode as a struct containing a vnode, like what astarl does
think abt it
ooo
thats smart
I don't really care about that, but if there are actual good reasons then ig Ill switch it 
i will do that then
my tmpnodes have a pointer to a vnode and vnodes have an opaque pointer to fs-specific data
(in this case a tmpnode)
ill just have the tmpfs node store the vnode
actually never mind, at some point it became a pointer, but it's not a great deal of different
it's allocated for every tmpnode anyway and dosen't go away https://github.com/illumos/illumos-gate/blob/master/usr/src/uts/common/fs/tmpfs/tmp_tnode.c#L195
yeah that's what I do
nyaux is getting a vfs boys
after like a week of shanggains
nyaux is finally getting the vfs
๐
actually maybe there is at least one benefit, eg. if you write to a file that could have multiple vnodes referencing the inode then the inode would have to have an in-file structure having eg. a lock to synchronize the writes
so then you would basically end up having an unique in-memory structure per inode anyway just that the vnode ops would be in the layer above using more space being duplicated for each open file
what are the advantages of doing it with an extra pointer
heres what i thought of
ill have the vnode ops be a function pointer
that when defined for tmpfs
there will be a closure
that calls the tmpfs op
right
i have no idea, i would've said maybe some lifetime issue, i don't totally rule that out, it doesn't sound too believable to me though
or rather i can't immediately think of a lifetime issue
yeah
but multiple ops tho
yep ik
I have it as a structure of function pointers that you can then define
hmmm
oh rlly?
so i can just have it as a trait
vnode operations
that i can impl for a tmpfs node or smthin?
how do i store flags for a vnode

yeah, you can put the ops trait object inside a box and then store that in vnode
ah i see
trait VNodeOPS
{
fn blahblah() -> i32;
}
struct vnode
{
ops: Box<dyn VNodeOPS>
}
somethin like this
yea
yea
please for the love of god run rustfmt on your code
lol
yes
okay so
with the vfs
do i need a get next component function
or smthin?
i feel the urge to add a NT subsystem
to the kernel
that would be cool
we'll see
just
lets focus on getting bash running
with proper ps2 drivers and whatever
rn lets focus on the vfs
anyone know?
well what do you mean by that
if you do switch to them do let me know whether they work
though I am pretty sure that they should work, I only tried to compile them on the host
im switching to them
rn
ill let you know how they work
also for the functions that take in &CStr (like table_find_by_signature) you can use literals of the form c""
though the signatures for the common tables like hpet are also exported as constants
??
@molten grotto
what is the code where it fails
uacpi::init
i know my allocator isnt the problem
gives the address just fine
same with my vmm region allocator
memory is mapped and all no page fault occured
why is mr uacpi thinkings its out of memory
hmm
do you have the log level as trace?
or debug
because that could provide some info
no info provided even with log level as trace
my slab allocator was requested ONE time for memory
to which it gave
thats all that happened
that's weird
and that wasnt nessorilary for uacpi
that was for the kernel
Arc::new()
the kernel api
that worked fine
i checked
an arc object was created
so theres smthin funky goin on
can you push it to eg. a new branch or something? because I'd like to check, though I suspect that its not a problem with the bindings but its not impossible because I didn't test them
i can push it to the main branch
done
ah right, 0 is an invalid value for uacpi::Handle
Ill add an assert to make sure that new() isn't passed that and then a separate function to create an invalid handle
but in any case you shouldn't return invalid handle from any of the kernel api functions that return handle in a success case
lol
so close
:c
SO CLOSE
RAHHHH
here
its page faulting
fuck
@kind root memory hell :>
oberrow curse
I pushed a check for the handle case, now it will fail with an assert if you try to do that
CR3=000000007ff39000
oh
it looks like its a null deref
idk
wasn't rust memory safe??

for i in 0..amou {
let mut e = PMM.alloc().unwrap();
e = (e as u64 + HDDM_OFFSET.get_response().unwrap().offset()) as *mut u8;
e.write_bytes(0, 4096 / 8);
e = (e as u64 - HDDM_OFFSET.get_response().unwrap().offset()) as *mut u8;
self.map((*new_guy).base + (i * 0x1000) as u64, e as u64, flags)
.unwrap();
}
only time i memset
yea 
not if u spam unsafe everywhere like nauxmaster 
the based approach
๐
okay @molten grotto the address i return SEEMS to be valid
for the region vmm
wha
why are ur heap allocations 1-byte aligned
no idea
safe rust btw
very
need to make my own rust kernel
its also partially a skill issue
๐
it is a giant skill issue
rust would make ur life easy
but u just refuse to write rust
well some parts are annoying
ur code is literally like if it was made by one of those C to rust transpilers
maybe figure out why your virtual address is byte aligned and physical is page aligned
how did u even map it like that
but in general if you don't spam unsafe everywhere and do things a bit more ideomatically then its at least a lot better
it shouldnt even cause a problem
well it is if u assume that [virtual, virtual+4095] is valid
its not C where you can dereference any pointer as long as the CPU is happy
because its not in your case
in rust unaligned pointers are UB, no matter if you dereference them or not
at least iirc
right
iirc there is a function to read from an unaligned ptr tho
Reads the value from src without moving it. This leaves the memory in src unchanged.
oh, then i might be wrong, you CAN have unaligned pointer, just can't dereference them
that makes sense
can't create an unaligned reference
yeah that would be ub
lmao
my bad on misinformation then
๐ญ
both the hhdm and kernel region are 4096 byte aligned tho
yea they are aligned wtf
what the actual fuckers
I thought rust was safe!!
Ah Geert already did the joke
Here
in C an unaligned pointer is also UB lol
*(int*)(((void*)x)+2) can be UB
especially with strict aliasing
ok well but rust actually checks ub at runtime by default
true
Boring, real programming needs to have a luck factor
God damn it
why god damn it
i fixed the alignement issue
we got as far as here
yea wtf is that address @kind root ๐ญ
0xffff80007d685028
thats an issue with the slab allocator chat?
alignement issue AGIAN
this time with the slab?
am ii correcgt
wait no
wtf is going on
๐ญ
????
CR2=0000000000000005
????
sorry
wha
again null deref from the looks of it
happening here
some heap corruption ig
ill try to get a backtrace for u
it probably doesn't really help with this kind of issue
right
does the address at least look valid?
what address
prev address
i will print every address returned to see if its an issue with the allocator
sec
that can be normal but I am not sure if it should happen on qemu
does the returned address look valid @molten grotto ?
the last thing my slab allocator returns
yes it looks valid
qwinci does it look aligned
Definitely not
just one guess, have you made sure that the minimum size that you pass to slab_header::init is 40?
because if its any less than that you are going to be corrupting the slab nodes themself
I think you already had a bug like that
yea but i put the minnium cache at 16
to fix it
not 40
I am not sure if you had that many fields in the slab header back then tho, likely not
i dont have much
struct slab_header {
size: usize,
next_slab: Option<*mut slab_header>,
freelist: Option<*mut KTNode>,
}
3 fields
8 + 8 + 8
24 bytes
...
yea
oh wait its KTNode that's used as the freelist node, nvm
its 8 bytes
yes but slab header
well KTNode 16 because of the option
but yeah if you already made sure that the min size is 16 then that's not a problem

ig you could just make your alloc return whole separate pages for all sizes under page size to test whether its an issue with the slab stuff
(and adjust dealloc appropriately or just don't do anything there)
its the slab

ITS THE SLAB QWINCI
ITS THE FUCKING SLAB
KAKZMKCLXM MVNKLDKG:POSF@{lpDO'K,;OLMX.,JKN CAVKD\SLJ;GOP[]aof#D
S
@molten grotto I AM IN MISERY
also page fault here lol
@kind root what does it mean !!!!!
wtf is a gpe block
your the uacpi guy
i wanna fix this issue before
i fix the other issue
cause it seems to me
theres 2 issues
with my allocator?
am i correct?
Oberrow curse strikes again
RAHHHHHHHHHH
ko[] m,. l;k'cp[pd';,mc. ./l';#c'dl,./m ,/@:c#
d[sa];cl',./m โขc./@~:
s[]D[#'M./B, ,/'#S
]
#L';VKL;L'#
XW

its the same thing
in my VMM region allocator???
its uninstalling a gpe block because of some fatal init error
aka your mapping function is borked
the vmm region alloc function right?
i mean idk what u call it
also do you make sure that the alloc size doesn't exceed a page now that you are returning straight up pages for each allocation?
idk how much allocations like that uacpi makes if any but that could be a possible issue
i just did
if layout.size < 4096
do one page
thats it
all i did
ah
if layout.size < 4096:
return one_singular_page()
and do you zero the memory in that page?
try doing that first as its also used for the uacpi calloc function
CR2=0000000000000009
i zero the pages
still getting that issue
then its something different ig
i think its with the VMM
region thing
@molten grotto
does the vmm region base look valid
i feel like theres something wrong
block=0xffff80007daac00c
@kind root
and
from a glance they all look aligned
yea idfk whats going on
i even wrote some tests
they all pass
@orchid dawn could u check it out
im desperate

I still have like 20 other things I'm working on lol
even if I didn't, I likely would also have no idea
๐
its not the deallocation
i checked
i cant figure this out ๐ญ ๐ญ
back to oberrow hell

COME ON BRAIN THINk
WHAT THE FUCK IS WRONG WITH ME UGHHHH WHY CANT I FIGURE THIS STUPID
FUCKING ERROR
UNSUPPORTED GAS
SIZE
UR MOM
UGH
so annoying
@kind root my brain is dying
all this means is
whatever mapping u returned for FADT
is likely bogus
how does your map fn look like
how big is the FADT table
okay sec
okay sec
unsafe fn map(&self, phys: uacpi::PhysAddr, len: usize) -> *mut core::ffi::c_void {
(phys.as_u64() + HDDM_OFFSET.get_response().unwrap().offset()) as *mut _
}
taht should work unless your hhdm is mapped incorrectly ig
whichhh it isnt
cause i copy the above 4gb
for i in (0..0x100000000 as u64).step_by(4096) {
q.map(
HDDM_OFFSET.get_response().unwrap().offset() + i as u64,
i as u64,
VMMFlags::KTPRESENT.bits() | VMMFlags::KTWRITEALLOWED.bits(),
)
.unwrap();
hhdm_pages += 1;
}
i mean idk, something related to memory is bugged
yea and i have no fucking idea how im gonna debug this
well u can just printf
literarly what i did
also put a breakpoint in gdb