#Nyaux
1 messages ยท Page 22 of 1
Well Linux runs fine on the PS3. As today you need a jailbroken PS3, since on OFW the otherOS feature was removed. Apart from that you just need a bootloader like Petitboot and a PPC build of Linux. There is also a lot of progress in PS3 RSX (gpu) hardware acceleration
look for T2 SDE
and the ps4 is a somewhat standard amd apu iirc
and as an architecture it is so complex that still today it is THE hardest arch to emulate
minus the non standard platform
yes
i wonder if it's got acpi
well, its not "just" a bsd
its gotta be heavily modified
to actually fit their needs
and to run on their weird hardware
but they've done it, people got linux to run on it too
its not that bad apparently
When you port if of course
one thing which I don't know is whether you can get a framebuffer without actually writing/porting an amd gpu driver on it
Just do it ez
I'm sure its not rocket science to get a fb
hyper for PPC when
You dont even use it 
For hyper im mostly fixing bugs or adding tiny qol features, as it is mostly feature complete for my needs
But im not against accepting changes that others might want if there's a need
uBIOS for booting hyper oses without a bootloader when
the southbridge has a lot of familiar peripherals but in a kinda brain damaged package
like it responds to any slot number, and they ran out of functions so a whole bunch of stuff is shoved into one function
amazing everyone went over to powerpcs for games consoles when the ps3/xb360/revolution came out now everyone is on amd64 (i think, i don't know what that one nintendo uses, the wiiu or whatever it was called)
the switch is just an nvidia tegra x1 soc
which is aarch64
the wiiu is ppc since it's a direct upgrade to the wii (and that is a direct upgrade to the gamecube)
iirc
when the ps3 came out its architecture was supposed to be revolutionary (ibm "cell", 1 ppc core, 8 something-or-others) but that fell very flat
problem with revolutionary arches for consoles is that it's hard to port games and have them be properly optimized :^)
unless it's an exclusive ig
lies
okok not literally
I always considered that a stupid excuse. If you want your game to run on a machine which offers very good hardware for specific tasks and also want it to run well, why do you expect to do it without effort? Obviously there are time costraints in game development, and budget too, but just do not use excuses. ig not the best argument but I do not have time rn
oh and I am quite sure that the only reason this did not affect the xbox 360 is because it had directX and other stuff from Windows which made porting easier. (let's not talk about the memory pool division)
i mean time and budget constraints are the obvious cause for this
but also, i'm having a bit of a hard time thinking up what the spus could help you with
considering they require a bunch of setup before you run code on them
and it's compiled separately afaik so that's extra effort as well
yes
they acted like shader computing units on modern gpus work
๐ฅ๏ธ
you could run physics, sound, graphics (also with the RSX), AI, particles and so on each on one SPU
actually at the beginning Sony wanted to use two separate CELLs for the cpu and gpu, but for cost issues they ditched the idea and quickly tried to partner up with ATI and then NVidia
okay so
what does an Elf loader need to do exactly
like im unsure how to implment this i forgot a ton of things about elf lol
load the elf 
you could try to understand my copied code
it's old
what is an auxval
struct auxval
{
uint64_t at_entry;
uint64_t at_phdr;
uint64_t at_phent;
uint64_t at_phnum;
};
wha
3.4.1 is talking about fpu state
read further
dont stop 1 paragraph in
"Initial Stack and Register State"
yeah only talks about fpu state
sure.
okay i see
ooh is that fedora?
yea i switched to fedora
any issues?
no
nice
i see
and auxilary vectors kind of give
arugments to the interpreter itself
ish
am i understanding correctly
interpreter*
or rather the program that's running
it just so happens that the program is an interpreter
check mlibc source
that will tell you the bare minimum of what you need to provide
but generally linux and any other kernel that loads elf executables provides most if not all of these
where in mlibc source
on github?
so it needs these?
doesnt matter
doesnt care?
okay
like it doesnt check the order
does it
ok sorry my bad
no it doesn't matter what order they are in
as long as they're all there
#[repr(C, packed(8))]
struct Elf64EntryHeader {
e_ident: [i8; 16],
e_type: u16,
e_machine: u16,
e_version: u32,
e_entry: u64,
e_phoff: u64,
e_shoff: u64,
e_ehsize: u16,
e_phentsize: u16,
e_phnum: u16,
e_shentsize: u16,
e_shnum: u16,
e_shstrndx: u16
}
#[repr(C, packed(8))]
struct Elf64ProgramHeader {
p_type: u32,
p_flags: u32,
p_offset: u64,
p_vaddr: u64,
p_paddr: u64,
p_filesz: u64,
p_memsz: u64,
p_align: u64
}
#[repr(C, packed(8))]
struct auxvec {
a_type: i32,
a_val: u32,
a_ptr: u64,
a_fnc:
}
okay i have these structs going
what should a_fnc be
typedef struct
{
int a_type;
union {
long a_val;
void *a_ptr;
void (*a_fnc)();
} a_un;
} auxv_t;```
its supposed to be a union
how to do a union in rust lmao
union
seriously?
go try it
...
๐ญ
thats why you should learn the
language
first.
#[repr(C)]
union AuxvUn {
a_val: u32,
a_ptr: usize,
a_fnc: usize,
}
#[repr(C)]
struct Auxv {
type_: i32,
un: AuxvUn,
}```
no anonymous unions?
yea i figured it out
<insert megamind>
no ub?
oh wait...
he uses raw pointers everywhere!
you should see his code lol
๐ญ
:D
the elf file
the path?
whatever you prefer
what else
idk
๐
i see in ur code u take in base
address the elf is loaded at
i see
yes
aslr?
what did i say
lmao
just load the darn elf
okok
dont owrry about anything else
inb4 stuck for a month
I wonder what if I wouldn't have helped diagnose all those issues lol
u know the answer
im not tho?
not anymore
*mut vfs
static mut
unsafe
yes after qwinci debugs it
say?
๐
it works until you compile with --release
lmao
whats gonna happen in --release
take a guess
actually im gonna try that rn
the answer is nobody knows
because you just dropped
all the ownership
lifetimes
and pointer provenance info
so llvm can do all that it wants
let me try
oh
nah its a shit way out
it did
lmao
am i gonna have to do a third kernel rewrite
in lua
no
if you want it to be in rust, yes
lol
like im not even being mean at this point
its dogshit
i guess we are doing a third kernel rewrite
i wish i could put it nicely
but i cant
you just dont write rust like that
and expect it to work
but I want you guys to make sure that ANY code i write is the proper "rust way"
I would suggest to first learn the language you're going to write a kernel in
its ur kernel bruh
why should i make sure ur writing it correctly lmao
also everyone already told you to not write code like that
double check
anywhere where you have to use a raw pointer in rust
you should double check
because you should never have to do that
almost never*
and if you do it should be only for the abstractions that provide safety
you shouldn't use raw pointers
unless you are accessing some system resource or using a library that requires it
not even that
you should have abstractions over that too
that interact properly with lifetimes and shit
rust uses all that info for optimizations
starting now?
to write a kernel in rust
how are u going to rewrite it if u technically dont know rust still
ur going to end up with the same stuff
okay then
basically yeah
write rust code
userspace projects
that doesnt look like you just wrote
RIIC++ :^)
based qookie
do a microkernel, write it in asm, and write brainfuck servers :')
but id rather not see him struggle with that
okay so whats the perfect rust project
that will teach me
everything i need to know of rust
there isnt one
a kernel 
I love tetris please do tetris
rust is a complicated language, to learn all of what you need to know you need to really spend some time with it
you have not
i have c habits
๐ญ ๐ญ
you just translated C code to rust brother
you didnt even take into consideration what the language offers
okay heres what ill do
ill read through the rust book today overnight
and work all night learning rust
ill come back to yall tomorrow
and we can rewrite nyaux
i dont think thats a good idea
why
to do it
or have a good night of sleep
and slowly learn rust properly
its gonna take you months
but it will delay my work on nyaux
to learn rust properly
nooo
to be able to write a good kernel
it took me like more than a year or so to actually figure out how rust works
but probably because im slow
and i was just used to writing code
you need to get used to programming
idk
its like the same thing
i think it could take me 1-2 days if i really spend all my weekend on it
but it feels like its a completely different thing
lol this guy is not being serious
learn rust in 2 days ๐ญ
gn iretq
wdym
continue this rust kernel thing
i still do
i mean obviously you arent serious if you think you can learn rust well enough in a couple days to be able to write a good kernel
okay how long then
its not about how long
its not an amout of time
that makes you good at a language?
but what do i do with nyaux while im fucking
learning rust properly
i cant just
stop working on it
like it'd be the third time id do that shit
idk but you clearly cant keep working on it if you dont know the language
you are just going to end up writing the same shit code with bunch of raw pointers all around the place
because "oh i cant figure out how this shit works but it works with pointers so ill just do that!"
rewrite it in c and using raw pointers won't matter :D
like rust is not a good language if you want to work on the kernel
because you are writing rust, not writing a kernel
idk if you catch my drift
okay how abt ill come back in a week, after non stop rust development. I know i cant fully learn a language in that length of time but maybe i could be able to start on the rewrite at least
idfk i really dont wanna be waiting fucking months, osdev is my passion
why do you even want to use rust
you need to actually understand the language
to be able to make use of its safety features and shit
c(++) as in c/c++
again just give me a week, i promise that when i come back ill at least be more competent at the language
maybe make a less shitty kernel
still shitty but less
component?
and if that kernel ends up being shitty
still
ill rewrite it again
and again
and again
imo rust enum mogs std::variant 
until it fucking is good
oh yeah definitely
is that fine
Learning Rust With Entirely Too Many Linked Lists
i liked that
?
i mean up to you what you do
but as i said maybe if you want to do osdev you should do it in a language you know relatively well
unless you are fine with "waiting"
that is what im gonna do, if the kernel ends up being shit
still
ill rewrite it again
and continue this cycle
until i know proper rust and write a good fucking kernel
might take a while
we'll see
even i dont know 100% of C's features
c has no features bro
its a dead simple language
you write code
it does what you type
literally
look ill just see what i can do
im gonna go and fucking learn rust now
see yall later, ill update you guys on how thats going
well gl to you then 

i am going to sleep
im gonna write my kernel in c++ tomorrow
niceee
๐ญ ๐ญ
and then some because you triggered some ub unknowingly
i mean is there really that much ub in C
for the most part it just does what you want it to do
do it
once I managed to hit some crazy ub when just writing a tcp checksum function which was crazy
thats why i am going to use c++
well signed integer overflow, strict aliasing
damn signed integer overflow sounds funky
idk what strict aliasing even means so i dont have to worry about that one right? 
unsigned is defined to wrap around but signed is ub
yeah
interesting
it's not technically guaranteed to wrap to the lowest value
so checks like if (a + 1 < a) just get optimized out for example
because since overflow is ub and can't never happen, +1 means it's always larger
fun
good thing i always do checks like this by checking against the max value
i guess im somewhat aware of things like that, or maybe the code ends up being cleaner or easier to read that way idk
there's a gcc bug report where someone is complaining about that
so much for people knowing c 
so what about this strict aliasing thing?
are you able to tldr that or is it a bit more complicated
is it with multiple pointers pointing to the same value or something
dereferencing a pointer that aliases a value of an incompatible type
ah so like c uint64_t v = 1337; uint8_t x = ((uint8_t*)&v)[5];
well through char it's explicitly allowed 
lmao
but *(float*)&my_int
is that ub?
no if uint8_t is unsigned char/char
oh good
the proper way in c to do that would be with an union
is the famous fast inverse sqrt snippet ub?
and in c++ you'd need memcpy or such
or memcpy 
technically yeah
sweet sweet ub
you can disable strict aliasing in c with -fno-strict-aliasing
nice, now i know why its so "fast"
i assume that gets rid of "some" "optimizations"
probably nothing significant
yeah
yeah it means some optimizations aren't possible
so tldr instead of type punning actually tell the compiler about the types properly
e.g. with strict aliasing this assert might not fire struct { int x; } y = {0}; *(float *)&y = 2; assert(y.x == 0);
not even that, the compiler assumes the value of x is unchanged because the write couldn't have aliased the struct
so it yeets the assert out
yeah basically what i was getting at
oh wait
yeah that makes sense
i thought it would yeet the write and the assert
technically it could do that as well
ah
so if you made the write volatile what would happen?
would it still yeet the assert?
it still could, but i have a hunch it might not?
but i'm not sure what compilers will do, but technically volatile doesn't mean "stop caring about strict aliasing"
i see
yeah i meant in terms of strict aliasing, sorry
it would still be valid to assume that y.x is still 0
because that write could not have possibly affected the struct blah blah
with a volatile load of y.x it wouldn't, with a volatile write through a float alias, that's another matter
yeah i was just wondering what swapping out that float write for a volatile one would do
thats interesting though, ill definitely watch out for any aliasing i might or might not do in the future :')
thanks for breaking that down for me qookie
some aliasing is fine though
e.g. a pointer to struct T can be cast to a pointer to the type of it's first member
well it's useful for approximating inheritance
yueah i was about to say
it might be nice in case of like a shared header
can you do it the other way?
hmm
int* -> struct { int x; }*
i want to say yes
in practice you always turn off strict aliasing, but it's an interesting thought to consider trying to get away from it altogether
but now i'm not sure :^)
but my microoptimization... 
lol
even despite knowing better now i keep thinking that guy is lebanese
maybe turkish or syrian
An object shall have its stored value accessed only by an lvalue expression that has one of the
following types:99)
โ a type compatible with the effective type of the object,
โ a qualified version of a type compatible with the effective type of the object,
โ a type that is the signed or unsigned type corresponding to the effective type of the object,
โ a type that is the signed or unsigned type corresponding to a qualified version of the effective
type of the object,
โ an aggregate or union type that includes one of the aforementioned types among its members
(including, recursively, a member of a subaggregate or contained union), or
โ a character type.
technically it should be valid to alias a struct pointer using a pointer of the type of any of its fields? or im just misunderstanding because im tired
yeah i might be misunderstanding, not sure what "object" refers to in this case
progress so far: i learned a lot more about lifetimes and rusts safety system, im currently writing simple userspace programs with extensive use of rusts advanced features to understand the language well
i dont know the eta on when ill be able to start rewriting the kernel but lets just keep going and see how we go
mate u dont need to rush
take it easy and learn it properly
dont take shortcuts in your little programs like you did with the kernel
i wont
nice, good luck
thanks !
great idea
ill do that once i finished the book qookie gave yesterday
turns out linked lists are very useful for learning rust as a language lmao
update today
so after finishing the linked list booklet and after properly finishing the rust book i believe im ready to try another rewrite, ive already done well without using static mut and instead wrapping a static variable under a mutex making it "safe", im using lifetimes and generics and shit as well. i never cast a pointer from pointer -> address -> pointer anymore. and i am always compiling in release mode
i am experiencing a problem with my own rust flanterm bindings however
= note: rust-lld: error: /home/Rayan/Desktop/NyauxKT/kernel/target/x86_64-unknown-none/debug/deps/libflanterm_bindings-63cfa04b5ca34f3f.rlib(47dd3966b7af1aa8-fb.o):(function flanterm_fb_init: .text.flanterm_fb_init+0x186e): relocation R_X86_64_32 out of range: 18446744071562110592 is not in [0, 4294967295]; references section '.rodata.builtin_font'
>>> referenced by fb.c:1018 (backends/fb.c:1018)
i dont know if this is a problem with my bindings or
if this is a problem with flanterm on their end
no >:)
Someone in Discord linked to this tweet and I figured I'd take a stab at singing it in my totally not awful fake accent: https://twitter.com/bhilburn/status/971019559095427075/photo/1
Download:
WAV: https://kaslai.com/files/program_in_c.wav
MP3: https://kaslai.com/files/program_in_c.mp3
missing -mcmodel=kernel when compiling flanterm?
let me check
cargo:warning=cc1: error: code model kernel does not support PIC mode
i cant disable pic
it wont let me

use C, that's the solution
why can't you disable pic?
alas, we have lost another one
It's easier to learn Rust if you know C++ 
it's easier to not learn rust
it's like a parasite that once in your brain, is fatal
nice
i got the gdt and idt working too
in fact let me test that out
with a page fault lol
done
works well
no static mut
barely any unsafe
time for the PMM
pmm done
@surreal path is your code up on github?
soon
oh 3rd rewrite already?
good luck
I started mine and basically stopped
In a day
howcome you stopped?
no motivation
fair enough
after religious testing of the PMM in rust release mode, the PMM is fine and can remain unchanged mostly (other then the removal of static mut for static behind a mutex)
did u finish the nes emulator already 
kinda got it working to a point where it could parse opcodes and execute them
i didnt implement mappers or the apu or anything tho
why do u just speedrun everything 
writing one thing u can be proud of is so much cooler than many shitty things
im not into writing emulators that much to be fair 
i think its kinda cool when u just write a generic thing that executes opcodes and then all of a sudden u can run other peoples stuff on that code
but yeah i get it
nyaux might become assert os
like managarm

i just learned i can use asserts OUTSIDE of tests in rust
i am so happy about this information
remember to use asserts only for state corruption detection, not invalid external data
wym
assert!(pmm_is_ok)
^
not assert!(this_user_pointer_isnt_null)
oh gotcha
or not assert(this_hw_register_returned_0)
extrapolate this to the entire kernel, but yeah
that too
basically use asserts as sanity checks
assert!(@surreal path pushed his code to github)
the PMM has remained unchanged but the VMM is probs prone to a lot of bugs
let me rewrite the VMM
first
lmao
nah go full managarm assert everywhere you gotta assert bro just assert please one more assert please just one more assert and we'll have phd code please bro just one more assert
๐ญ ๐ญ
managarm os
more like
assert_eq(managarm)
okay that sounded better in my head
๐
religious testing

explain this atheists
vmm status: nearly complete
page table manager part of it is done
im working on the region setup function
put the code up on github !! ! ! !
also the 6502 emu too 
i wanna see how you are doing
ITS ONLINE
WE GOT THE VMM WORKING
cool stuff
already better than Techflash OS
nice job
alright lol
what was the bug
did qwinci fix it
no
qookie?

YESSSS
fortnite with the boys
less goo
nyaux nt compatibility when 
WE GOTTA DO THAT SOON YESSS
100%
instead of nyauxrs
๐ญ
๐ญ ๐ญ
working set?
set of pages required to be paged in for an application to run as efficiently as possible
in short
๐ญ
just don't support swap yea lol
lol
who swaps anyway
just buy more ram
and let programs oom instead
clearly the better choice
at least you dont risk swapping to death
Im not too far away from supporting swap in astral Id imagine, shouldnt be too different from a file backed page
#1061407633745125397 message
wrong
at least
maybe the swap in/out part can be implemented like that
but to know what you'd swap out, you'd probably want a working-set, and a page replacement algorithm (such as aging) to go with it
but note that swap in/out doesn't always go to disk
it also uses standby/dirty
*it also can use
lemme find something
#1141057599584878645 message
lets go
Yippie :3
i lit do
pub fn unmap(&self, va: usize) {
let him = unsafe { Self::find_pte(self.rootpagetable as usize, va) };
unsafe { him.write(0) };
println!("{:#x}", unsafe { him.read() });
unsafe {
core::arch::asm!("invlpg [{x}]", x = in(reg) va, options(nostack, preserves_flags))
};
}
unsafe fn find_pte(mut pt: usize, va: usize) -> *mut usize {
let mut shift = 48;
for i in 0..4 {
shift -= 9;
let idx = (va >> shift) & 0x1ff;
let ptab: *mut usize = virt(pt);
if i == 3 {
return ptab.add(idx);
}
let entry = ptab.add(idx);
if entry.read() & VMMFlags::KTPRESENT.bits() == 0 {
return entry;
}
pt = entry.read() & 0x000f_ffff_ffff_f000;
}
unreachable!()
}
BUT IT DOESNT WORK
NO PAGE FAULT

wdym doesn't work
write to cr3 again
oh
ohh is that it
yes
it shouldn't
oh
okay lets try
error: invalid operand for instruction
--> src/mem/vmm/mod.rs:187:31
|
187 | core::arch::asm!("invlpg {x}", x = in(reg) va, options(nostack, preserves_flags))
| ^
|
note: instantiated into assembly here
--> <inline asm>:2:2
|
2 | invlpg r14
| ^
that might have been correct
this
i do
and it does unmap
it doesnt
it just doesn't flush the tlb
no i need to fix this
bruh
wait i have an idea
what's your idea
what was your idea
my idea was to run in debug
nyaux dont get stuck for 10 seconds impossible challenge
๐ญ
yea im actually losing it
how long until u give up
NEVER

I cant say much because I was stuck for like hours all because I was calling the wrong gcc builtin (__get_cpuid instead of __get_cpuid_count)
he was close to giving up a few months ago
but he miraculously came back
one thing i learned also is add a check into your panic handler that its not called recursively
that will save you hours
miraculous save by qwinic 
wdym
didnt he like solve tons of bugs for u
qwinci can you fix ps/2 in astral real harwdwaire for me next pls pls plsss ๐ฅบ๐ฅบ๐ฅบ๐ฅบ๐ฅบ
Astral challenge: unfuck ps/2
challenge level, impossible
obos challenge: uncurse
challenge level: locked
qwinci pwtty please ๐ฅบ ๐ฅบ ๐ฅบ fix this dumb ah bug for me plss ๐ฅบ
obos challenge: run at least for 2ns before double faulting
challenge level: insanity
astral challenge: find one pc (other than mathewnd's hardware) where ps2 works
challenge level: cock torture
nyaux challenge: unmap a page
challenge level: months of debugging by qwinci
find three pcs where ps2 works*
it works on my laptop and desktop
but ONLY ON MY DESKTOP AND LAPTOP 
corrected
soon I'm gonna be running webkitgtk with 128 cores before ps2 works
lmao
ok I don't triple fault
I only panic
I usually only double fault
at max
corrected
i got windows to double fault only once in my entire life
by accident that is
not very hard to do deliberately
so you should probably work on that 
I don't double fault often
only a couple times during the fireworks test because of a vmm bug
but other than that, I don't really crash that much
only hangs mainly
nop
the working set list is the list of virtual address that have valid PTEs
on x86(_64), a valid PTE is any PTE with the present bit (0) set
That is what the denning working set paper said iirc
this is just a concrete operationalisation of what denning proposed
As in, what I said was from that paper
So you're saying that only I'm doing it that way
i also implement it that way
Ok good to know
This is the way I understand working sets
Does managram have swap/working set?
probably not
(I'm wanting/trying to implement it in my OS, but I'm stuck with locks)
how did managarm get involved in this whole thing lol
no managarm doesn't have swap
no
So OBOS and soon NyauxKT >>> Managram?
managarm works by allocating memory and praying there is enough physical memory to cover the allocations
quite literally 
in that regard, sure i guess
i wouldnt call it praying
you can call it an assert its okay
it literally asserts if there is no free physical memory
Skill issue, real posix oses just sigbus 
What happens in release mode?
i hear thats great for reliability :^)
it.. asserts
probably
idk
compile and test it yourself if you wanna know
I mean asserts are supposed to be removed when not debugging..?
no its managarm
asserts are forever
assertions are typically removed in non debug builds. Do you not have a "release" mode?
idk
i'm not a managarm developer lol
fwiw tho, iirc they use meson debugoptimized
so it's debug release :)
Managarm without asserts is like an angel without its wings
TRUTH.
I was working on bubbling that up. Soonโข๏ธ that shall no longer be the case
Itโs even a draft PR (699)
But that just returns a nullptr and that then needs to be handled back up the stack, that part is still lacking. Iโm pretty sure I left for summer vacation and I just drafted it in
that doesn't mean you don't have UB in your code :)
just the parts using references don't have UB
creating a reference still might be UB
THEN HOW DO U MAKE SOMETHING COMPLETELY NOT UB ๐ญ
fair
creating a reference is ub unless the normal requirements for references also holds up for the pointer
yep
and with strict provenance, integer -> pointer casts are UB which are kinda required for like PA->VA conversion
i do not have strict provenance enabled
and i will keep it disabled
i believe MIRI runs stuff with strict provenance or something like that? I don't actually know much about provenance lol
even if it's not exactly strict provenance, MIRI will be REALLY MAD at creating pointers from integers
who cares abt what miri thinks
anyhow if you really wanna "prove" your code is UB-free, extract pieces of it to run in miri
im just gonna use references everywhere anyway
you can mess shit up with references too
it's not easy to check if you're correct without the right tools
it would be really cool to do a unit test + miri setup of sorts
slab allocator and pmm done in safe rust
should i take a break
for an hour
or vmm now

slab isnt safe rust*
wha
itโs not
how
well it's fucking not!
okay chill iretq ๐ญ
you still use raw pointers
ONLY A FEW TIMES
dereferencing them into references doesnt make it safe
lol
u took ur code
and everywhere u made it into references
that doesnt make it safe
its still the same inherently broken algorithm
okay so how ELSE am i supposed too write it
how is the algorithm broken huh
ur creating pointers from thin air
explain @thorn bramble TELL ME
i just did
and how else
am i supposed to write it
then taking pointers from "thin air"
bro ๐
without all this shit
whatever man as long as the UB is reduced so it doesnt have weird ah bugs its fine
you didnt reduce anything
you just asked rust to do borrow checking on raw pointers xd
yeah as i said yesterday
u did rewrite some parts to be more proper or whatever
few less parts to worry about i guess
you can only create pointers from pointers
if you really want it to be 100% safe
look i give up rust
but you're doing kernel work, just assume it's gonna be fineโข๏ธ
it will be fine dw
it's basically the same thing as being careful with certain stuff and marking stuff as volatile in C
just don't get it optimized out
finally, you have restored normal brain function
and it's fine
or reordered
rust my beloved
boo
i dont c++
know
c++
learn
Rust user detected, opinion rejected
even if i already know C
i enjoy writing a kernel in rust, it's definitely not something for everyone
it's going to be easier to learn c++ coming from c than rust
just do C
u sure?
yes im sure
C is easier anyway, no vtables to worry about
:(
okay ill try it out then
i don't get why so much hate on rust here
you'll end up learning C++ then ending up being confused as to why some stuff don't work
or write C-like C++ code and get flamed
i believe as long as something's main selling point is not blazing fast rust ๐ it's ok
yeah I kinda forgot about the "in kernel easily" part
I have most of the things already set up and configured so I don't have to worry about most stuff
like why would you even care about the language you're using other than comfort
i am most comfortable with rust
still doesn't give you some runtime support
(a lot of)
also global constructors are wacky
does C++ have an equivalent of panic=abort
and to be avoided
abort()
terminate()
in kernel mode
ok so C++ exceptions are not usable in freestanding whatsoever?
you can port llvm or gcc libs, it's not hard
I have done it before with both
a few years ago
anyhow