#OBOS (not vibecoded)
1 messages · Page 8 of 1
this pair should ensure no nonsense then
are you using an intterupt or trapt gate?
trap gate probably
obviously i can't spell tonight
hopefully
trap gates ars broken
I'm 90% sure that my IDT code has been around the same since my 2nd kernel
trap gate is the worse one isnt it
well not worse, but interrupt is usually what you want
then we find out its a call gate
the trap gates leave interrupts enabled, nightmare
yeah i dont know why anyone wants that
maybe for int 0x80 for syscalls or something
the osdev wiki page on the IDT says trap gates should be used for cpu exceptions
I messed up my comment
I said it uses a trap gate, but it actually is an interrupt gate
Do exceptions ignore the DPL field of the IDT entry
as far as i know the DPL is only for interrupts generated with int instruction
well I searched it
i believe this is correct also
Interrupts generated by issuing of the int instruction called soft interrupts. So here, the processor takes DPL field into account only when it handle soft interrupts, a completely ignore them in the case of interrupts generated by processor itself or by external devices.
it wouldnt really make sense to restrict exceptions to kernel mode only
or hardware interrupts for that matter
needlses to say hardware interrupts have to interrupt no matter who's running, but it wouldn't be acceptable to force the kernel to give it a DPL allowing any user app to fake a hardware interrupt
what actually is the issue currently?
it was goofy IRQL being caused by gs_base being cleared by swapgs
right
anyway I believe I fixed that issue
well done
first part of the IRQ dispatcher
works
now I need to test the other part
the part that handles shared IRQs
oops
forgot to send an eoi
[ DEBUG ] Arch_KernelMainBootstrap: Initializing IRQ interface.
[ DEBUG ] Moving IRQ Object 0xffffff0000002460 from vector 0 to vector 1.
[ DEBUG ] Moving IRQ Object 0xffffff0000002460 from vector 1 to vector 2.
[ DEBUG ] Received IRQ 0 (irq object 0xffffff0000001880)!
[ DEBUG ] Received IRQ 1 (irq object 0xffffff0000001cf0)!
[ DEBUG ] Received IRQ 0 (irq object 0xffffff0000002160)!
[ DEBUG ] Received IRQ 2 (irq object 0xffffff0000002460)!```
Everything works as it should
it seems
nothing goofy happened to the IRQL
the IRQ dispatcher works
I'll commit and push this code
then I'll probably add some helpers
then I can make the scheduler preemptive and watch as the kernel goes to shit
Nice
I just pushed a function to free an IRQ object
I think that's it for the IRQ interface
The only other helper functions I can think of for the IRQ interface are some that set some callbacks in the irq object, but that's pretty useless, as one can just do obj->handler = handler;
time for this
Let's see for how long the kernel stays stable
To test this, I've initialized an IRQ object and put the LAPIC timer on it
the handler simply yields and returns
lmao
it triple faults immediately
cr3 gets set to the page map initialized by hyper
and not my kernel's
the scheduler switches to the idle thread
specifically the one on the bsp
which was initialized before the new page table was made
of course cr3 in its context was never modified when the new page table was made
so on switch to the idle thread, since the page containing the old page table was freed (and likely has some new garbage values), the kernel triple faults
I forgot to restore the thread irql on context switch
whoops
except I do
I only restore CR8, but not the value in the cpu_local struct
same thing with gs_base
I get a page fault on execution of nullptr after I set gs_base to the correct value in the idle thread 
It's a bug with my thread context saving code it seems
I fixed it
Now the scheduler is switching from the bsp idle thread to the kernel main thread
and is doing pretty much nothing else
Which is fine for now
I need to actually calibrate the LAPIC timer properly
and get the other CPUs to start a timer
Well I did that
and found out my spin lock is broken
irql Core_SpinlockAcquireExplicit(spinlock* const lock, irql minIrql)
{
if (!lock)
return IRQL_INVALID;
if (minIrql & 0xf0)
return IRQL_INVALID;
const bool expected = false;
irql newIrql = Core_GetIrql() < minIrql ? Core_RaiseIrql(minIrql) : IRQL_INVALID;
while (atomic_compare_exchange_strong(lock, &expected, true))
spinlock_hint();
return newIrql;
}```
the logging functions are locked and yet:
[[[[ DDDDEEEEBBBBUUUUGGGG ]]]] IIIInnnniiiitttitiaiailaliailzlzieeidzzdee ddtt iittmmiieemmreer r rf f ofofrroo rrCC PPCCPPUUUU 3120.
.
.
.```
using an atomic flag fixed the problem
I've also copied the functions from the previous kernel that calibrate the LAPIC timer
then to make it so it initializes the timer for all CPUs, I just added some code to the scheduler IRQ handler that tests if the LAPIC timer has been initialized or not, and if it hasn't, the timer is initialized.
Then to trigger that, the kernel sends a global IPI with the IRQ vector which will initialize the timer IRQ on all CPUs
Bruh
It's time for the VMM now

Before that
I'm going to test the scheduler
I'll just create 16 threads
all doing some random shit
and see what the scheduler does
maybe I'll make them test the allocator
ASAN Violation at ffffffff800025e0 while trying to write 1 bytes from 0xffffff00000901e6 (Hint: Pointer is in shadow space).
While testing the allocator multi-threading
anyway, this doesn't happen while testing the allocator single-threaded
so it's probably a problem with the allocator not locking stuff at the right time
I think I have a race condition in my IRQL functions
pretty much this:
*Core_GetIRQLVar() = to;
CoreS_SetIRQL(to);```
That's a problem because, say the IRQL is at PASSIVE level, and it's raised to say DISPATCH level, there is a slight chance that, between the set of the irql in cr8 (the call to CoreS_SetIRQL) and the set of the IRQL in the cpu structs (*Core_GetIRQLVar()), an IRQ can happen. In that case, if an IRQ happens, the kernel will likely panic with IRQL on call of the dispatcher is less than the IRQL of the vector reported by the architecture (\"Core_GetIrql() < OBOS_IRQ_VECTOR_ID_TO_IRQL(frame->vector)\")
anyway back to the ASAN violation
after locking the allocator for the entire duration of the Allocate function, it still happens
I got a use-after-free in the scheduler
I think my kernel is cursed again
everything's gone to shit with multiple threads
what if
I just slap a big ol' scheduler lock
it deadlocks
lol
ok how tf does it deadlock:
beginning of scheduler: lock
end of scheduler: unlock
There are no return statements in between
Are you maybe switching to another task between the lock/unlock
oh wait
it might not be a deadlock
it seems as if a part of the scheduler could be taking
a very
very
very
long time
How did you manage to do that
note how this doesn't include the node = node->next
wait why tf is there a non-ready thread in one of the scheduler's priority lists
because the remove node function seemed to fail
not fail with a status code
just like not work
if (node->next)
node->next->prev = node->prev;
if (node->prev)
node->prev->next = node->next;
if (list->head == node)
list->head = node->next;
if (list->tail == node)
list->tail = node->prev;
list->nNodes--;```
I need to look at this very hard
and see if anything's wrong
Look normal
what if it only has next but not prev
then tail would be null
is this a circular list?
no
then the node that's tail can never have next
this is why i use time-tested <sys/queue.h>
the top two if statements handle that
the thread is blocked, has the flags set to dead, and yet the node is still in the priority list
if the list manipulation routines are fine, and there is no double-insertion or similar, suspect concurrency problems or some kind of memory corruption
^
I want to make a debug check
the list remove function doesn't check for a node existing in a list
so something can provide a node which isn't actually in the list it says it is
infy?
Of course as soon as I add the debug check the bug stops happening
ok now it happened
oh wait
the bug is the wrong cpu local structure is being used
basically every thread has a masterCPU struct
how do u even manage to fuck this up
this thread's struct was set to the bootstrap one
for the BSP
it was the kernel main thread
I also happen to fuck one of the priority lists
if (list->tail)
list->tail->next = node;
if(!list->head)
list->head = node;
node->prev = list->tail;
list->tail = node;
list->nNodes++;```
now lemme look at this really hard and see if there's anything wrong
doesn't seem like it
Currently I'm chasing down at least two bugs:
- Whatever tf this is
- UBSan violation because of a thread node being corrupted
looks fine
I'm getting a UBSan violation within KASAN
how fun
wtf is wrong with the stack trace
my kernel is completely cursed
rewrite 6 incoming
how tf is ubsan_abort being called by asan_verify
my brain hurts
UBSan Violation unaligned access in file C:/Code/obos/src/oboskrnl/scheduler/schedule.c at line 98:19
this stack trace is completely fucked up
if I trace starting at the panic
rbp looks fine
except going one level down makes everything not make sense
maybe I should rewrite my scheduler to not be 💩
just saw these two comments in the work stealing function:
// NOTE: There could be some race conditions with this.
// TODO: Fix.```
My scheduler deadlocks often
for reasons
unknown to me
how does it lock?
spin lock
and in what fashion? is there but one lock? when is it acquired and released?
there is a scheduler lock for each cpu
that gets locked whenever a thread priority list or thread is getting modified within it
or on entry of the scheduler
so, for example, if a thread is being blocked, the cpu that owns it would get its scheduler lock locked
or in the work stealing function, when the scheduler decides to steal some threads from a CPU, it locks the scheduler for that CPU
maybe my spin lock had a bug
I was using memory_order_release on unlock
when does the lock get released?
release is generally what one would want
for the scheduler, it releases it before switching to the new thread context
it should ensure that previous writes are done
for the work stealing function, it releases it before return (note, there are no returns between the lock and unlock)
can that be a problem?
your old thread appears to be ready for rescheduling, but in fact you're still on its stack
hmm true
which means, there could be a race condition where the scheduler is still being run on the old stack, and then another cpu switches to the thread
i have an interim solution for this problem in keyronex by releasing the scheduler lock only once we're in the context of the new thread
I think I could just switch to the CPU's temp stack when calling the scheduler
whoopsie daisy
; TODO: Make thread-safe
In the function that's supposed to switch to a temp stack.
ok now I made it thread safe
I
am a fucking idiot
there was a very stupid bug in the work stealing function
It tried to steal work from the same CPU
it used the list parameter passed to it
to steal work from
but that parameter contained the list of the current cpu
which was why the scheduler was deadlocking
it was removing a thread from the priority list
then adding it back to the same priority list
after fixing that bug
all threads are started
and exit successfully
now time to add back the allocator test
now the allocator rather deadlocks or is super slow multithreaded
Time to compile with optimizations, and probably watch as all goes to shit once again
After fixing a dumb bug (ret instead of retfq when the GDT is flushed, causing the stack to be incorrect on return because optimizations emitted the frame pointer), it works
I have a deadlock in the allocator
I fixed it
it was in Free
Because I'm trying to do as much as I can to avoid writing the VMM I'm bored and it might help, I might write a kernel debugger
Actually no
I don't feel like making a makeshift ps/2 keyboard driver again
I added a message to the kernel for when it starts
it says the build time, commit sha, and commit date/time
[ LOG ] Booting OBOS c59108167b885b8e9d74c18ed0ca302c81747092 committed on Sun May 19 20:33:59 2024. Build time: May 19 2024 20:34:11.
I've downloaded a paper on the working set model
and hopefully soon I can get started on the VMM!
how do you store that info in your kernel?
You can generate a source file while compiling, and have that info are variables.
Ok before I get to the fancy parts of the VMM, I need some sort of way to represent contexts
and like virtual addresses
and stuff
you know to store info about virtual addresses
make sure to pair it with the VMS papers to get an idea of how to operationalise it effectively
what for?
associating structures describing the shape of the address space?
yeah
I don't remember why
they are good for looking up sparse but ordered information
I'm implemented "processes" in the kernel
Right now they're just a pid+a thread list
but soon it will contain info for the VMM
and info for handlers
and stuff
I'm looking at some of the code for my 3rd kernel
and I'm thinking
this DEFINITELY wouldn't work on a lot of hardware
because of some of the assumptions it makes
at least not work as intended
The dependency mangement is horrendus for the third kernel
running the third kernel
it kind of seems cursed as well
I think I've got a vague understanding of how the working set works
So I'm going to try implementing it
To "page out" memory, I'll just reserve a chunk of RAM and write the paged out chunk there
I guess it will be like a reverse free list
an allocated list
actually nvm that wouldn't work
I'll find that part out later
oh wait it could
is obos actually stable rn
Let's see
It doesn't triple fault randomly
The scheduler doesn't randomly deadlock (I think)
The allocator works multi-threaded
(which means the basic memory allocator works multi-threaded as well)
(For now)
The IRQL is stable
IRQs are preemptible by IRQs with a higher IRQL than them
Spinlocks work
welll... lets wait until uacpi demolishes it 
It's the same as the last kernel
Does kasan work too?
indeed
it's run thousands of passes with large allocation sizes without failing
only getting slower
for obvious reasons
What allocator did you use again
type?
idk
Just some allocator I made for the previous kernel
Probably free list
along with an allocated list
is atomic_bool guaranteed to be a struct type?
cppreference says struct atomic_flag;
so I'd assume so
why does it matter
my spinlock is a typedef of atomic_flag
but because it is, I need to include stdatomic
and intellisense doesn't like stdatomic.h because it thinks my C version is C99
so I want to know if I can typedef it to typedef struct atomic_flag spinlock
instead of including stdatomic.h and messing up my intellisense
solution
dont use msc/c++
use clangd
vs
visual studio
not vscode
maybe it's time to ditch vs once and for all
not for notepad++ this time
that was a bad time
Why?????
Fair point, the vs debugger is fairly decent. Idk how it would work for osdev though.
clearly it doesnt lmao
gdb ftw
try getting chrome to support debugging x86 code :^)
It can utilize GDB
I have a custom launch.vs.json
which specifies some commands to start and setup gdb
and some stuff to make it actually, y'know, work
I also have a launch.json for vscode
these two scripts I made a long time ago (around a year ago by now)
bruh clangd doesn't seem to have CMake support
how do I get compile_commands.json to work
clangd will look in the parent directories of the files you edit looking for it, and also in subdirectories named build/
it says that
so I made directory, make cmake output in build/ (CMake does actually output that file)
but it still no work
i couldn’t get myself do get that working with osdev
oh wait it was because the build files were being put under build/x86_64-debug
use chrome
But how
i don't know anything about DDD
i just use GDB
it's inefficient and tedious being a CLI (it has a text UI but i tried that and it was murder) but i don't know of any competent open source gui debuggers
Well DDD is a data display debugger based on gdb
i always find the gui ones to either lack information or not work half the time
they were fantastic a long time ago but GDB has gotten better and i'm attuned to it now
some people like LLDB but it's greek to me
yeah gdb is basically second nature to me
i think once upon a time i was using Code::Blocks' debugger which is a frontend to GDB and that was alright, but that was before i got into GDB itself
visual studio's debugger is okay but i find it doesnt like when i try to evaluate a more complex expression
where as gdb always works with that kind of thing
i would quite like to write a kernel debugger, i think that would be fun, but supporting even 10% of what you can do with GDB would be prohibitive
i think the hard parts are evaluating expressions and things
you can implement 90% of what you actually use without that much effort
break/step (in/out/over)/print/backtrace/examine/continue
i haven't looked at DAWRF yet
I did that
idk what you actually use apart from that
step backwards?
but thats just pain
i will really be wanting to be able to identify locals, to name one thing
it might be dead easy, i don't know
yeah no idea either
i think there's some bytecode involved too
which you interpret until you are about to step after the current pc or something
i know that dwarf is basically bytecode and you interpret it up to a given point - and then, i assume, you can get dawrf to tell you what register/stack location some local is in?
i think its something like
yes, that's my understanding too
"X is now in Y"
and then you make a simulated system starting in some initial state like
"rdi = caller rdi, rsi = caller rsi" etc
i would not necessarily be opposed to utilising a DAWRF parser
and instructions are like, "rdi is now in rax"
or whatever
or "this variable is now here"
not sure if there's that much to parse, tbh
or perhaps GCC can still generate traditional STABS?
i dont think stabs would work super well
oh maybe
seems like nasm can produce STABS
MINOCA has a decent kernel debugger, i think they use elves, let me have a quick look if they also use dwarves
its a bit weird
i also think that bloody what's his name invented a kernel debugger that might have used dwarves
i can't remember who he's called
bootboot author
especially the way they do line to address mappings
bzt
oh cool i think i found some docs on stabs
no, bzt's thing is just a standard trivial debugger
is it?
oh, no dwarf
at that point just embed a gdbstub (x86) or copy BED (arm)
the MINOCA debugger appears to be more sophisticated and has DWARF stuff
in terms of computation or in terms of figuring out how to do it?
anyway would be cool to have
but also, i have other much better things to do
like tcping
it will be very useful for me to have on the amiga
no gdb?
^
do you not have a serial port?
i don't think my amiga's serial port works
the amiga's monitor port is db-23 and the serial is db-25
and i got a cheap adapter for db-23 to commodore 1084s-d2 monitor's rgb port
that cheap adapter was just a db-25 that someone took a hacksaw to
and unthinkingly i plugged it into the serial port instead of the rgb port
and there was much smoke and problems
unfortunate
i haven't tested the serial port since, maybe it still works
but the original amiga 2000 PSU, that was toast
only one way to find out
thank fuck it didn't destroy the 68060 card
It'd be funny if the next rewrite of obos is in french
you're not french are you?
I'm not
it's not really a programming language
yet
@real pecan is it normal for hyper to just not provide a frame buffer to my kernel when I asked it to
It mainly happens on uefi systems
Like test subject 1 and 2
Which makes debugging "slightly" harder
It works for bios emulation on test subject 1
#2 fails with cannot find a video mode for the constraint 1024x768x32bpp
On bios
#1 with bios does give a framebuffer
Which works fine
Limine worked btw
Based off my old kernels
But anyway, I've added yet another statement at boot for some basic cpuid things
Like the cpu vendor, brand string, and whether the kernel is being run on a hypervisor or not
Just a screenshot of it running on real hardware
The lapic ids are pretty weird but whatever
nice
might be disabled cores, or you have hyperthreading disabled in the firmware?
No hyper threading on this cpu
or you're reading them wrong 
I mean the cpus get started using said lapic id
So I think it's just a firmware quirk
my desktop also had that
that looks like the LAPIC ids are shifted left by a bit
What fails specifically, is there like no framebuffer at all or different res?
I think it might be a bit annoying and not let you set a forced resolution above native, and often times there's no edid, maybe its that problem
If you have time we can debug later
Yeah sure, but maybe in a couple days though, as I'm busy the next two days
There is no framebuffer at all
BTW the constraint is set to auto iirc
i had a hyper build that just printed out all available video modes somewhere
hmm
i can make a new one if u can test rn
#560042023638269955 message
If anyone's wondering why this project has had no vmm development on it for a week or two by now, it's for two reasons:
- School
- Arm injury while playing football*
*or soccer in north american english
Until my arm heals, I can't really code anything, because with one hand, I only type 20 wpm
which is slow af
oh wait y'all are osdevs, I need to explain what football is /j
Sounds like a skill issue :>
Anyways what doesn't kill you makes you stronger, so once your arm is fully healed it'll go speeeeeed
Test subject 1 booting from the hyper binary that prints the modes prints three modes
I'll see test subject 2
The reserved bit mask is 0000
Red is ff0000
Green is ff00
Blue is 00ff
For all modes on test subject 2
#1 is the same, except reserved is something else
Test subject 1 boots normally without a framebuffer
#2 fails saying no constraint found
@real pecan
BTW this is #2
what's the constraint?
it wasset to auto
but it reported it couldn't find 1024x768x32
iirc
#1141057599584878645 message
wait that was for bios
and you didn't set 1024x768 yourself?
nvm, test subject 2 doesn't seem to provide a framebuffer in uefi
it boots successfully, but no fb
how do u know it even booted then
I'll add a test to make it triple fault if there is no fb
maybe it's a bug with my drawing code
yes, I think so
the failed constraint one is this?
so bios?
oh ok, ill make a similar dumper for bios tomrrow and we'll take a look
Ok
Well on UEFI, it's a bug with my drawing code
yeah try to fix that ig
once that fixed the only bug is failed constraint on one pc?
in bios mode
Yes
well it could partially be because of the fact that my fb retrieval code was in an #if OBOS_RELEASE statement
lol
No framebuffer passed by framebuffer
oops
ok i made it hang after dumping the video modes
try this
@flint idol ping me once u test it
@real pecan
Nothing shows up lol
With that test image
Rather crappy bios (unlikely; iirc limine worked), or bad vbe code
lol
ok well since you're not seeing any warnings
its line 326 that's failing probably
let me add a few more prints
@flint idol can u try this one pls
ok
Limine better???
i helped u fix a bug before 
wdym check?
confusion
this is from limine
(Pump Panel Reconstruction Mix)
on oberrows bios something about the video mode struct is different im tryin to figure out what
does Limine work there? if so, just check for diffs between Hyper and Limine's VBE code
yeah i think so
iirc yes
anyway lets see what this prints out
looks fairly similar
something subtle probably
static inline u16 fb_format_from_mask_shifts_8888(u8 r_shift, u8 g_shift, u8 b_shift, u8 x_shift, u8 bpp)
{
if (bpp == 24) {
if (b_shift == 0 && g_shift == 8 && r_shift == 16)
return FB_FORMAT_RGB888;
if (r_shift == 0 && g_shift == 8 && b_shift == 16)
return FB_FORMAT_BGR888;
} else if (bpp == 32) {
if (x_shift == 0 && b_shift == 8 && g_shift == 16 && r_shift == 24)
return FB_FORMAT_RGBX8888;
if (b_shift == 0 && g_shift == 8 && r_shift == 16 && x_shift == 24)
return FB_FORMAT_XRGB8888;
}
return FB_FORMAT_INVALID;
}
this is why it fails probably
@sharp pike do u just not check reserved or?
u literally dont huh
technically wrong but whatever
ill add the quirk workaround for oberrow
which fields?
uint8_t lin_rsvd_mask_size;
uint8_t lin_rsvd_mask_shift;
what would you want me to do with those fields?
it's a component of a pixel, therefore it must have valid offset & size to detect the type of the format
but idk how limine works exactly, maybe it doesnt care about the format
so what if it was like shift=23 size = 2, that's a completely bogus format
you would just modeset that
yeah
BIOSes aren't a perfect science
it's not a C++ compiler
the only way it would matter is if rsvd overlapped r g or b
Maybe the bug with my drawing code is really because hyper provides fb format invalid
Idk if that's allowed though
can u try this pls
yeah ofc
Ok
who knows
yeah
I'll just generate an obos image then
pls do
instead of the test image I made
if it works ill give u one without info logs so it boots as fast
until i make a proper release
which fucking firmware dev just thought whatever lets not bother setting anything for the x component 
"AMD ATOMBIOS" did
more like RETARBIOS
Well at least the reboot code works
let's continue debuggin tomorrow, gtg soon
lol
K
ill give u one more image tho
oh nvm, might be a quick fix
i still faill if x_size != 8
@flint idol can u test real quick, it doesnt hang so u can use normally
Ok
thx
Same error
that was quick
I added some code to memset the framebuffer to white when boot finishes
Rather boot hangs, or the framebuffer is broken
Because I never see my white screen
I'll add it to the beginning of boot
ill add prints so we can check what framebuffer it tries to set tomorrow, but i doubt its a bug in hyper
i have one last binary for u tho
ok good that would've been fucked
I think my very early boot code hangs somewhere
Because the framebuffer isn't white
It's basically just some cpuid and rdseed/rdrand to get the random stack check value
sure
maybe the cpu doesnt support it?
well yeah that's why it does cpuid first
to check
it does it for both instructions, and falls back to a default value otherwise
just to check that it's not hanging in there, I'm making it triple fault before jumping to the kernel
Same error
wdym
From hyper
that just prints out a list and hangs
is there a chance u didnt install the previous ones as well 
your kernel?
indeed
i see
I redownloaded the hyper install binary
And used it on the iso
And it still gives the error
but how
Maybe you gave the wrong hyper install binary
hmm
i have like one
testing on qemu, it just boots normally
oh wait
I'm using it on the normal obos image
maybe that has something to do with it
oh maybe ur booting as iso
that indeed seemed to be the problem
damn
should work
okay uhh
I can see the constraint
is there a chance u just didnt flash it last time?
Maybe I was getting the error because of the image being booted as iso
or maybe the bios booted it as a cd
The constraint error
exec format error
weird
exec format error for what?
hyper_iso_boot
why are u executing it
u pass it to xorriso right
I'll fix the bug on uefi where it hangs in early boot later
did u verify it actually hangs in your kernel?
Well I'd assume it does
how old is this pc?
I'll make it triple fault first thing on boot
I have a laptop from 2010 with this bug in UEFI
it might be the bootloader hanging in that case
or rather, the firmware
it's a 2013 computer
That'd be funny
try triple faulting and see if that works
but it might be an infinite page fault loop in UEFI
tainocore uefi had this disgusting bug so its present on all early uefi implementations
u can update the bios to fix it
if thats the issue ofc
Hangs before kernel code executes
Ah yes framebuffer issues 
Yeah I bet thats it
The same thing happens in test subject 1
How old is that?
Guess I need to update both computers' bioses now
2013
Oh ok
Well it would be cool if you did
And its generally a good thing to do
You 100% verified that it doesn't reach the kernel right?
Lower half is indeed unmapped
Then yeah
Only if you have problems with the current version, or the motherboard makers are like "UPDATE TODAY TO FIX THIS CVE"
Im about 99% confident its that
Yeah then its unmapped
I do have a problem with the current version
So time to update
I can add logging tomorrow so we can see that it indeed dies after trying to use uefi alloctor
Not now actually
I mean u can just use bios for now it doesn't really matter for a 2013 pc
I'll do it tomorrow probably
Yeah
I'll remove the triple fault
And test obos
but why target old machines :>
All machines I own are from 2013
So that's why

Twst subject 1,2, and 3 all are from 2013
The 256 byte edid blob one
Well I do have a macbook from like 2017 but it's kinda hard to test oses on it
The big blob :>
Indeed
Wasn't it an extended-edid
Version 2 edid
EDID structure (base block) versions range from v1.0 to v1.4; all these define upwards-compatible 128-byte structures. Version 2.0 defined a new 256-byte structure but it has been deprecated and replaced by E-EDID which supports multiple extension blocks.[citation needed] HDMI versions 1.0–1.3c use E-EDID v1.3.[1]
well they were all my dad's
your mom
Or E-EDID probably, since it came out in 1999
the name of the FAT filesystem was inspired from your mom
anyway

Huh its deprecated in 2000
But you still have one
How old is your monitor
Oh
Because you can have up to 32 KiB blobs with E-EDID
Most likely the 128 upper bytes were used as either extension block 1 or a block map
00 FF FF FF FF FF FF 00 05 E3 02 27 A4 2A 00 00
1A 21 01 04 B5 3C 22 78 3F 29 D5 AD 4F 44 A7 24
0F 50 54 BF EF 00 D1 C0 81 80 31 68 31 7C 45 68
45 7C 61 68 61 7C 56 5E 00 A0 A0 A0 29 50 30 20
35 00 55 50 21 00 00 1E 00 00 00 FF 00 56 58 4A
50 36 48 41 30 31 30 39 31 36 00 00 00 FC 00 51
32 37 47 32 47 33 52 33 42 0A 20 20 00 00 00 FD
00 30 A5 FA FA 42 01 0A 20 20 20 20 20 20 01 8C
02 03 32 F1 4C 01 03 05 14 04 13 1F 12 02 11 90
3F 23 09 07 07 83 01 00 00 E3 05 E3 01 E6 06 07
01 63 63 00 6D 1A 00 00 02 01 30 A5 00 00 00 00
00 00 98 FC 00 6A A0 A0 1E 50 08 20 35 00 55 50
21 00 00 1A 40 E7 00 6A A0 A0 67 50 08 20 98 04
55 50 21 00 00 1A 6F C2 00 A0 A0 A0 55 50 30 20
35 00 55 50 21 00 00 1E F0 3C 00 D0 51 A0 35 50
60 88 3A 00 55 50 21 00 00 1C 00 00 00 00 00 F8
This is one of my monitors EDID blobs
HKLM\SYSTEM\CurrentControlSet\Enum\DISPLAY\<Monitor>\<ID>\Device Parameters\EDID In the registry 🙂
The upper 128 bytes refer to a CEA-EXT extension block it seems
How did u read it
For me I just reg query "HKLM\SYSTEM\CurrentControlSet\Enum\DISPLAY\AOC2702\5&1a8dbdb9&0&UID4355\Device Parameters" /v "EDID"
in cmd
But you probably want to open it in registry editor to find the correct monitor and id parts
I see
Also you might have a system like me where you have more monitors than you actually have...
I have two, but this states I should have three xD
Looks like it has the same id
4355 vs 4357
I meant the thing before
Nono the first one is a nonexistent one
oh my bad
Ok the list of EDID blobs
AOC2702\1&8713bca&0&UID0
00 FF FF FF FF FF FF 00 05 E3 02 27 A4 2A 00 00
1A 21 01 04 B5 3C 22 78 3F 29 D5 AD 4F 44 A7 24
0F 50 54 BF EF 00 D1 C0 81 80 31 68 31 7C 45 68
45 7C 61 68 61 7C 56 5E 00 A0 A0 A0 29 50 30 20
35 00 55 50 21 00 00 1E 00 00 00 FF 00 56 58 4A
50 36 48 41 30 31 30 39 31 36 00 00 00 FC 00 51
32 37 47 32 47 33 52 33 42 0A 20 20 00 00 00 FD
00 30 A5 FA FA 42 01 0A 20 20 20 20 20 20 01 8C
AOC2702\1a8dbdb9&0&UID4355
00 FF FF FF FF FF FF 00 05 E3 02 27 A4 2A 00 00
1A 21 01 04 B5 3C 22 78 3F 29 D5 AD 4F 44 A7 24
0F 50 54 BF EF 00 D1 C0 81 80 31 68 31 7C 45 68
45 7C 61 68 61 7C 56 5E 00 A0 A0 A0 29 50 30 20
35 00 55 50 21 00 00 1E 00 00 00 FF 00 56 58 4A
50 36 48 41 30 31 30 39 31 36 00 00 00 FC 00 51
32 37 47 32 47 33 52 33 42 0A 20 20 00 00 00 FD
00 30 A5 FA FA 42 01 0A 20 20 20 20 20 20 01 8C
02 03 32 F1 4C 01 03 05 14 04 13 1F 12 02 11 90
3F 23 09 07 07 83 01 00 00 E3 05 E3 01 E6 06 07
01 63 63 00 6D 1A 00 00 02 01 30 A5 00 00 00 00
00 00 98 FC 00 6A A0 A0 1E 50 08 20 35 00 55 50
21 00 00 1A 40 E7 00 6A A0 A0 67 50 08 20 98 04
55 50 21 00 00 1A 6F C2 00 A0 A0 A0 55 50 30 20
35 00 55 50 21 00 00 1E F0 3C 00 D0 51 A0 35 50
60 88 3A 00 55 50 21 00 00 1C 00 00 00 00 00 F8
AOC2702\5&1a8dbdb9&0&UID4357
00 FF FF FF FF FF FF 00 05 E3 02 27 8D 07 00 00
1C 21 01 04 B5 3C 22 78 3F 29 D5 AD 4F 44 A7 24
0F 50 54 BF EF 00 D1 C0 81 80 31 68 31 7C 45 68
45 7C 61 68 61 7C 56 5E 00 A0 A0 A0 29 50 30 20
35 00 55 50 21 00 00 1E 00 00 00 FF 00 31 38 44
50 37 48 41 30 30 31 39 33 33 00 00 00 FC 00 51
32 37 47 32 47 33 52 33 42 0A 20 20 00 00 00 FD
00 30 A5 FA FA 43 01 0A 20 20 20 20 20 20 02 0D
02 03 32 F1 4C 01 03 05 14 04 13 1F 12 02 11 90
3F 23 09 07 07 83 01 00 00 E3 05 E3 01 E6 06 07
01 63 63 00 6D 1A 00 00 02 01 30 A5 00 00 00 00
00 00 40 E7 00 6A A0 A0 67 50 08 20 98 04 55 50
21 00 00 1A 6F C2 00 A0 A0 A0 55 50 30 20 35 00
55 50 21 00 00 1E F0 3C 00 D0 51 A0 35 50 60 88
3A 00 55 50 21 00 00 1C 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 E1
70 12 79 03 00 03 01 14 EB 01 01 04 FF 09 69 00
07 80 1F 00 9F 05 3C 00 02 00 04 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 6C 90
O_O
It just got progressively bigger xD
holy yapping of the yappingtons
Absolutely
Just me trying to figure out parsing that block
But either the block is broken or the spec on wikipedia is broken

Does it parse the upper 128 bytes tho?
Yes
As a normal EDID blob?
Yes
And not as the extension?
How many times do I say yes 
Uefi probably exposes it the way its compatible
Or again maybe you're experiencing a so called skill issue
The problem is that the blob says it has a Speaker Allocation block of 12 bytes, but they're supposed to only be 3 bytes in total
Yeah this is what I parsed manually
@real pecan Upon updating the firmware for test subject two, OBOS still does not boot in UEFI mode
let me give u a binary with info logs
test subject one is on the latest bios version
nice try hacker
the last update was from 2014
this specific model seems to have been manufactured in 2015
And you also do have direct access to my machine, right?
yes, there's a backdoor using asynchronous http uefi api to send over all keys
Good good, I mean I don't use my pc to its fullest, so I gotta let others use some of it 😉
yes, u dont need all your terabytes of ram

I do have 64 gigs of DDR5 unused, but it'll be like 400€ :>
Cuz I paid way more for them 
Anyways I should really try and get a server rig soon
for reference, this is what qemu returns
yeah it disables info logging relatively early as using UEFI ConOut is allowed to allocate memory
which alters the memory map
if that binary i sent u doesnt come up with anything ill remove the logging disabler
I wanna make a script to refresh the fat32 image I use for xorriso
how do u not have oine
never made one
damn
i can just give u the test kernel iamge
that i use
if u wanna use that instead of reflashing stuff
it boots into the test kernel
iso
huh wtf
what if it's making a pt
but lets dig deeper
im afraid its simpler
i didnt add logging to the function that allocates memory
it probably hangs in that
lets see
wouldn't be surprised to never see the bottom log
but ill sprinkle a few more printfs just to be sure
I assume that's because of the bug you told me about earlier
yeah
but thats not the first allocation with a custom type i think
anyway lets see
would be nice if its some other bug
that means we didnt waste time
Horray
I remmeber it only manifests itself once u actually try to retrieve the memory map
it probably hangs in GetMemoryMap
after some light searching
phoneix is the company that makes the bioses for dell
which is the company that made test subject 2
im afraid its this
oof
this is invoked when it tries to iterate the high memory to map it
it deferred until actually requested
so
but let's see ofc
still hoping its a bug on my part
limine loads it and then carves pieces out of it manually i think, aka doesn't use uefi allocators or something like that i believe
which isnt super safe i think
@sharp pike can correct me on that
for a workaround i guess i could have an internal overlay buffer that contained a mapping of which range represents what loader memory type
idk its just a uefi bug that i didnt want to work around
Limine works around even the stupidest of firmware bugs if i find them
what does it say

