#Nyaux
1 messages Β· Page 56 of 1
which is 11 minutes long
nvm
its not working??
seems like i need something for virtual
for it to actually work
it isnt actually doing any of the calls for some reason
nvm?
seems to be ub caused by not making write virtual
oopsie
base class has virtual
child has method
yep
ret?
your return type bruh
that doesn't really do anything, it'll just throw an error if you're having skill issues during typing
just some good practice
I remember it helping me once
it's implicit on the virtual functions (?)
it is
but that way the compiler is allowed to complain
but if you mark one, you need to mark all of them
Bruh, I didn't read the message above
and there needs to be a virtual method with the same type in the base class
I need to go to sleep
But clang complains if you don't have override
At least with my flags
what flags would those be
I think GCC is more lenient?
Don't think concepts can be used for thst
How I do it is just using a bunch of templates
for what?
-Wall -Wextra
clang doesn't complain with that
It can help with type deduction?
Maybe
you must have a method marked as override somewhere else
For formatting
why not?
I'm doing this for my IPC
those memes must be true though
nvm if you mean like formatting types like numbers or whatever
*potential starship launch

Now that I think of it, why the optional parameter is not std::option?
But I don't think I really use them for formatting specifically, I abuse them in other parts tho
Oh, it was because you can't have references in that
C++ stl decided to not have specification for that
@tender gorge 
I think several people on this server were saying that for a long time
love you too /p
But Rust blah blah blah
im actually liking c++ a lot tho
seriously
I really like C++ but there's definitely a lot of stuff to know about
Yeah, every day you learn something
i like how easy everything went with classes
There are lengthy wikipedia pages dedicated to very small aspects of the language
tho there is a lot to learn
Like SFINAE
SFINAE is easy
CRTP is cool
Also I still don't really know what && is and what std::forward does
I just use it 
no idea what yall talking about but oki
And they've made it much better in C++23? (or 26)
Yeah that's a good example
it moves objects
No that's std::move!
me too lmao
I get interested, I read about it, learn, forget a few days later
Also don't forget std::launder
that's for telling the compiler to not assume some sane assumptions about modification of data
like modifying a const variable
Clearly I do not know that much C++ lol, I'm barely understanding any of this
there's always std::get_money
inline is not inline
That one I learned like last year
for modifying member variables from a const method and allowing the modification of captured references from a lambda
yeah
well you could
like I would have a class, where I have a container and a spinlock
it minimises the need for putting mutable everywhere
And I would make locks mutable for const getters
which find things in containers
why would you need a lock in a const method though?
https://github.com/nyx-os/atlas/blob/master/include%2Fatlas%2Fiter.hpp look at this code
This is probably the best piece of C++ madness I've written
std::move(*this)
It's not that bad
Yes
what's wrong about it? 
Yeah that's why I'm saying it's my best one
it's strange
is this from that rust+cpp code you posted a bit ago?
some of my recent code
Yea it has a pretty rust-like interface
I'm waiting for pattern matching to be accepted into C++
why not just call the operator=
This should maybe be std::forward now that I think of it?
{ operator=(std::move(r)); }
what's the difference?
what it does is more clear
No I think this is right
std::forward would be used for passing it
but the operator takes a &&?
Move is clearer anyway since you're saying "this won't be used anymore"
that's why I though move(*this) was strange lol
Nah look at the remove_reference
*this is a copy
is it?
Well yea you're moving from the copy
wouldn't T still be Right&&
*this is a reference
Yea but the remove ref would bring it to Right
return type doesn't have remove_reference
So it'd be back to Right&&
Yes
T&& = Right&&&&
std::forward would return right&&
^?
jumpscare
lol
Oh yeah fuck I'm blind sorry
Also yea you're right
I forgot why I even move(*this) but that isn't an uncommon pattern afaik
Maybe both are right in this case?
hmm well I believe both would do the same thing
Average c++
lol
5 minutes launch
they're holding it (?)
yes
may i introduce you to managarm/frigg
be fr
The solution to all C++ problems is just reimplementing the world 
the biggest cancer of c++ are the stl streams
simple solution, don't use them
containers are fine, except for lack of hash of pair/tuple
the containers are not fine because they throw
they are okay for userspace programming
like if you're writing a regular ass userspace program then they are more than okay
I agree
But you can't use them in kernel
(I mean I had exceptions in my kernel)
(but still)
Also there's std::print now
rip booster
Rip ship
i am well aware
i was more so talking about using them for file io
crazy
i was working on fbdev but uhhh now ive been up for 24 hours
and i need sleep
yet i cannot sleep weirdly?
nah, this follows the standard
my coding style was a bit "ew" when I wrote it though
atlas better β’οΈ
what are we talking about
Felt
oh god what is that
isnt fbdev is simple
no not the info structs
?
they are kinda complicated idk how they work very well
like idk what a pixel clock is or what sync is
not relevant to you
put dummy values
where are they??
I remember using this
https://docs.kernel.org/fb/api.html
found them
im guessing this explains how the red green and blue bits are formatted?
how is the limine framebuffer formatted
idrm
huh?
what huh
whats not compatible with linux
the limine fb struct
ik
what do you mean then
i meant
like how are the bits formatted
for each pixel
ive never really did much framebuffer shit
ive slapped flanterm onto nyaux and called it a day
vro
for masking and shifting the respective color components
exactly
okay makes sense
(pixel & mask) >> shift = red_color
so if bits were formatted like RRRGGGBBB
it would be
111000000 for red
etc etc
and shift would be like 6
sure
k makes sense
u don't need to worry about these values yourself
you just pass them to userspace
and xorg does the magic
okay
or whatever else you're porting
where is this from
The code or the sticker?
You don't really need an advanced fbdev for that
^
The code
Polaris back in start of 2022
Iirc

I figured out the issue later
Neptune was doing some bit manip which returned the incorrect result at times
So fixing that it worked
nice
using kde is better
usable + works
and ram usage isnt too crazy
6gb with firefox discord and alacritty open and screensharing with audio on walyand
mine uses 1.9gib on fresh boot
(with no startup programs of course)
me everyday:
cooked fried boiled
literarly cannot do shit
computer has become so unusable
if installing artix no workie
going back to windows cant deal with this shit no more chat
Just install fedora, debian, ubuntu, whatever
nothing works
arch trolling me
so im reinstalling with artix
i dont like fedora, debian is debian, ubuntu is ubuntu
I wanna try arch at some point
install gentoo
bro is doing anything but trying opensuse π
"what is a stable system"
i saw that fucking url
honestly based
to be fair, i used to own racist.monster
i don't own that domain for the record
just a gif i have in my gif picker
(and inb4 yes the url is a part of the joke)
marvin just told me
symbols have size
too
so we can make nyaux's stacktrace wayyyy bettterrrr
ready to boot into artix
gotta love the steak logo
i can stand by this propaganda
better nyaux stacktraces coming ur way
thanks to @supple robin for telling me st_size exists
st_size?
Elf64_Sym::st_size
my boi is mixing up c and c++ and is doing stack trace
yep
c++ mangles names
ik
the sigma solution is add extern "C to every function !!!
no
no, there is a reason why names are mangled
it's not just because they felt like it
you can't use many features that depend on it with exten "C"
i want kitty
I have kitty
i want cat
you won't believe this
crazy
At least you don't have them, but mine ran away 
gregory
u need to vent
oi lads, back with animations
and today Freddy explains why Gregory will get zero beetches
some sort of a fashion review made by Glamrock Freddy
and Gregory gets ratio, screenshoted, don't care, didn't ask, zero beetches and etc.
Enjoy the video!
make sure to subscribe to my channel and hit a bell button to get the notified about new videos!
...
did you play fnaf security breach
actually that's a bat
is that an alias or does bat drop all the waterworks if output is not a tty
It's an alias
it does drop all the fancy stuff if output isn't a tty too
i don't get it
nah thanks
missing out
if you say so
implementing kvm clock for nyaux even tho im sick lesgo
woah you're writing a kvm?
incredible
oh
for better timer shit
oh that boring π
not really
good luck π
why not use rtc
ew
π’
isnt that slow as balls
it is usable π I have it like taped together to provide timestamps for ext2 things
imagine using the rtc for timing
would be wild ngl
FINALLY
GOT IT WORKING
HOLY SHIT
IM SUCH AN IDIOT SOMETIMES
i lit did (hpet_virt_addr + 0xF0)
but it was a fucking uint64_t*
so its adding 0xF0 * sizeof(uint64_t)
now we have a generic timer thing
cool beans
static inline bool checkkvmvendor() {
uint32_t ecx, edx, ebx, eax;
cpuid(0x40000000, 0, &eax, &ebx, &ecx, &edx);
uint32_t reg[3] = {ebx, edx, ecx};
uint32_t matching[3] = {0x4b4d564b, 0x4d, 0x564b4d56};
for (int i = 0; i < 3; i++) {
kprintf("comparring 0x%x with 0x%x\r\n", balls[i], matching[i]);
if (reg[i] == matching[i]) {
continue;
}
// else {
// return false;
// }
}
return true;
}
does anyonr know why cpuid is returning garbo data?
comparring 0x0 with 0x4b4d564b
comparring 0xffffffff with 0x4d
comparring 0x80035220 with 0x564b4d56
im running it in kvm obviously
there's problem in your cpuid function implementation
i getting normal values from cpuid
static inline bool cpuid(uint32_t leaf, uint32_t subleaf, uint32_t *eax,
uint32_t *ebx, uint32_t *ecx, uint32_t *edx) {
uint32_t cpuid_max;
asm volatile("cpuid"
: "=a"(cpuid_max)
: "a"(leaf & 0x80000000)
: "rbx", "rcx", "rdx");
if (leaf > cpuid_max) {
return false;
}
asm volatile("cpuid"
: "=a"(*eax), "=b"(*ebx), "=c"(*ecx), "=d"(*edx)
: "a"(leaf), "c"(subleaf));
return true;
}
this is what it looks like
try this
inline void __cpuid(int code, int code2, uint32_t *a, uint32_t *b, uint32_t *c , uint32_t *d) {
__asm__ volatile("cpuid":"=a"(*a),"=b"(*b),"=c"(*c),"=d"(*d):"a"(code),"c"(code2));
}
wait
why you printing balls[i]
when you need to print reg[i]
i changed it to be
more um
less stupid varialbe name
its not actually that in the code
it works???
weirdly
lol
thanks
this function wont work with the 0x40000000 leaves
it only works with with the regular leaves
this will unconditionally fail for 0x4xxxxxxx leaves because it checks for existence using the maximum for 0x0xxxxxxx leaves
and because you don't check for failure the code goes ahead with the garbage that was in the uninitialized locals
cant you just use the __get_cpuid from cpuid.h?
that has the same issue
what are those
when nyaux hyfetch port 
hypervisor defined leaves or smth
kvm and stuff?
because I have very similar code and it seems to work
I think (about the similarity) (because it definitely works)
i believe kvm, hyperv and others use that for identification and hypervisor specific stuff
and his code work wont because he calls cpuid with eax=0x4000β0000&0x8000β0000
i actually dont know what that returns exactly
ah
I just do 0x8000etc for max leaf check
real sigmas don't do checks and blame userspace for all errors
even before userspace?
yes 
hi i woke uo
makes sense
working on pvclock for nyaux
which is just kvmclock v2
lol
whats crazy is that pmm init isnt taking forever suddenly
nyaux boots in like 3 seconds??? from kernel to userspace????
wtf????????????
idk what i did but
nice
im still sick
so
yea
:c
with kvm or not
kvm
what is your cpu
thats stupid whoops
epic
uacpi: time source backwards drift detected, this may cause problems?????
oh wait im opid
okay somethings wrong
my code
pvclock::pvclock() {
// as pvclock is a x86_64 only feature we can assume shit here so its fine :3
// verify we actually HAVE tsc
uint32_t eax, edx, ebx, ecx;
cpuid(1, 0, &eax, &ebx, &ecx, &edx);
if (!(edx & (1 << 4))) {
panic("okay so no tsc = die");
}
// pvclock is per cpu :c
struct per_cpu_data *vcpu = arch_get_per_cpu_data();
// listen, kvm wants a full page. because of the way it handles it. so heres
// what we do, directly call pmm alloc
uint64_t addr_of_page = (uint64_t)pmm_alloc();
memset((void *)(addr_of_page), 0, 4096);
vcpu->arch_data.pvclock = (struct pvclock_vcpu_time_info *)(addr_of_page);
wrmsr(0x4b564d01,
((addr_of_page - (uint64_t)hhdm_request.response->offset) | 1));
kprintf_log(TRACE, "pvclock has now inited lol\r\n");
kprintf_log(TRACE, "pvclock version %u\r\n",
vcpu->arch_data.pvclock->version);
}
size_t pvclock::get_ns() {
struct per_cpu_data *vcpu = arch_get_per_cpu_data();
struct pvclock_vcpu_time_info *info = vcpu->arch_data.pvclock;
size_t time = rdtsc() - info->tsc_timestamp;
if (info->tsc_shift >= 0) {
time = time << info->tsc_shift;
} else {
time = time >> -info->tsc_shift;
}
time = (time * info->tsc_to_system_mul) >> 32;
time = time + info->system_time;
return time;
}
size_t pvclock::get_us() { return get_ns() / 1000; }
int pvclock::stall_poll_ms(size_t ms) {
size_t nanosecondsrnlol = get_ns();
kprintf_log(TRACE, "nanoseconds lol %lu\r\n", nanosecondsrnlol);
return -1;
}
looks good to me, the only thing i can think of is that the info is getting updated in the middle of a read and because you don't check version you're using stale values
reading the values and the rdtsc is all supposed to be done in a seqlock on version
this is what i do
if you don't use atomics things can get reordered out of the seqlock
or theoretically the new_version load can get reordered before the version load
like the docs don't describe it as such but this is essentially a lock and you have to treat it like one
like in the compiled machine code, the compiler might reorder the loads
is that what u mean?
or the processor itself but yes
makes sense
(and also without atomics the compiler will assume the check is always true as nothing in between writes to version)
cooked
(and without atomics the compiler is allowed to use split loads, i.e. load part of the value in one instruction and another part in another)
i use __attribute__((packed, aligned(8))) for my kvmclock_info_t
makes sense
that works
lets see if this works now
still not working

size_t pvclock::get_ns() {
struct per_cpu_data *vcpu = arch_get_per_cpu_data();
struct pvclock_vcpu_time_info *info = vcpu->arch_data.pvclock;
uint32_t version = __atomic_load_n(&info->version, __ATOMIC_ACQUIRE);
uint64_t tsc_value, tsc_timestamp, system_time;
uint32_t tsc_to_system_mul;
int8_t shift;
for (;;) {
if ((version & 1) == 0) {
tsc_timestamp = info->tsc_timestamp;
system_time = info->system_time;
tsc_to_system_mul = info->tsc_to_system_mul;
shift = info->tsc_shift;
tsc_value = rdtsc();
}
uint32_t new_version = __atomic_load_n(&info->version, __ATOMIC_ACQUIRE);
if (((version & 1) == 0) && new_version == version) {
break;
}
version = new_version;
}
size_t time = tsc_value - tsc_timestamp;
if (shift >= 0) {
time = time << shift;
} else {
time = time >> -shift;
}
time = (time * tsc_to_system_mul) >> 32;
time = time + system_time;
return time;
}
all i changed
what does your rdtsc() look like?
static inline size_t rdtsc() {
uint32_t low = 0;
uint32_t hi = 0;
__asm__ volatile("rdtsc" : "=a"(hi), "=d"(low));
__asm__ volatile("lfence"); // wait until rdtsc completed
// explained by sdm go read the manual lol
return (size_t)((uint64_t)hi << 32);
}
wait
LMAO???
π
HOLY
THE SPEED INCREASE IS CRAZY
THATS
1MILLION RIGHT?
yea 1.1 m ops
@kind root
1.3m ops now
its consisently getting 1.3-1.4m ops
lesgooo
anyways cool kvmclock is implemented
kvmclock
and where you used it
is its your cpu max in kvm
can i try your iso
k hold on lemme build it for u
k
is uploading
git are u fucking braindead
it was too big to upload here
make sure u run with -M q35
and -m 512M at least
lol I see limewire has rebranded
the initramfs needs some memory to be loaded in
yea
guessing ur cpu is slower
ryzen 5 3600 
oh yeah input is via serial
old af
yeah
even my intel laptop cpu can beat it
π
yogurt
gurt: yo
git status
On branch master
Your branch is up to date with 'origin/master'.
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: .clang-format
modified: kernel/src/acpi/acpi.c
modified: kernel/src/acpi/kernelapi.c
modified: kernel/src/arch/arch.c
modified: kernel/src/arch/arch.h
modified: kernel/src/arch/x86_64/cpu/lapic.c
modified: kernel/src/arch/x86_64/cpu/structures.h
modified: kernel/src/arch/x86_64/instructions/instructions.h
modified: kernel/src/term/term.c
modified: kernel/src/term/term.h
modified: kernel/src/timers/hpet.cpp
modified: kernel/src/timers/hpet.hpp
new file: kernel/src/timers/pvclock.cpp
new file: kernel/src/timers/pvclock.hpp
modified: kernel/src/timers/timer.cpp
modified: kernel/src/timers/timer.hpp
modified: kernel/src/utils/basic.h
β― git push
Enter passphrase for key '/home/anon/.ssh/id_rsa':
Everything up-to-date
blud
ok works now


time easily overflows without it being uint128
uint64_t is big enough to store the amount of nanoseconds it takes for the heat death of the universe
uint64 is not big enough for calculation
(sometimes)
managarm be like:
(I've encountered the issue before)
:P
of course the final result can fit in u64
yeah on my system one of the intermediate values (specifically the result of time_after_shift * mul) overflows a u64 within a few seconds
so i do that calculation using u128 arithmetic
lol, your ops went down too XD
593 π
@surreal path you should probably be pinged about this
bro its not the same cpu
oh wait
that image
lol
that is fair
fair?
meaning yes i should
when nyaux can use white as default text color
gray is ugly
white is for bold text
in macos the normal text for logs is white and it looks nice
I am sick too 


why all my minecraft hardcore targets is sick
I really dislike the size_t get_ns();. Why no nsecs_t (which can just be typedefed to unsigned long long or uint64_t)?
size_t is funny
plus i dont plan to support 64 bit
and size_t just seems nice
it just feels right
you sure?
at least make it a uint64_t


just make it uint64_t
also
amazing commit message
yes ive comfirmed it
files have uint64_t offset
or well
file descriptor
handles
yk what i mean
you ci fail reminds me that I also need to fix my ci fail lol
fix mine for me 

i have shitty ci
that only builds the kernel
thats it
no sysroot
im too lazy to get jinx working
probably for the best
and i do not wanna bother mint to get it working lol
you'll just waste free minutes
if it builds for my machine it should build for you 
workflows aren't unlimited
same
real
what you will do
were not you already working on fbdev
it's just a struct
ik
did you implemented fd mmap
afaik prog need it to map framebuffer
Lmfao
best i can do is three fiddy
i can buy nyaux license for 1$ !!!
how is nyaux nyaxuing
Honestly get disk drivers itll make testing so much faster
sure
transes your gender
There you go!
bro made me into czzpek
I have no idea what "czzpek" is π
@thorn bramble
π
chopped cooked boiled
when nyaux intel hda support
when nvidia modeset support
nyaux need a drm support cuz it need to be cooler than windows
what
stroke?
nyaux needs a job
thats crazy
Tty jobs
stop scaring people like thatπ
okay so
why does bash die
when launching doomgeneric
ive implemented fbdev
do u guys know whats going on with that??
like the bash process doesnt die
but it doesnt show a prompt nor accept input anymore
ill dbg this tmrw i feel sick in my stomach rn
Where are you storing the executable?
in /usr/bin????
im triyng to
right so doomgeneric spawns another thread of itself
it does stuff
kills that thread
kills itself
but bash still runs
now how it somehow made bash stop working is crazy
no it did not kill serial put input
yea i have no idea whats going on 
atexit is not calling the function cleanup somehow
thats the issue

anyways back to eeping
restore your ioctl state when doom exiting
no its atexit
its not working
weirdly
then why bash is dont want input ?
because doom doesnt retore the original tty state
meaning the tty is probs in non interactive mode or some shit
whatver doom configured it to
maybe restore state in syscall exit ?
i do ofc?
thats not the issue here
the issue is that atexit doesnt call the callback function
now i dont know how that works in the internals of mlibc but im sure that is related to a missing sysdep or some kind of bug in my kernel
does atexit work for orange @ebon needle u can test this by writing a small program that uses it
how
you can just make a recipe for ur own program
that gets compiled then installed into ur sysroot
see ttytest recipe in nyaux
i mean what code i should use for atexit
codeberg moment
i cant compile my os because codeberg is died
@surreal path it doesnt works too π
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <termios.h>
struct termios orig_termios;
void disableRawMode() {
printf("got atexit\n");
tcsetattr(STDIN_FILENO,TCSAFLUSH,&orig_termios);
}
void enableRawMode() {
tcgetattr(STDIN_FILENO, &orig_termios);
atexit(disableRawMode);
struct termios raw = orig_termios;
raw.c_lflag &= ~(ICANON);
raw.c_cc[VMIN] = 1;
tcsetattr(STDIN_FILENO,TCSAFLUSH,&raw);
}
int main() {
enableRawMode();
printf("enter any key to continue\n");
char key;
read(STDIN_FILENO,&key,1);
}
weird hm?
yea so this may be a think that mlibc wants
like some sysdep
or something
now i couldnt verify this but maybe someone more knowledgable in mlibc internals could
im also gonna verify that doomgeneric actually REACHES exit
atexit is not a sysdep
it should in fact already work
so if it doesn't go figure out why
__mlibc_do_finalize is implemented in options/lsb/generic/dso_exit.cpp and it's called from exit in options/ansi/generic/stdlib.cpp
the code is really simple and, as i said, it should just work as is
yea weird
i think its not actually reaching exit
it may be stuck somewhere
π
weird issue hm
chex.wad
i wonder if doom-generic actually has support for chex quest
since iirc it has custom things
have u ever made a program that is open source
random question
i might just throw it in nyaux
for shits and giggles
i mean its generic
they probably assume exit doesnt exist
well one util i've written is https://github.com/qookei/dir-diff
ill write a recipe for it
the pixels doomgeneric are sending in are RGBA
this is hard coded
for some fucking reason
and i have no idea how to convert the pixels on the fly in a reasonably and non slow way
doomgeneric should respect the format i tell it but no
like genuinely why even print the framebuffer shit when its all fucking hard coded
even the bpp is hard coded
β οΈ
also i dont know why it didnt choose the top of the screen but
idfk
i may need help with this cause i do not know how to do this reasonably so anyone who has ported doomgeneric please tell me what i should do that wouldnt be a shit and slow as balls solution
you can also port qookie's mini-lspci but that requires sysfs ;D
where is it hard coded?
ah in I_InitGraphics
honestly i'd just patch it to not hard code it
doesnt matter if i change the values to match what nyaux would use
doomgeneric just
doesnt care
π
then i don't think that's the issue
i dont think theres much of an issue with the implementation of nyaux's fbdev either, because ive checked the values it gives to userspace and they do look sane
what are those values?
that does look sane yeah but it also matches what doom's printing
and besides the pattern isn't really what i would expect from those parameters being wrong
yea
for more context this is what my write and read functions for fbdev look like
size_t read(thefunny) override {
size_t end = epicfb->pitch * epicfb->height;
if (offset >= end) {
*res = EINVAL;
return -1;
}
if (size + offset > end) {
size = end - offset;
}
void *calculated_dest = reinterpret_cast<void *>(
reinterpret_cast<uint64_t>(buffer) + static_cast<uint64_t>(offset));
memcpy(
reinterpret_cast<void *>(reinterpret_cast<uint64_t>(calculated_dest) +
reinterpret_cast<uint64_t>(offset)),
epicfb->address, size);
*res = 0;
return size;
}
size_t write(thefunny) override {
size_t end = epicfb->pitch * epicfb->height;
if (offset >= end) {
*res = EINVAL;
return -1;
}
if (size + offset > end) {
size = end - offset;
}
void *calculated_dest = reinterpret_cast<void *>(
reinterpret_cast<uint64_t>(buffer) + static_cast<uint64_t>(offset));
memcpy(
reinterpret_cast<void *>((static_cast<char*>(epicfb->address)) +
static_cast<uint64_t>(offset)),
calculated_dest, size);
*res = 0;
return size;
}
int ioctl(void *data, unsigned long request, void *arg,
void *result) override {
switch (request) {
case FBIOGET_VSCREENINFO: {
*static_cast<fb_var_screeninfo*>(arg) = variablefbinfo;
*(void**)result = 0;
return 0;
break;
}
case FBIOGET_FSCREENINFO: {
*static_cast<fb_fix_screeninfo*>(arg) = fixedfbinfo;
*(void**)result = 0;
return 0;
break;
}
default:
kprintf_log(ERROR, "fbdev(): unknown ioctl\r\n");
break;
}
return ENOSYS;
}
thefunny is a marco
just this
ah you're doing it with read/write not mmap
that makes things simpler
(also imo read shouldn't be allowed on fbs but that's unrelated)
why not?
astral allows it
WC memory is not architecturally guaranteed to be coherent
aka on some cpus this assertion would trip even without any race conditions ```c
*fb = 0xabcdef;
assert(*fb == 0xabcdef);
i see
this is because wc was originally as implemented as uc with the buffering being completely separate from the regular cache layer
so you could get a read to go through to the actual framebuffer memory before the buffered writes are committed
yea makes sense
why are you adding offset to the input buffer? it's only the destination position, not the source position
in read?
in both
memcpy for nyaux is dest, src
you're doing memcpy(fb->address + offset, buffer + offset, size)
also good point
it should be memcpy(fb->address + offset, buffer, size)
Idk I didn't have that problem
considering thats the entry point that rip looks like garbage @brisk zenith
either that or its in the libc
it is probs in the libc somewhere
looks like /lib/libm.so
What'd you change
lucky ig
what instruction is at that address?
It's not luck I'm just pretty sure it can detect the framebuffer format
i am checking hold on
no not really
its hard coded lol
i checked, it can't
it's hard coded in I_InitGraphics
Huh
it just matches the format limine uses on qemu and most hardware
Yeah that's what I figured
yes
tf?
it's a dummy
the functions libm needs to provide are provided by libc
right
libm still needs to exist though so it's just an empty shared lib
It never was real, it's just a bunch of numbers on your computer!
what?
im looking for the instruction it faulted?
do you know what a relocation is
well i know it exists
i don't really trust that rip value
Doubt that's what faulted
yea
yes i know this
that is why i subtracted the rip on the address mlibc loaded "libm" at
^
but the symbol is in libc
libm is empty
right ill check where it loaded libc
looks better
looks better
interesting
0000000000043dc0 <_ZN5mlibc11strncasecmpEPKcS1_m>:
seems to be in strcasecmp
i can try and get the parameters it loads
just look at the source code
for strncasecmp?
good point
yea
interesting? printing cook in R_CheckTextureNumForName doesnt cause it to gpf ???????
it just gets stuck here
tf is happening

i removed it
and its still stuck??
nvm i know why
fixed that
printing in R_InitSpriteDefs in doomgeneric doesnt cause the general protection fault but it does the same thing getting stuck with init status bar

printing anything at all in R_InitSpriteDefs just gets it stuck
i pushed everything to github if anyone wants to also take a look
dunno why its commiting .cache even tho i have that in my gitignore but k


i was copying shit to the buffer + offset in write from buffer + offset
π
that was the issue lol
does keyboard work too?
how do you type commands then
serial input
well you could just use that
no ps2?
Make a ups2
fuck
weirdly this happened
i cannot seem to get it to be reproducable
@brisk zenith could this be related to why one of ur machines couldnt boot nyaux?
no idea
it seems to be faulting with a kernel code address?
that is quite weird
also ive noticed that when launching doom it doesnt really look like its being animated?
i cannot verify this as no input
also the rip is a heckin
address that isnt code??????
no it is
nvm
and cr2 is memory
nvm
weird it died checking the us variable ?
that looks like a valid address tho?? how did this happen???? did the thread somehow unmap its process structure wtf
