#Nyaux
1 messages ยท Page 26 of 1
you just make them yourself
bru
Making closures in c is weird
for (size_t i = 0; i < arr.size; i++)
// do shit
do not know what that is
therefore argument invalid
i hate dealing with "strings" in C
iterators are way nicer than for loops
lies
one of my biggest reasons why i struggle
you dont do closures in C
You can... you just gotta pass around both a function pointer and a data pointer
But it is kinda cursed
look im just not gonna switch language and keep banging my head againist the wall until everything works
even if it takes years
because it wont matter what language i use
im just a horrible programmer in general
plus i havent used C/C++ in a long time
you've clearly never tried iterators properly
I have
maybe itll work if i bang my head hard enough looking at the disassembly
idfk
I used c++ for the longest time
depends where
but would probs be something like
iter::rev() -> Slice::iter() -> main
anyway, I use C and I will not fall into these language features
there's not a lot of ways stuff can crash in an iterator unless you explicitly use unwrap or something
yeah
they cant rlly fail
the only thing I could think of is with fixed arrays
like
well
smallvec
which is a vector with a fixed limit
I remain content with my for loop.
I mean smallvec ran out of space is simple enough to figure out
Also in rust you don't even need backtraces much, which is why they are disabled by default
Array<int, 10> array;
array.iter().collect<SmallVec<int, 5>>();
this'll just panic
I could maybe make my Container trait require push_back returns a Result<> but that would break stl containers
wdym lol
he said that right as he said he hates rust, so i think he expects a bit more than an operator++ wrapper
C++ has ranges
i mean sure, you can probably write some crazy shit with the new views stuff, i havenโt looked into that exactly
or ranges..?
i winder how the codegen is compared to rust iterators :^)
iirc they are optimized pretty heavily in rust
godbolt time
eh i cba writing anything more complex in rust and rewriting it in c++ with apis that i dont know lmao
especially on phone :โ)
write a rust one and I'll provide the C++ version
actually i could just chatgpt that shit

but yeah ill see once i get on my pc lol
I really wanna see if you can do this in c++ https://docs.rs/uom/latest/uom/
Units of measurement is a crate that does automatic type-safe zero-cost dimensional analysis. You can create your own systems or use the pre-built International System of Units (SI) which is based on the International System of Quantities (ISQ) and includes numerous quantities (length, mass, time, โฆ) with conversion factors for even more numerou...
I don't see why not
in fact, it'd probs be easier to do in C++
just a bunch of operator overloads
Why are they stupid?
they're not but you shouldnt use them most times
Implement a library like that?
yeah just operator overloads
something like
Velocity operator/(Distance, Time)
Distance operator*(Time, Velocity)
there's already std::chrono for time
velocity and distance can be simple classes
yea
It's not that simple, it's generic for every possible si unit
you don't need generics or templates
mul<L1, M1, T1, L2, M2, T2>(x: Unit<L1, M1, T1> y<L2, M2, T2>) = Unit<L1 + L2, M1 + M2, T1 + T
2>
that's overcomplicated imo
you would do the same thing chrono does
just have different constructors for si units in Distance and Velocity classes
and use metres and m/s as internal storage
then do operations on them
and have operator overloads for conversions
ezpz
Right, but what if I need to use something like m^3 * kg^-1 * s^-2
In my example above, Distance would be an alias for Unit<1, 0, 0> and Velocity would be Unit<1, -1, 0>
okay apparently it's actually really easy
template <int L1, int M1, int T1>
template <int L2, int M2, int T2>
Unit<L1 + L2, M1 + M2, T1 + T2>
Unit<L1, M1, T1>::operator*(Unit<L2, M2, T2> const &other) {
return Unit<L1 + L2, M1 + M2, T1 + T2>(this->value * other.value);
}
just add operators for integer multiplication and division?
I don't quite understand what you're doing
I can't store the result of that without either hardcoding a ton of units or creating a generic unit type
oh yeah then have another class Unit
Right, then Distance can just be an alias for Unit<1, 0, 0>
yep
And you can have a distance_from_feet and other functions
or just have every operator overload return numerical values
no more need for templates 
Yeah but then you don't get the automatic dimensional analysis
simple wrapper over a number that stores that extra information
I need to try to implement it first to know if it will work or not
i am
:3
anyways ill just debug this problem after i uh
finish eating
which is gonna be like
a while lmao
we are outside at kfc!!!
imagine
ummm might not be able to get any work done today :c, dad taking away all my devices cause of me skipping school for osdev
๐
you shouldn't be skipping school for osdev
you shouldn't be skipping school at all, unless your ill
or depressed
i got closer, used .mask instead of .mask_with()
seems like a garbage addr
.mask does &
.mask_with allows u to do whatever operation u want
its good we are closer
i still have to figure this out tho
i got my devices back (yippie!)
but my dad is putting a time limit on my laptop for the time being
๐
yea but yk
i am determined to make bash run on nyaux one day !!
ima keep debugging
don't skip school
yea my dad already gave me a good shouting at for that

reading the kernel name in my mind sounded very alike to meaw kitty
skip school -> 24 hr osdev mute 
check the very first post
lol
okay seems valid here
found it
okay so this bitmask is just wrong, its not
whatever .map_addr is
ah smart!
let me take the virtual address of the pte
i don't think that's how this works man...
so the bitmask is wrong
no?
okay so whats the issue???
i cast pt
pt = entry.map_addr(|a| a & ...)
into a *mut u8
yes
what that mask is?
yes
i want to get the next table
cuz thats what the point of the mask is
what is it masking here
to get the physical address to the next table
:dream:
READ THE ENTRY
I AM READING THE ENTRY
DONT MASK THE FUCKING PTE POINTER
DO YOU EVEN KNOW WHAT MAP_ADDR DOES?
RTFM
UR CREATING INVALID POINTERS
iretq is going joker mode
OKAY THEN WHAT AM I SUPPOSED TO USE
jkoefaKLPFGMWERsjkpgBRKRsKR
'GKRSRS
adfs
sf
sorry
i told u
already
Read the PTE.
THEN mask.
.
fucking idiot i am
Possible spam detected for user: wre4sfterwsfd. Please contact a moderator to be unmuted.
.!unmute @thorn bramble
Unmuted @thorn bramble
I FORGOT THIS DAMN BOT EXISTED
๐ญ
I feel like yorue gonna have a fucking breakdown at this rate ๐ญ
okay ill read the docs next time before even using any rust function
not just glancing at the vscode
๐ญ ๐ญ
who would have thought...
lets check
if the uacpi gdb bug is still there
@molten grotto ITS STILL FUCKING
DOING THIS

I DID
i dont see a reason why this would happen only under gdb
qwinci said it has to be my allocator or something
and through gdb i found out it was my vmm
so i fixed that
and its STILL doing this
does it happen without gdb?
no
lol
wait chat active
lit perfectly fine
yea and
objdump -d kernel | grep '800002c0:'
?
u can addr2line that too i guess
and figure out what it is
theres no ub
here
wtf
and addr2lines rip
like u know that
doesnt taking me anywhere
lovely
i mean i cant help much so thats all i can say
i found where its
doing that
@kind root
do you know whats going on
im reading the object dump and like
idfk know whats going on
ud2 is called a bunch in uacpis own code too
the rip points to nothing
its my PMM
i knew this day would come
don't ghost ping
sorry
SORRY WHAT
it ud2s here???
fun
okay on release
it page faults on vmm_region_alloc
and on
debug
it ud2s
kill me
genuinelly
how does this code cause ```rs
let mut store: Option<&mut VMMRegion> = None;
for (idx, i) in self.head.iter_mut().enumerate() {
if store.is_none() {
store = Some(i);
continue;
}
let temp = store.unwrap();
if i.base.wrapping_sub(temp.base + temp.length)
>= align_up(size as usize, 4096) as usize + 0x1000
{
let new_guy = VMMRegion {
base: temp.base + temp.length,
length: align_up(size, 4096),
flags,
iskernel: false,
};
let amou = align_up(size as usize, 4096) / 4096;
for i in 0..amou {
let data = {
let o = pmm_alloc().unwrap() as *mut u8;
unsafe {
o.add(HHDM.get_response().unwrap().offset() as usize)
.write_bytes(0, 4096);
}
o
};
self.map(
data.addr(),
new_guy.base + (i * 0x1000),
new_guy.flags.bits(),
);
}
let h = core::ptr::with_exposed_provenance_mut::<u8>(new_guy.base);
unsafe { h.write_bytes(0, new_guy.length) };
self.head.push(new_guy);
return Some(h);
} else {
store = Some(i);
continue;
}
}
UB

page fault non present of course
im losing my mind
i wanna die
chat
Probably just stop sprinkling unsafe everywhere
If you're gonna write unsafe everywhere just write c
You're kinda supposed to abstract/encapsulate it
The channel said one ping the inbox says no ping :/
because the message was deleted probably
sorry
i pinged u earlier
im trying to
also sorry chat
no work for today
i feel awful
im sick :c
agreed, rest up and take care of yourself first ๐
This made me notice that you aren't mod anymore
he didn't wanna be
That makes sense
This is my favorite way to debug ub
Works every time
still sick

ill be on that nyaux grind when we no longer sick
also theres like a storm going on here
lmao
OKAY WE MIGHT BE ABLE TO GET SOME WORK DONE TMRW
IM STARTING TO RECOVER CHAT
IM SORRY ITS BEEN NEARLY A WEEK AT THIS POINT
ACTUALLY ITS BEEN A FEW DAYS BUT WHATEVS
Nice
FEELS LIKE A WEEK TO ME ๐ญ
yesss ๐
sorry chat been sleeping all day will be working after i take another nap
my sleep schedule is fgucked
๐ญ ๐
IM BACKKK
LES GOOOO
WOKR TIME
WHOOHOOOOHOOH
NYAUX GRIND
!!!!
okay
i have found two bugs
one related to
pmm _init
clearly some UB
and one related to
something else
bru
Least buggy nyaux snippet
im fixing it
like wait
WHY IS THE CR2
FUCKING
THIS
WTF
Lmao
oen sec im gonna print the hhdm
OKAY THATS SO WEIRd
PRINTING THE HDDM MAKES IT FINE
BUT WHEN NOT PRINTING
IT JUST
CRIES?
AND DOES SOME GOOFY AH SHIT
WTF
?????
why not use a simple bitmap
@kind root all the bugs im going through is most likely coming from the PMM itself
i need some kinda of equivent to std::launder
Its called C
๐
okay even after
that
still getting the HDDM causes a opcode exception
fucking hell
ffffffff800045d0 <NyauxKT::mem::pmm::pmm_init::{{closure}}>:
ffffffff800045d0: 55 push %rbp
ffffffff800045d1: 48 89 e5 mov %rsp,%rbp
ffffffff800045d4: 48 83 ec 10 sub $0x10,%rsp
ffffffff800045d8: 48 89 7d f0 mov %rdi,-0x10(%rbp)
ffffffff800045dc: 48 89 75 f8 mov %rsi,-0x8(%rbp)
ffffffff800045e0: 48 8b 06 mov (%rsi),%rax
ffffffff800045e3: 48 8b 38 mov (%rax),%rdi
ffffffff800045e6: 48 83 c7 10 add $0x10,%rdi
ffffffff800045ea: 48 c7 c6 00 18 06 80 mov $0xffffffff80061800,%rsi
ffffffff800045f1: e8 7a 00 00 00 call ffffffff80004670 <<limine::memory_map::EntryType as core::cmp::PartialEq>::eq>
ffffffff800045f6: 24 01 and $0x1,%al
ffffffff800045f8: 48 83 c4 10 add $0x10,%rsp
ffffffff800045fc: 5d pop %rbp
ffffffff800045fd: c3 ret
ffffffff800045fe: cc int3
disassembly looks like tis
this
okay im using a debugger for this
rust people say the stack might be getting fucked or smthin
OKAY WTF
IT WORKS FINE ON GDB
yea okay
we are switching to C
im done
@finite summit u happy!!!!
nyaux rewrite #13
im not joking
rust aint for osdev
skill issue or not
idfk im switching to C, rust is fine as a userspace language but i love C for kernel development
๐
Yes
Based opinion
now im gonna be straight honest its been a while for me with C but
im sure this wont be too big of an issue since i kept writing rust C like
๐
btw what is a cc runtime
????
and libgcc provides what?
Some compiler stuff
what happened to it
LMAO
BRO
for C++ lol
okay we are so back
im gonna experiment with va lists rqrq in userspace C
brb
:)
Probably a good idea, especially for the way you code. I'm planning on sticking with rust, but I'm gonna be very careful with unsafe.
fair
okay ive been experimenting with userspace C and ive got to say
UNIONS ARE SO FUCKING COOL
OMGOMGOGMOMG
I LOVE UNIONS
@finite summit do u love unions
i love unions
useless
ill give u one use for them 
typedef enum {
FAIL,
STRING,
PTR
CHAR
FLOAT,
} Type;
typedef struct {
Type type;
union {
char *str;
void *ptr;
char cha;
float floa;
}
} result;
result higuys() {
result hi = {.type = CHAR, .cha = 'H'}
return hi;
}
DONT TELL ME THATS NOT OCOL OBERROW
and the size would be like
super small cause as u know
unions only have one piece of memory and whatever variable u modify in a union changes that piece of memory
@finite summit if u dont write code u like ur missing out

what exactly about va lists?
idk just mess around with them lol
they are funny funny hehehahah
I abandoned the idea of creating a kernel in Pascal because it did not have va args
@kind root are u happy about this change
๐ญ
(and base 1 array indexing)
imagine doing vga_buffer[0] := 65; (or whatever) and it does not work
only to figure out it does
mov bx, 0xb7fff
mov al, 0x41
mov [bx], al
something like this
then I realized it was base 1 indexing
isnt that just making bx a ptr to 0xb7fff and putting the value of whatever is in al into bx derefed?
yes
that's what that assembly does
but the thing is, the vga_buffer variable was 0xb8000, for the text mode video memory
so index 1 is 0 so 0xb8000 and index 0 is -1 so 0xb7fff
yo how do i make clangd stop with this goofy ah errors
wheres my lsp completeion
rahhh
you have configured it right, right?
and given it a compile_commands.json
no
.
there is some tool
called bear
idk how good it is
but it can make one for you
or if you're using cmake
oh i see
and how they would be compiled
github is being stoobid
I think that clangd assumes it is in $(project_root)/build/
in any case
you can tell it what directory it is in
and do not put this on the git repo btw
--compile-commands-dir=
where do i put this option
to clangd
bear is honestly one of the best tools
ia gree
i am green
bro
oh right its not in src
cool got flanterm and nanoprintf working
welp gdt time ez fr
nyaux c rewrite?
yep
damn
got tired of rust
the fucking UB shit
too much
we have been stuck for months with this hsit
bug after bug
its annoying
so like
time to actually get a real working operating system
based
exactly
ok gdt done
idt next lol
now on github
idt time ig
lol
wait no actually the first thing im gonna do is extract my symbols for stack traces
just gonna translate the code from rust to C
should be easy considering i write rust C style
wait nvm
i need memory
so uhh idt first
then pmm -> page tables and vmm -> yk the drill
Lol
thats a wild take
I have only used them in two cases:
classes where you can have either stack or dynamic buffer
structs where you want to access either bitfields or entire value
Oberrow L take
Why not C++? (instead of C)
ok chat im gonna sleep some more
then we go on nyaux grind
chat i may have an addiction to sleeping

also my gf is staying over wit me rn and she doesnt want me out of bed rn
Didnt she dump u
she did but we got back together
Also ur like 13

very epic truly
infy after forgetting my age for the 2nd time
๐ก
arent u like 20 somethin
idfk
Never has been real, low level devs dont get bitches
No I just saw ur pic
damn F's in the chat for sanana
you are better than this
does anyone have an assert macro i can use in C
like how do i get asserts going
in C
#define assert(x) do { if (!(x)) die(#x); } while(0)
it's literally the Limine template ๐
and why is the gdt ptr struct not in the .h file 
because its not gonna be used by anyone
only gdt.c
why are you rewriting it again
Rust ub
drives me insane man
now it's gonna be c ub instead
no
Harder to invoke but probably
i swear to god
if yall say im gonna make UB
thats not even fucking funny
Every c kernel has some sort of ub
yea but im not gonna make UB thats gonna make it not work
use ubsan
I copy pasted some random kernels implementation
(I should probably add in the license now that I think of it)
((it was mit iirc))
including linux?
or astral
or mangarm
wait managarm c++
managarm asserts the ub away 
i wont have UB 
assert(ub == no)
i will assert the ub way too

nyaux == managarm 2
@tawdry mirage what is ur opinion on this information
anyone know of a spinlock library or somthin
i know barely anything about atomic shit and like
lol
spinlocks are trivial
you basically just pause the cpu and you check for an atomic bool
just lock.compare_exchange(FREE, HELD) in a loop until it is successful
There's more stuff that you can do but that's all that's needed
use atomic flag
Isn't that a c++ thing?
note that you should have preemption disabled with syscalls held
nope
considering I use it in C from stdatomic.h
syscalls
*spinlocks
lol
idk why but when I use lock cmpxchg my syscalls go to shit
*spinlocks
goddamnit
what
since I'm cool and use irqls I can raise the irql to IRQL_DISPATCH to stop scheduler preemption
but keep other irqs
๐
Here's what spin does https://docs.rs/spin/latest/src/spin/mutex/spin.rs.html#177-195
Source of the Rust file src/mutex/spin.rs.
I know, but that doesn't mean you can't read rust code
๐
Be banished, rustian
nah hes chill
fair
you managed to make spinlock code unreadable
congrats
meh
there is some ifdef
irql newIrql = minIrql == IRQL_INVALID ? IRQL_INVALID : Core_GetIrql() < minIrql ? irqlNthrVariant ? Core_RaiseIrqlNoThread(minIrql) : Core_RaiseIrql(minIrql) : IRQL_INVALID;```
uh oh
wtf is this
dw about it lmao
this shit makesm e wanna commit rewrite nyaux in assembly
I am going to remove it since it is... questionable
#define SPINLOCK_INITIALIZER 0
typedef int spinlock_t;
static inline void spinlock_lock(spinlock_t *lock)
{
while (!__sync_bool_compare_and_swap(lock, 0, 1)) {
#if defined(__x86_64__)
__asm__ volatile("pause");
#endif
}
}
static inline void spinlock_unlock(spinlock_t *lock)
{
__sync_bool_compare_and_swap(lock, 1, 0);
}
@surreal path
for free
Go for it, become truly based
NAH DONT BE WRITING CODE FOR ME ๐ญ
i didnt write it for you
ill look up the functions being called here tho
__sync_bool_compare_and_swap(lock, 0, 1) means if spinlock == 0, then spinlock = 1 and return 1
I'd assert the unlock swap, cause if that fails something has gone very wrong
how can it fail
its literally setting a bool
If you try to unlock a lock that's isn't held
Yeah but if you ever try to do that something has gone very wrong
Maybe it's just me but I like to assert anything that's easy to check and shouldn't happen
is that a challenge?
Also, I feel like there should be kernels that run with both ubsan and kasan set to fatal
tbh ubsan doesn't really catch all kinds of ub either so its not that hard to pass it
it does catch some things like if your stack is not properly aligned
what stuff doesn't it catch?
Aka most scary ub
same even tho its unlikely to cause any issues in practice I definitely do stuff that violates it and it wouldn't be fun to debug some random issues caused by the compiler taking advantage of it
suicide attempt
Wtf why
Long story
We have the time
๐ซ
Hopefully you get the help you need, we're here for you if you want to talk
look its fine, this isnt the place to talk about such stuff
lets just
get back on nyaux grind
should the pmm have a spinlock
its a basic freelist pmm as usual
okay
rule of thumb is if it's going to be accessed by someone else then you lock it
even when allocating and deallocing
use the lock
okay
okay
int 3```
as simply running asm("int $0":::); triple faults
well maybe
just maybe
your IDT is broken
it's the handler
so fix the handler
and you know that because you used a debugger to pinpoint that
when i use lidt
that means nothing
the cpu only looks at an idt descriptor when its specific ISR should be called
ik
anyway can't fix it rn
focused on paging
then i'll re-do interrupts
oh shit
this is no where near related to nyaux
Why does it triple fault? You can use -d int to log every interrupt
ur interrupt handler is bad
do -d int
when running qemu
ik
lost it :D
what
registers rax-r15

are you not looking at the code right now?
nah
miracle debugging
i lost it
waiting until the code fixes itself
stupid linux mint didnt save
wdym it didn't save?
i can explain
if you executed it then it had to have been saved
sure ig
linux mint more like linux sour
hush
arch was quite fussy on my machine
I mean the first one was broken, so maybe rewriting will fix it
anyway
wait why is my uptime 11 days lol
off to rewriting that idt from memory
stuck to window cause acer gaming laptop support sucks
- help from the intel sdm and osdev wiki

these 2 only
yeah my friend has a gaming laptop
save ur registers
wait wtf?
huh?!?!
my pc is beefy
after spitting some acpi errors
had no problems
and bluetooth errors
then starting smoking (according to him)
and takes minutes to boot because of the bluetooth errors
after a timeout it boots
I was about to say maybe we could help you with it, but it seems like you've been cursed by the hardware gods

struct regs {
uint64_t rax, r10, r9, ...
} __attribute__((packed))
void handler(struct regs *frame) {
kprintf("weee");
}
asm stub handler:
push r9
push r10
push rax
call handler
pop rax
pop r10
pop r9
iretq
its lit this easy
also
there
perfect
if u fail this up ur just like me 
nyaux try not to fail basic ah task
frfr
Not quite, you gotta handle the fact that some interrupts push error codes
yea true
doesnt the error code usually get pushed
i feel like that's something to capture
what i do is push a dummy error code
i do the same
(only with isrs that don't push error codes)
struct regs {
uint64_t error_code, rax, r10, r9, ...
} __attribute__((packed))
asm exception stub handler
push r9
push r10
push rax
call handler
add rsp, 8
pop rax
pop r10
pop r9
iretq
asm non exception stub handler
push 0
push r9
push r10
push rax
call handler
add rsp, 8
pop rax
pop r10
pop r9
iretq
something like this ^
if u use nasm
use some nasm macro shanngains
?
first i save it to rbx
in order to pass the regs n shit
or do i not need to align
some abis require aligning the stack
not for my abi
nope
u dont need to
i'll try something out
x86_64 systemv abi
I OWN SYSV ABI
requires stack to be aligned to 16-bytes at call
yeah
usually is
i aligned the stack before calling the int handler
so theres like no need to check
but if you do it it's no harm ig
as long as you don't round it down 

got it
and rsp, ~16```
lmao
I love xor
me too
0 -> 0
1 -> 0
0 -> 1
0 -> 1
1 bit stack
get boom'd
๐ฑ
@spice yarrow
unwrap in C
crazy
ik
i also have asserts :)
le very cool
yes
rust=๐คฎ
^^^
lol
Download high-quality audio here: https://fasterthanli.me/blog/2019/program-in-c/
Lyrics by @Cinememer: https://twitter.com/Cinememer/status/937826627815333888
show've told me months ago smh
oh wait
u did
๐
(before I sleep, I want to say: don't attempt suicide again though, we'd genuinely be sad if you died)
okay
gn
so far lgtm
though in this context, a null IDT would be loaded, the gates need to be set
quick question
can IRQs be just an ISR that pushes a dummy error code and calls some other handler other than the isr default
@surreal path (please beat me up if you don't want to be pinged)
15
i am da triple fault master
it happened
%macro pushr 0
push rax
push rcx
push rdx
push rbx
push rsi
push rdi
push rsp
push r8
push r9
push r10
push r11
push r12
push r13
push r14
push r15
%endmacro
%macro popr 0
pop r15
pop r14
pop r13
pop r12
pop r11
pop r10
pop r9
pop r8
pop rsp
pop rdi
pop rsi
pop rbx
pop rdx
pop rcx
pop rax
%endmacro
extern handleInterrupt
extern handleIrq
%macro isr 1
global int%1_stub
int%1_stub:
push 0
push %1
pushr
mov rdi, rsp
call handleInterrupt
popr
add rsp, 16
iretq
%endmacro
%macro isr_err 1
global int%1_stub
int%1_stub:
push %1
pushr
mov rdi, rsp
call handleInterrupt
popr
add rsp, 16
iretq
%endmacro
%macro irq 1
global int%1_stub
int%1_stub:
push 0
push %1
pushr
mov rdi, rsp
call handleIrq
popr
add rsp, 16
iretq
%endmacro
isr 0
i've only defined isr 0 for testing purposes
i'll define the rest later
what's the output when you use -d int (post it on pastebin)
You forgot the part where I said I was gonna cry myself to sleep because I was imagining my friends dying
Oh yeah
this was the last log before it triple faulted
just use spin or some other crate until you know exactly what you need for your locking primitives
and for some stuff use Atomic* types from core
like i store my HHDM in a AtomicUsize
which technically is also UB because that doesn't keep the provenance of the HHDM pointer but it's really fine
when you're writing a kernel in rust, you are really fine doing stuff that would otherwise be not fine
just you keep overdoing it, then expect nothing to do what you want it to do (e.g. memory corruptions
this really applies to everything that you can take from std or crates
if you can take something from an external dependency, do so and replace it when it isn't exactly what you want