#Nyaux

1 messages · Page 31 of 1

surreal path
#

which line pitust what do i change to what

#

2663?

#

what do i change

edgy pilot
haughty kite
#

idk im not the expert

haughty kite
surreal path
#

maybe mint has an updated cc-runtime.c

#

let me check

edgy pilot
surreal path
#

oh nvm

haughty kite
#

stack exhaustion

kind root
#

just tail call optimize it

haughty kite
#

its mutual recursion

edgy pilot
#

what do those functions do

surreal path
#

I RAN IT

#

BRO

haughty kite
edgy pilot
#

yeah I gathered that
but what kind

#

is it even needed

haughty kite
#

64 bit signed mutliply

#

wtf

kind root
#

wtf

edgy pilot
#

where do you use that

#

@surreal path

haughty kite
#

oh wait nvm

#

its my bug

#

ok sorry

#

its still kinda broken

#

but its not that bad

#

ooops

surreal path
haughty kite
#

i added -ftrapv

#

because getting more checks is good

surreal path
#

oh

haughty kite
#

and it caused failures

#

ugh sorry

surreal path
#

i nuked my cc-runtime

haughty kite
#

still an LLVM bug tho

surreal path
#

💀

surreal path
edgy pilot
surreal path
#

dealing with mints shitty makefile

#

or well

#

my shitty makefile

haughty kite
#

hmm maybe its not?

#

eh it probably is

#

actually no nvm it isnt

#

its finee

surreal path
#

huh

surreal path
#

yeaaaa

#

im gonna need that cc runtime

haughty kite
#

yeah

surreal path
#

and what is the bug exactly u keep going back and fourth

#

😭

edgy pilot
#

maybe you free an incorrect thing, allocate it again and overwrite some data

haughty kite
#

ok so i dont want to say anythig but im finding it really hard to blame nyaux here

#

@kind root this doesn't seem like correct decomp for item_array_clear

#

(this matches disassembly)

#

at -O0 btw

#

ah hmm wait

#

okay nevermind this is probably not a uacpi bug

edgy pilot
haughty kite
#

"hint" fucking what

molten grotto
#

it should still be the exact size

#

otherwise its useless

edgy pilot
#

another joke

kind root
#

yeah idk why its no initialized

#

it is in code

haughty kite
#

can you mangle symbols so that this can't happen?

surreal path
#

how

haughty kite
edgy pilot
#

gcc -> g++ meme

kind root
#

should probably

haughty kite
haughty kite
kind root
#

he had this bug before too

#

he just never learns

surreal path
edgy pilot
#

every file

surreal path
#

so

#

every file

edgy pilot
#

add -DUACPI_SIZED_FREES to cflags

surreal path
#

oh

#

kill urself gcc

#

IT DOES EXIST

#

ITS IN THE HEADER FILE

haughty kite
#

that fix makes it get to this

surreal path
#

RAHHH

kind root
#

nyaux cmon we went over this

surreal path
haughty kite
#

probably because of some shit i added to make it more likely to catch issues :^)

edgy pilot
edgy pilot
#

lmao

elder shoal
#

476 ms faster than astral

surreal path
haughty kite
edgy pilot
surreal path
haughty kite
surreal path
#

uhhh i did

elder shoal
surreal path
#

i extern from main.c

edgy pilot
surreal path
#

yes

elder shoal
#

send all of elf.h

surreal path
#
#include <limine.h>
#include <stdint.h>
#define EI_NIDENT 16
#define Elf64_Addr uint64_t
#define Elf64_Off uint64_t
#define Elf64_Half uint16_t
#define Elf64_Word uint32_t
#define Elf64_Sword int
#define Elf64_Xword uint64_t
#define Elf64_Sxword signed long int
typedef struct {
  unsigned char e_ident[EI_NIDENT];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
typedef struct {
  Elf64_Word sh_name;       /* Section name */
  Elf64_Word sh_type;       /* Section type */
  Elf64_Xword sh_flags;     /* Section attributes */
  Elf64_Addr sh_addr;       /* Virtual address in memory */
  Elf64_Off sh_offset;      /* Offset in file */
  Elf64_Xword sh_size;      /* Size of section */
  Elf64_Word sh_link;       /* Link to other section */
  Elf64_Word sh_info;       /* Miscellaneous information */
  Elf64_Xword sh_addralign; /* Address alignment boundary */
  Elf64_Xword sh_entsize;   /* Size of entries, if section has table */
} Elf64_Shdr;
typedef struct {
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Half st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;
typedef struct {
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
typedef struct {
  Elf64_Sxword d_tag;
  union {
    Elf64_Xword d_val;
    Elf64_Addr d_ptr;
  } d_un;
} Elf64_Dyn;
extern volatile struct limine_kernel_file_request kernelfile;
Elf64_Ehdr *get_kernel_elfheader();
uint64_t get_kerneL_address();
edgy pilot
#

a link would be better tbh

surreal path
#

fair

elder shoal
#
#if LIMINE_API_REVISION >= 2
struct limine_executable_file_request {
#else
struct limine_kernel_file_request {
#endif
    uint64_t id[4];
    uint64_t revision;
#if LIMINE_API_REVISION >= 2
    LIMINE_PTR(struct limine_executable_file_response *) response;
#else
    LIMINE_PTR(struct limine_kernel_file_response *) response;
#endif
surreal path
elder shoal
#

what revision did yo set

surreal path
#

2

elder shoal
#

stare at this code until you figure it out

surreal path
#

yea they changed it

#

fun

haughty kite
#

you fucking opted into it

surreal path
#

fair

#

no fucking way

#

mint removed the smp request

#

why mintsuki oh why

haughty kite
#

its called an mp request now lol

surreal path
#

oh

#

my faith in limine has been restorted

#

mint pplease no ban

#

🙏

elder shoal
#

real smp is when all cores boot up at the same time and theres no concept of a bsp troll

surreal path
#

@haughty kite did u pr ur checks yet

#

runs nicely btw

#

can u do that pitust

#

or at least

#

send the code over

#

i still am getting 131 ops

#

and like 12 seconds uacpi init

#

i need that speed increase lol

#

pleaseeee

edgy pilot
#

slower

#

how

surreal path
#

132*

edgy pilot
#

instant speed boost

surreal path
#

thats arch specific

#

also

#

he got instant 476ms

#

i need that

molten grotto
#

you can have arch specific memcpy/memset and then a generic fallback with attribute weak

edgy pilot
haughty kite
#

0 changes and it still runs in 56

#

oh also, -smp 2

edgy pilot
molten grotto
haughty kite
surreal path
#

now js memset

#

rep stosd or wtv

molten grotto
#

yes

surreal path
#

yo i suck at writing inline asm

#

and i cannot get rep stosq to work

molten grotto
#

you should use rep stosb

#

not q

surreal path
#

why?

molten grotto
#

because not all memcpys have 8 byte aligned sizes? and also rep movsb/stosb are the only optimized ones iirc

surreal path
#

okay

#

changed it to stosb

#

perfomance still ass

#

kill mee

#

its fine tho

molten grotto
#

I can't understand how can it be 131/s

#

its like 6k x slower than my kernel for an example

surreal path
#

i forgot to adda return for both functions

#

now its 154

#

wowie!!!

surreal path
molten grotto
#

unless its your timer somehow but if it also takes a visibly long time then its probably something else

surreal path
#

its also visibly a long time

#

so not my timer

#

i just enabled kfree

#

@kind root @haughty kite

#

wtf

#

1137 ops per second

#

LETSS FUCKING GOOO

kind root
surreal path
#

where is nyaux on the letherboards

kind root
#

do u want to be on the scoreboard

surreal path
#

yes

#

yessss

kind root
#

sure

surreal path
#

put me onnnn

elder shoal
#

can someone with an 12th gen i9 run astral so the number can be high halfmemeright

orchid dawn
#

I can run it on an i3-12100f, should be close enough meme

molten grotto
#

I only have 13 gen i5

cinder plinth
#

you're not ready I will be on top of the leaderboard soon

molten grotto
kind root
#

the key is to have bad timekeeping

cinder plinth
#

I could probably fork uacpi too

#

to make it faster

#

to tailor it to my kernel

surreal path
#

these guys are funny

molten grotto
surreal path
#

aw hell nah

#

@kind root u taking that disrespect?

cinder plinth
kind root
#

but uacpi is pretty well tested at this point too

flat nymph
#

I have Ryzen 9 5900X

unkempt relic
#

Maintainer got convicted of criminal damage

#

In all seriousness though although I favour using community projects anyway

#

My choice to use uacpi would have been the same regardless

#

Acpica is a body barely living outwith the foetid confines of the Linux kernel and maintained by 1 or fewer people

tawdry mirage
#

speaking of acpica, it's kinda funny how managarm used acpica, lai, and uacpi at various points in time

finite summit
#

average nyaux experience

#

@surreal path

surreal path
#

say hi to nyaux mascot

#

(real)

#

this is a joke obviously

#

but rate my art

#

0-10

elder shoal
#

Furry

orchid dawn
surreal path
#

😡

orchid dawn
worldly condor
surreal path
steady flume
frigid cliff
surreal path
#

TODO list for today:

abstract smp away to architecture specific code
abstract pagemap and mapping functions to architecture specific code

#

if we have more time

#

scheduler

flat nymph
#

What is there to abstract in SMP?

surreal path
#

well

#

wait

#

no because limine abstracts it for me

#

huh

#

yea i solved this

flat nymph
#

At most you'll have different implimentations for IPIs

#

Hmm the initialization...

surreal path
#

its just the vmm then that needs to be abstracted

#

yea this is pretty much how i abstract everything

#

i think its a good way to be honest

#

so what im gonna do for abstracting away page table things to archiecture yk

#

im gonna have something like

typedef struct {
  uint64_t *root; // on arm this could just be a pointer to the large page table or whatever idfk
} pagemap_t;

void arch_init_pagemap(pagemap_t *take);
void arch_destroy_pagemap(pagemap_t *take);

void arch_map(pagemap_t *take);
void arch_map_hhdm(pagemap_t *take);
void arch_map_framebuffer(pagemap_t *take);
void arch_map_memorymap(pagemap_t *take);
void *arch_map_vmm_region(pagemap_t *take, uint64_t length, uint64_t vmm_region_base); // returns the base of the vmm region
void arch_unmap_vmm_region(pagemap_t *take, uint64_t length, uint64_t vmm_region_base);
#

having these as seperate functions gives me more control on the archiecture specific code itself

surreal path
kind root
#

no

surreal path
#

why

kind root
#

too high level

flat nymph
#

why arch map_hhdm

kind root
#

u need arch_map_page(where, what)

#

thats it

flat nymph
#

just have arch_map which takes a bunch of options (?)

surreal path
#

some archiectures might not have pages in 4096 bytes

flat nymph
#

It doesn't matter

kind root
#

and

surreal path
#

some archiectures might not support recursion

hexed mango
surreal path
flat nymph
#

by recursion

#

recursive mapping?

surreal path
#

yea

flat nymph
#

it's obnoxious anyway

surreal path
#

look i know its high level

#

but again

flat nymph
#

some architectures have inverted page tables

surreal path
#

yea

#

exactly

#

so thats why

#

im making it this high level

#

i dont wanna make any assumpations

flat nymph
#

What I had to implement when porting to riscv was map, unmap and unmap range

#

(and I've also made my unmap functions take context for tlb shootdowns, but that's an implementation detail i'd suppose)

#

also some architectured don't even have page tables

#

as in a page table in form of a radix tree

surreal path
#

exactlyy

#

so

#

thats what im gonna do

#

to save some time

finite summit
#

The only APIs I remember using often in the VMA are:
Map (which is more like modify PTE at this point)
Unmap
Query page info

surreal path
#

later

#

when i port other archiectures

finite summit
finite summit
#

Set the page to non present

flat nymph
finite summit
surreal path
#

anyways im gonna impl my high level abstraction shit

finite summit
#

Mainly so I could keep the PTE flags, but unmap the page itself

finite summit
#

That's just reusing code in many places

surreal path
#

look at my responses above

finite summit
#

For no reason

flat nymph
finite summit
#

As a parameter

surreal path
#

good point

#

but

#

it can be converted

#

to the archiectures equivment

finite summit
#

It should at least be in bytes

surreal path
#

fuck i cannot spell

flat nymph
#

forget about it

finite summit
#

Aka 4kib

surreal path
#

arch_map

#

wait

#

good point

flat nymph
#

arm can have 1kib pages

surreal path
#

hold on lemme rethink

finite summit
#

This is a bad way to abstract it

surreal path
#

okay whats ur better way

finite summit
#

Abstract it via map and unmap functions that take a base and physical address

#

Have the arch tell you the page size

#

And work in that manner

surreal path
#

wdym by that

#

what about mapping the framebuffer with wc enabled

finite summit
surreal path
#

what about bigger pages

finite summit
#

Map will take flags

#

Telling it how to map the page

#

E.g., huge page

#

E.g., map as x caching mode

finite summit
#

But someone correct me if I am wrong

surreal path
#

what about unmapping

flat nymph
finite summit
flat nymph
finite summit
surreal path
#

i need its physical address returned

finite summit
surreal path
#

what about mapping in a loop

finite summit
#

You can also have a query page info function

finite summit
finite summit
surreal path
#

well what if im mapping per 4096

#

bytes

#

how does that work

finite summit
#

Why?

surreal path
#

this is how i map regiosn currently

flat nymph
#

forget about 4096

#

it's an x86 thing

finite summit
surreal path
flat nymph
#

PAGE_SIZE constant

finite summit
surreal path
#

to what exactly, how will the map function work

#

in relation

#

to that

finite summit
#

Use thing in your head

#

Called brain

surreal path
#

oh use a loopppp

#

oh my god

#

sureee

#

but how about

#

the amount of times u loop over

#

do u loop in bytes?

#

like

finite summit
#

You take in a size

#

Then you can convert that to a count of pages (you have a page size constant from the arch)

#

And loop that many times

surreal path
finite summit
#

Idk where is ur loop

surreal path
#

im kvm_region_deallloc and kvm_region_alloc

finite summit
#

Then that's where you take in a byte size parameter

#

Or have the size of the region

#

In the region

surreal path
#

i already have that

finite summit
#

Then use that

surreal path
#

its in bytes

finite summit
#

And then loop that many times to map/unmap

surreal path
#

is this correct?

#

yes

#

or no

finite summit
#

Like NYAUX_ARCH_PAGE_SIZE

flat nymph
#

I mean you can probably have an arch-specific map_range function for optimization

flat nymph
finite summit
#

I am adding some new features to my VMM so I could experiment with something like that to optimize

flat nymph
#

My kernel does map several pages at once

flat nymph
surreal path
#
#define NYAUX_ARCH_PAGE_SIZE #if __x86_64__ \
                              4096       \
                             #endif      \

#define NYAUX_ARCH_HUGE_PAGE_SIZE #if __x86_64__ \
                                      /*2mib basically*/\
                                  #define         \

surreal path
#

okay

#
typedef enum {
  TINYPAGE = 0,
  SMALLERPAGE = 1,
  SMALLPAGE = 2,
  PAGE = 3,
  HUGEPAGE = 4,
  humongousPAGE = 5,
  GIGTANICPAGE = 6,
  cached = 7,
  notcached = 8,
  
} vmmflags;
#

how about this

finite summit
#

Terrible

surreal path
#

whats better

finite summit
#

Make it a bitmap

surreal path
#

wdym

finite summit
#

Because what if you want a huge page that's non cached

#

Use a bitmap

surreal path
#

explain

finite summit
#

A bitmap

#

Basic programming knowledge

surreal path
#

no i mean how flags are inserted

#

into this bitmap

finite summit
#

Which I don't plan on explaining

finite summit
surreal path
#

what represents what

#

how does that work

#

@finite summit

finite summit
surreal path
#

i know what bitmaps are

#

thats not what i meant

#

i mean

finite summit
#

Then it's easy

surreal path
#

what bit represents what in a bitmap

finite summit
#

You define that

surreal path
#

how big of a bitmap does it need to be

#

oh

#

wait

#

yea im starting to understand

#

something like this

surreal path
#

like i dont understand how that would work on other archectiures

#

like say

#

i did in a bitmap

#

big page, cached

#

but its not a framebuffer

#

what does that mean

#

like

#

hold on

#

okay

#

sorry my question is

#

what if u want different types of caching thats archiecture spefic yk

#

how does that work

finite summit
#

That arch specific functions can use

#

Rn I'm walking back home from school

edgy pilot
#

that are translated to arch specific actions

surreal path
#

dont understand

#

im sorry im just really slow

#

😭

#

and stupid too

edgy pilot
surreal path
#

finally some code i can read

edgy pilot
#

map(..., flags, page_size, caching)

#

map then translates flags, psize and cache to arch thingies and does stuff

surreal path
#

what if archiectures dont have write_combining

kind root
#

-EINVAL -ENOTSUP

edgy pilot
#

use the default one

surreal path
#

okay

edgy pilot
#

or throw an error idk

#

however you want to handle it

surreal path
#

wait can u have a default enum in c

#

or no

edgy pilot
#

wdym default enum

surreal path
#

like normal = write_back

edgy pilot
#

normal is a name

kind root
#

lol

#

its just name = value

surreal path
#

ohhh okayyy

edgy pilot
#

nyaux writing a poem

#

:p

surreal path
#
enum caching {
  uncacheable,
  write_through,
  write_combining,
  write_back,
  
  normal = write_back,
  mmio = uncacheable,
  framebuffer = write_combining
};

// flags is a unsigned byte
 // read | write | exec | user 
// uint8_t flags;
finite summit
#

Maybe add some namespace to that?

surreal path
#

how so

edgy pilot
finite summit
#

E.g., write_back becomes caching_write_back

edgy pilot
#

yeah there's no enum class in c

molten grotto
tawdry mirage
#

if we're bike shedding this enum then maybe have separate caching modes for posted mmio and non-posted mmio

surreal path
#

kill meeee

kind root
#

mmio_strong

surreal path
edgy pilot
#

I have never heard of that term

tawdry mirage
#

non-posted mmio waits for writes to complete, posted mmio doesn't

surreal path
#

im js make everything high level this is basically too much work and i really wanna js write the scheduler already so

#

flame me all you want its my kernel

edgy pilot
#

it's an osdev group project

tawdry mirage
#

and iirc at least on apple silicon for some mmio you have to use a specific type (iirc map pcie mmio as posted?) or you'll get an asynchronous abort when accessing it

edgy pilot
#

I don't have much done with the aarch64 side of the kernel yet

#

basically nothing, but I will keep that in mind when I get around to it

tawdry mirage
#

on aarch64 no

kind root
#

ah ok

tawdry mirage
#

normal memory uncached permits write coalescing and reordering

kind root
#

then yeah

#

u should have caching_mmio and caching_mmio_strong

surreal path
#

FINALLY

#

AFTER LIKE

#

WHAT

#

AN HOUR

#

I GOT IT WORKING CHAT

#

MY ABSTRACTION WORKS

orchid dawn
#

🔥

kind root
#

LFG

surreal path
#

i ran nyaux on real hardware

#

...

#

bad results...

kind root
#

F

surreal path
#

why is it stuck

#

maybe it failed switching to the page map

#

why???

#

why didnt it triple fault

#

bro

#

hold on more printf debugging fun

#

lets try this again

#

like

#

yea its 0x9000

#

whats the issue

#

it got as far as Giving address 0x9000

#

like

#

thats literarly it

#

fucking kill me

#

it just hangs

#

doesnt even triple fault

#

just hangs

#

well it wouldnt triple fault

#

idfk

#

it should work

#

it works on the vm

#

why not on real hardware

finite summit
surreal path
#

yes i have

#

wait

#

lemme not make ker_map fields uninited at the start

#

solved absolutely nothing

#

kill me chat

#

how tf am i supposed to debug this now

#

i cant gdb real hardware

#

it just hangs trying to switch to the pagemap

#

i genuinely dont know what to do

molten grotto
#

is it in git

surreal path
#

yes

molten grotto
#

missing gitmodules as usual

surreal path
molten grotto
#

oh wait its not missing

surreal path
#

yea

molten grotto
#

its just missing the cc runtime

surreal path
#

i even tried randomizing

#

the memory in qemu with /dev/random

#

worked fine

#

@molten grotto if u need any help compiling or have questions just ping me

molten grotto
#

well can you commit the updated gitmodules file

surreal path
#

yea hold on

#

they should be commited no?

molten grotto
#

wait is kernel/cc-runtime a symlink to something

surreal path
#

go into kernel

#

and run ./get-deps

#

@molten grotto

molten grotto
#

ah now it works

surreal path
#

yea

molten grotto
#

yeah idk, if you haven't figured it out by tomorrow I might take a look again as I am going to go sleep now

surreal path
#

didnt find anything

#

went over the paging code itself

#

didnt find anything obvious

#

looks fine

surreal path
#

no progress

#

man i hate debugging real hardware

molten grotto
#

maybe it could also be some kind of framebuffer issue

surreal path
#

not really

#

framebuffer runs fine

#

under qemu and kvm

#

and it runs fine up to switching the page tables

#

korona said theres a possiblity that the page tables could be wrong

#

not to a point that kvm cares

#

but to a point real hardware cares

#

ive been looking up and down the paging code i havent found anything suspicous

#

and i certinally cannot attach serial to test if its a framebuffer issue

#

i dont have a serial port on my laptop lmao

molten grotto
#

make a quick rtl driver + ethernet + ip if it has an rtl card troll

surreal path
#

lmao

molten grotto
#

anyway Ill take a look now if I can find anything

surreal path
#

oki

#

thanks qwinci

molten grotto
#

I found at least two things (of which the first one is likely unrelated), both your memcpy and memset return wrong pointer and in the code where you map the framebuffer you do ```c
uint64_t page_amount =
align_up(entry->length - disalign, 2097152) / 2097152;

surreal path
molten grotto
#

the original dest pointer, both rep movsb and rep stosb modify the pointer you give to them

surreal path
#

i am tho?

#

oh yea ur right

#

ill do smthin like this

molten grotto
#

why do you subtract the disalign from the length

surreal path
#

where should i subtract it then

molten grotto
#

you should add it

surreal path
#

understandable

#

my bad thanks for catching this

#

okay im adding them now to the length

flat nymph
surreal path
molten grotto
#

also constants instead of hardcoded numbers everywhere lol

surreal path
#

ik 😭

molten grotto
#

the code style is also weird

surreal path
#

anyways im gonna try this now on my hardware?

#

will it work?

#

lets see if it works on a vm first

edgy pilot
surreal path
#

runs fine on a vm

#

okay

#

lemme just push the changes so u can pull them qwinci and ill try them on my laptop hold on

#

alr time to flash my usb

edgy pilot
flat nymph
edgy pilot
#

no more need for isos

molten grotto
#

or if you have two pcs/laptops then pxe

surreal path
#

i only have one

flat nymph
#

and it's garbage on real hw

edgy pilot
surreal path
#

okay chat moment of truth

#

lemme js reboot

edgy pilot
#

JavaScript reboot

surreal path
#

STILL

#

THE SAME ISSUE

#

oh why x86 gods

#

do u torture me like this

molten grotto
#

maybe Ill try it on my laptop to see if it has the same issue

surreal path
#

alr

surreal path
edgy pilot
surreal path
#

what does that do

edgy pilot
#

it blows your house up

surreal path
#

😱

edgy pilot
#

press it in vscode

surreal path
#

alr

#

hold on

#

wowww a search feature

#

serach and replace

#

😱

edgy pilot
#

incredible discovery

surreal path
#

@edgy pilot done u happy

edgy pilot
#

no

#

use hex

surreal path
#

bro

#

fine

#

ARE U HAPPY NOW

edgy pilot
#

no

kind root
#

no

surreal path
#

why

edgy pilot
#

at least do
#define MIB(x) (0x100000 * (x))

kind root
#
#define KB 1024ull
#define MB (1024ull * KB)
...
surreal path
#

NOW are u happy

edgy pilot
molten grotto
#

yeah it hangs on my laptop too

surreal path
#

at least its repoducable

#

wow i cannot spell

#

reproutdanble/

#

reproduct?

#

product?

molten grotto
#

reproducible

surreal path
#

thanks

#

reproducible

surreal path
#

@molten grotto did u find anything

thorn bramble
edgy pilot
tawdry mirage
#

""_MB 😋

edgy pilot
#

1_mb?

thorn bramble
#
size_t operator ""_KiB(size_t x) {
  return x * 1024;
}

size_t operator ""_MiB(size_t x) {
  return x * 1024_KiB;
}```
#

wow waht di di xo

edgy pilot
#

''"MB

thorn bramble
#

x kib * 1024

#

wait no IM RIGHT

#

my brain isnt braining sry

edgy pilot
thorn bramble
#

what no sleep does to a person

thorn bramble
surreal path
#

@molten grotto anything found yet?

thorn bramble
#

what u lookin for

surreal path
#

stupid real hardware bug

#

hangs on switching to page tables on real hardware but kvm and qemu run just fine

#

read above for more context

thorn bramble
#

yea thats what i did not want to do

#

:)

surreal path
#

fair :)

#

well we

#

looked over the paging code, other then a mistake with memcpy and memset and something wrong with the disalign which we fixed and it has solved nothing

#

still nothing

#

working

#

at least the bug is reproducible

#

thanks for qwinci for teaching me how to spell that word

orchid dawn
#

@surreal path if you don't know if it's actually continuing after switching the pagemap, simply force a hard reset afterwards
if it resets, it works
if it doesn't reset, it doesn't work galaxybrain

edgy pilot
orchid dawn
#

no like

#

in your code

surreal path
#

oh i even put something there

edgy pilot
#

load an invalid idt and divide by zero

surreal path
#

it didnt even care

#

js continues the hang

#

no triple fault

#

no thing

#

js

#

stuck on switching the page tables

orchid dawn
#

did you actually load an invalid idt so that it wouldn't hit your double fault handler

surreal path
#

no idt is valid

orchid dawn
#

then why would it triple fault

surreal path
#

yea lemme try that

#

if it triple faults

#

not a framebuffer issue

orchid dawn
#

no if it triple faults then it is a framebuffer issue

#

that means that your code is still running

surreal path
#

oh

orchid dawn
#

but can't get to the framebuffer

surreal path
#

if it doesnt?

orchid dawn
#

then something else has gone horrifically wrong

surreal path
#

i see

edgy pilot
#

you didn't map your framebuffer

surreal path
#

here we go

#

@orchid dawn can u try the iso

#

i dont want to reboot my pc

#

again

orchid dawn
#

no
I'm at school

surreal path
#

okay fair

edgy pilot
#

or vbox

surreal path
#

or vbox

#

why those

edgy pilot
#

because it's not qemu

#

Duh

surreal path
#

what makes them more accurate to real hardware

#

😭

edgy pilot
#

they are different

#

do it

surreal path
#

i mean

#

ill try

#

on vbox

edgy pilot
#

and vmware

surreal path
#

no im not downloading vmware aswell

#

i haven o space

edgy pilot
#

I'll send a ball stealer goblin to your house otherwise

surreal path
edgy pilot
#

you have 3 minutes

surreal path
#

runs fine on vbox

edgy pilot
#

change the chipset

surreal path
#

okay

edgy pilot
#

if it still works, enable uefi

#

if it still does, shoot it with an ak47

surreal path
#

we got something

edgy pilot
surreal path
edgy pilot
#

debuggers are for the weak

surreal path
#

listen i dont use vbox

#

i dont know how to debug that

edgy pilot
#

you look at your code and find bugs

#

it's that easy

surreal path
#

i already did look at my code

#

many times

#

idfk whats going on

edgy pilot
#

look at it better

surreal path
#

bruy

edgy pilot
#

bnuy

surreal path
#

the hell is a guru mediation

#

wait

#

now its doing it the moment i try to load my kernel?

#

tf?

#

wow

#

now i dont know if its vbox or my kernel

#

wait

kind root
#

its your kernel

surreal path
#

i gave the ram 4mb

#

hold on

#

it was just the ram

#

limine couldnt fit my kernel in the ram at 4mb

#

for some reason

#

well it runs now

#

just fine

surreal path
#

runs fine js needs enough ram

surreal path
#

either way

#

idfk what to do

#

time to test the usb

thorn bramble
#

it does

surreal path
#

if it doesnt throw an error message

#

not my kernel

#

anyone got the astral iso rq

#

found it

#

so it doenst go into the limine bootloader on astral?

#

no menu

#

js straight up says out of memory

#

but when loading my kernel theres a boot menu but THEN it dies?

thorn bramble
#

astral has abckground

surreal path
#

oh fair

#

do u have a kernel i can test

#

just some generic one

thorn bramble
#

build limine-c-template

surreal path
#

okay

thorn bramble
#

any memory allocation failure will result in a panic

surreal path
#

oh i just figured it out

#

it dies trying to init flanterm at 4mb

#

the video memory is 21mb

#

so

#

thats understandable

#

giving it 1mb of video memory

#

kinda works

#

but it seems like i die trying to read my own elf i suppose

#

which is fine again

#

so nyaux is fine

#

so far on vbox

#

js i dont handle oom very well lol

#

anyways

#

im gonna try the usb

#

hold on

edgy pilot
#

that's not very good, especially when programming

surreal path
#

it even worked fine downstairs on my sisters pc?

#

tho uacpi cried cause the aml was weird

#

@kind root do u want to see the errors

#

for uacpi

surreal path
#

i know what its crashing

#

and its my code for not handling oom

#

thats MY fault

#

im still blaming myself

#

in a different way tho

kind root
#

show it

surreal path
#

k

#

@kind root

kind root
#

thats because u dont implement half the stuff it wants

#

so it aborts some stuff

surreal path
#

but again

#

why isnt nyaux working on my laptop??

#

but its working on this pc

#

wtf

kind root
#

add missing kernel api support

#

this is unacceptable

tawdry mirage
#

screenshot of a photo open in an image vieweer

surreal path
#

lol

surreal path
#

boot on my lapto

#

😭

#

i booted again into my laptop

#

same issue

#

but works fine on the desktop

#

yea im fuckin ending it all

#

not only does it work on SOME hardware but not all

#

but its ONLY on my laptop

#

so its not even properly reproduicable

#

fun

#

how tf does that work

#

SOME devices the page tables load fine

#

some devices it hangs

#

HOW

#

does that even work

#

x86 cpus are all the same archiecture

#

like wtf

#

is this even a page table issue

#

what is this

#

i dont know what to do

silver yarrow
#

UB

#

speaking of do u have ubsan enabled

surreal path
#

i couldnt get it working

#

well ksan

edgy pilot
#

totally different things

#

one is way easier

surreal path
#

which is?

edgy pilot
#

which one do you think

#

you couldn't get asan to work

#

ubsan is ezpz

surreal path
#

ubsan?

#

how do i get it working

#

oh yeah

#

idk how much thread messages that is anymore

#

😭

#

30,841

surreal path
#

30 thousand

surreal path
#

and ur pmos

#

no more microkernel

#

vine boom

#

monolithic kernel >

#

anyways how to get ubsan to work chat

#

is there somethign i need to add

#

or

flat nymph
silver yarrow
#

some hooks

#

Feel free to rip this

#

though this is meant for gcc ubsan

#

clang has more hooks iirc

#

then u just add this flag

thorn bramble
flat nymph
#

fun

surreal path
silver yarrow
#

its very easy

surreal path
#

lol???

#

why is it stuck

#

???

#

theres no fault or anything

#

in the qemu logs

#

why is it stuck

#

huh\

silver yarrow
#

cant say for sure

#

how are u outputing from the hooks

surreal path
#

what do u prefer?

silver yarrow
#

eitherway

surreal path
#

alright

#

very similar to what u do

silver yarrow
#

does ur kprintf require setup

surreal path
#

setup

silver yarrow
#

its possible there is ub before its setup

#

id recommend hooking it straight to serial

surreal path
#

kk

surreal path
#

oh my god

#

its mostly complaining about flanterm

#

@silver yarrow how can i make ubsan ignore flanterm

kind root
#

stop giving flanterm misaligned addresses

surreal path
#

when did i give it a misaligned address

#

i gave it the framebuffer addres

#

that shouldnt be misaligned

#

thats literarly what i do @kind root

kind root
#

idk where it gets the addresses from

surreal path
#

from limine

kind root
#

ask mint what u did wrong

#

this aint framebuffer stuff