vdamewood has quit [Read error: Connection reset by peer]
terminalpusher has joined #osdev
vdamewood has joined #osdev
<geist>
or on fire
<Griwes>
I'm hoping the wet winter will make fire season start late this year
<ZombieChicken>
It won't
<ZombieChicken>
Just pile up sand on your property and hope for the best
<Griwes>
let me have my hubris for a while
<kazinsal>
can't wait for ash season
<zid`>
>fire season
<geist>
yeah.... okay, it'll be great Griwes!
<heat>
zid`, how's rain season?
<ZombieChicken>
kazinsal: On the bright side, all that ash might help offset the acidification of the oceans
<Griwes>
zid`, yeah, US pacific coast doesn't have a summer, it has a fire season
goliath has quit [Quit: SIGSEGV]
<kazinsal>
we used to have summer. then may became summer and june-august became fire season
<geist>
and then spider season
<heat>
crikey
linearcannon_ has joined #osdev
Left_Turn has quit [Read error: Connection reset by peer]
linearcannon has quit [Ping timeout: 276 seconds]
<Griwes>
okay so clang16 is stricter with concepts than clang 14. okay. so I replace a weird constraint (no clue why I wrote it this way) with a sane one
<Griwes>
what do I get? an ICE
<Griwes>
thanks, clang
<zid`>
I think "habitable" and "has a fire season" are non-overlapping
<heat>
i've had a consistent GCC ICE on a constexpr syntax error
<heat>
compilers were not meant to be this complex
<ZombieChicken>
zid`: how about "habitable" and "constantly under threat due to natural disasters"?
<Griwes>
in this one I'm doing Tricks, so I can understand why they get this wrong lol
<Griwes>
let me check if clang maybe has a builtin for this lol
<Griwes>
nope
<heat>
why are you using concepts
<heat>
have you considered: not using concepts
<Griwes>
because requires clauses are nicer than enable_if
<Griwes>
and also they can (if/when clang actually implements this) remove the whole mess of a hierarchy of base classes to choose between trivial and nontrivial special member functions :P
<heat>
if you're doing templates you're already wrong
<heat>
and this is fax
<Griwes>
I'll give up std::variant when you pry it from my cold, dead hands
<zid`>
this all does sound very self-inflicted
<heat>
have you considered using a union
<Griwes>
still better than not having templates
<heat>
i know i'm being stupid on purpose but I seriously avoid templates as much as I can
<heat>
40s file compile times I do not want
<heat>
by far the files that take longer to compile in my base system are... google test tests
<heat>
files that include nlohmann_json are 2nd, then any file that includes the C++ standard library files
<Griwes>
turns out that I already had a less clever implementation of the same thing further down in the same file
<Griwes>
lol
<geist>
fwiw a bug report for an ICE i bet will get looked at
<Griwes>
I know, I'll try to repro later
<heat>
are there nice C/C++ json libs that aren't horribly slow to compile?
<Griwes>
ah, no, that other implementation was doing something else
* Griwes
sighs
<heat>
i wonder if I could just pch that whole header...
<Griwes>
...alright, but the correct version of that still runs into the same ICE
<kof123>
im writing a malloc. it will take x pools, and always append so long as there is room (after previous allocation for that pool). after that, search for gaps between allocations, linked node by linked node (this is likely slow). it will do alignment if requested. you folks just cant compete in the bad code department.
<kof123>
with this "algorithm" it makes me think splitting a contiguous area into separate pools, to try to avoid that slowdown when it nears the end, could still be a gain
<bslsk05>
github.com: Onyx/asan.cpp at 9ccdee34fca30b0bbead41e08a2cb3ac38575d92 · heatd/Onyx · GitHub
vdamewood has quit [Ping timeout: 248 seconds]
vdamewood has joined #osdev
[itchyjunk] has quit [Ping timeout: 260 seconds]
zaquest has quit [Ping timeout: 250 seconds]
wlemuel has quit [Ping timeout: 240 seconds]
[itchyjunk] has joined #osdev
wlemuel has joined #osdev
epony has joined #osdev
heat has quit [Remote host closed the connection]
vdamewood has quit [Read error: Connection reset by peer]
<kof123>
only reason i added "pools" is because on ti83 or playstation or something, you got a little more RAM telling malloc about various areas. but, that might actually be useful for threads some day [*] -- lock one pool, check for whatever needs to be done, they wont have to stall as much versus One Giant Lock <stares at liballoc>
ZombieChicken has quit [Remote host closed the connection]
<kof123>
[*] "some day" == see you in 5 years
vdamewood has joined #osdev
terminalpusher has quit [Remote host closed the connection]
Vercas6 has quit [Remote host closed the connection]
Vercas6 has joined #osdev
<Griwes>
oooookay, I think I finally got clang 16 to work
<bslsk05>
github.com: Update toolchain llvm from llvmorg-14.0.1 to llvmorg-16.0.1. by reaver-project-ci · Pull Request #106 · griwes/reaveros · GitHub
[itchyjunk] has quit [Remote host closed the connection]
wlemuel has quit [Ping timeout: 255 seconds]
Arthuria has joined #osdev
wlemuel has joined #osdev
bradd has joined #osdev
ornx has quit [Ping timeout: 260 seconds]
ornx has joined #osdev
gog` has quit [Ping timeout: 250 seconds]
pmaz has joined #osdev
GeDaMo has joined #osdev
pmaz has quit [Quit: Konversation terminated!]
xvmt has quit [Remote host closed the connection]
xvmt has joined #osdev
wlemuel has quit [Ping timeout: 255 seconds]
wlemuel has joined #osdev
Arthuria has quit [Ping timeout: 248 seconds]
SGautam has joined #osdev
zaquest has quit [Remote host closed the connection]
vdamewood has quit [Remote host closed the connection]
vdamewood has joined #osdev
wlemuel has quit [Ping timeout: 276 seconds]
wlemuel has joined #osdev
slidercrank has joined #osdev
pmaz has joined #osdev
zabot has joined #osdev
<zabot>
I'm having an issue with paging and its driving me crazy. I've got x86 paging setup and things are working great. My kernel is identity mapped and I have a page fault handler set up that is successfully called when I page fault. My page fault handler allocates a new page and adds it to the page directory and page table requested and then returns from the interrupt. The return from the interrupt is to the correct place, but no matter what
<zabot>
I do the virtual address is mapped to the physical address 0x0 after the first access. If I immediately access the same freshly mapped page again, it is correctly resolved to the new page that was allocated for it. It almost feels like I need to explictily do _something_ in the page fault handler to say "I mapped the page, try again", but I can't find any documentation that says what that thing is.
<mrvn>
)))...))) auto-complete any missing closing parens.
terminalpusher has quit [Remote host closed the connection]
wlemuel has quit [Ping timeout: 255 seconds]
zabyte has joined #osdev
wlemuel has joined #osdev
[itchyjunk] has joined #osdev
<sortie>
sortix.org is now 100% self-hosting running the latest official nightly build of my OS (which was built on my OS) connected straight to the internet via the native IP stack with TLS provided by libressl and web hosting powered by my nginx port -- no secret sauce or unreleased tech -- kids you can do this at home now too :D
<nikolar>
Very cool sortie
<ThinkT510>
yes, sortie is very cool. and his OS is pretty cool too
epony has quit [Remote host closed the connection]
<mrvn>
My feeling is that if you have the same problem to solve to the same specs your code will be awfully similar if not identical. If you read the GPL code as docs before implementing it then who says you didn't just copy the code and obfuscated it a bit to make it look like your own.
eck has quit [Quit: PIRCH98:WIN 95/98/WIN NT:1.0 (build 1.0.1.1190)]
bnchs has joined #osdev
eck has joined #osdev
<sham1>
A good idea is a good idea no matter whom it comes from
<heat>
the funny bit is that there are no specs
<sortie>
nikolar, ThinkT510, thank you :)
<heat>
also he's pretty explicit "The patch is modeled after the analogous commit to the Linux kernel, which can be viewed here: https://lwn.net/Articles/671640/"
sortiecat has quit [Remote host closed the connection]
teroshan9 has joined #osdev
Jingwiw_ has quit [Remote host closed the connection]
Jingwiw_ has joined #osdev
Jingwiw_ has quit [Remote host closed the connection]
Jingwiw_ has joined #osdev
Jingwiw__ has joined #osdev
Jingwiw_ has quit [Remote host closed the connection]
Jingwiw__ has quit [Remote host closed the connection]
Jingwiw_ has joined #osdev
Jingwiw_ has quit [Remote host closed the connection]
Jingwiw_ has joined #osdev
Jingwiw__ has joined #osdev
Jingwiw_ has quit [Remote host closed the connection]
Jingwiw_ has joined #osdev
Jingwiw__ has quit [Remote host closed the connection]
Jingwiw__ has joined #osdev
Jingwiw_ has quit [Remote host closed the connection]
zabyte has quit [Ping timeout: 250 seconds]
Jingwiw_ has joined #osdev
Jingwiw__ has quit [Ping timeout: 248 seconds]
Arthuria has joined #osdev
Arthuria has quit [Killed (NickServ (GHOST command used by Guest684531))]
Arthuria has joined #osdev
xenos1984 has quit [Ping timeout: 265 seconds]
xenos1984 has joined #osdev
xenos1984 has quit [Ping timeout: 248 seconds]
wootehfoot has joined #osdev
xenos1984 has joined #osdev
zabot has joined #osdev
<zabot>
heat: what do you mean by memory corruption? I've validated that the linear address being requested is the correct address, but the physical address of the access that causes the PF is 0x00000000.
<zabot>
I ripped everything out of my page fault handler so that it just returns, (I would expect this to spin forever because the requested page is never present). Instead it happily carries on and translates every faulted address to zero.
<zid`>
how are you getting the physical address
<zid`>
If the linear address is valid, it won't pf (for translation at least, it might for permissions), and you can't access physical memory directly
wlemuel has quit [Ping timeout: 240 seconds]
wlemuel has joined #osdev
<zabot>
zid`: I've identity mapped all of my kernel pages ahead of time. Those work as expected, but as soon as I try and dynamically add a page in the pf handler the first access maps to zero. Every access after that maps where I expect, and doesn't generate any more page faults
Jingwiw__ has joined #osdev
<zabot>
Oh, I know it's accessing physical address zero because I do a write and then dump the ram from qemu. The thing that I wrote ended up at 0 and the place it should have been was unwritten.
Jingwiw_ has quit [Read error: Connection reset by peer]
<zid`>
so then it's not pfing because of the mapping then, it's permissions
<zid`>
or you resolved the mapping I guess
<zid`>
(reading upside down)
<zid`>
sounds like you know where your bug is then though
<zabot>
The mapping works if I accessed a page that I explicitly mapped before accessing it.
<zabot>
It's like the write isn't restarted after returning from the page fault.
<zabot>
If I write to a page that is not already mapped a page fault is generated, the page table is updated correctly, I return from the handler and then the data is written to physical address zero. If I write to the same address a second time the write goes to where I expect and no pf is generated.
<zid`>
>the page table is updated correctly
<zid`>
I mean, sounds precisely like it isn't
<zid`>
how are you verifying this?
<zid`>
are you invlpging it?
<zabot>
> how are you verifying this?
<zabot>
I spin lock right after the incorrect write and dump the memory with qemu. I see the expected pt entry with the present bit set.
<zabot>
I invlpg the address that generated the fault in the isr right before I return from the handler
zabot has quit [Ping timeout: 265 seconds]
Jingwiw__ has quit [Read error: Connection reset by peer]
Jingwiw_ has joined #osdev
Jingwiw__ has joined #osdev
Jingwiw__ has quit [Read error: Connection reset by peer]
Jingwiw has joined #osdev
Jingwiw_ has quit [Ping timeout: 248 seconds]
zabot has joined #osdev
goliath has joined #osdev
<zabot>
Rewriting cr3 to force a flush of the whole tlb also doesn't have an effect
<heat>
if you crash and info tlb in qemu's monitor what do you get
Jingwiw_ has joined #osdev
<heat>
your ISR looks buggy or at least bug prone
<heat>
and that's the least I can know. but "I write something and it goes to 0" sounds like you're doing a null deref lol
<heat>
s/least/most/
Jingwiw has quit [Ping timeout: 246 seconds]
Jingwiw__ has joined #osdev
Jingwiw_ has quit [Ping timeout: 246 seconds]
<zabot>
Is there a canonical example of a barebones pf isr somewhere? I've read the JamesM one, but that only panics, it doesnt update the pt and return.
<heat>
1) that's not how you generally do things
<heat>
2) we're missing the whole picture of code that maps
<zid`>
demand paging is a pretty obscure mechanic in the grand scheme of things
<heat>
generally you define a bunch of identical handlers that get to C code, C then does its dispatch to your page fault handler or whatever handler you wnat
<zabot>
> demand paging is a pretty obscure mechanic in the grand scheme of things
<zabot>
Is that not how page mapping happens for user space processes? User space accesses unmapped memory, page fault is triggered switching to supervisor mode, kernel maps a new page and returns back to userspace?
<zid`>
almost never
<zid`>
swapfiles and sparse mmap
<zid`>
possibly automatic stack extension
<heat>
it happens like that for user space processes, but this isn't a userspace process, and kernels don't work like that
vdamewood has quit [Read error: Connection reset by peer]
<heat>
it's also not unbounded. you had to get it "mapped" with the kernel using mmap/brk/your_favourite_memory_mapping_primitive
vdamewood has joined #osdev
<zabot>
But I would still need a page fault handler that handles page faults generated by userspace right? Or are you saying that all userspace pages are preallocated?
<zid`>
They exist in a 'this is allocated but not currently mapped' state
<zid`>
or 'this is allocated and mapped' (in which case no fault happens)
<zid`>
anything else is a fatal error
<zid`>
like, the kernel has hidden away some memory because of swap, the page fault happens, and it puts things back to how it should be, using its internal data structures that are tracking things like that
<zid`>
if I write to 0 it isn't going to magic up something to put there for no reason
<zid`>
it's going to kill my progress with a segfault
<zabot>
"allocated but not mapped", so from an implementation perspective does this look like a page directory with a bunch of page tables in it, all full of pages with the present bit unset. Then when the page fault happens update the page table entry and set the present bit?
<heat>
could be an implementation, yes, but generally no
<zid`>
it looks like you consult your metadata
<zid`>
you need to know *why* it's a valid fault, most importantly
<zid`>
are you supposed to be restoring data from a hard drive, or allocing?
<zid`>
or is this a memory mapped file backed by a driver and the driver needs to fill it out with useful data? etc
<zabot>
Let me pastebin the handler and mapping code, one sec
<zabot>
Collapsed a few files together, here is the page fault handler, page table management, and mapping code.
<heat>
465 /* Lets hope nobody opens this 2 billion times */
<heat>
467 ("%s: Open too many times", __func__));
<heat>
468 active_count++;
<heat>
466 KASSERT(active_count < INT_MAX,
<heat>
469 if (active_count == 1) {
<heat>
470 cov_register_pc(&trace_pc);
<heat>
471 cov_register_cmp(&trace_cmp);
<heat>
472 }
Jingwiw_ has joined #osdev
Jingwiw__ has quit [Ping timeout: 265 seconds]
zabyte has joined #osdev
zabot has quit [Ping timeout: 260 seconds]
zabyte has quit [Ping timeout: 255 seconds]
[itchyjunk] has quit [Ping timeout: 265 seconds]
Jingwiw__ has joined #osdev
terminalpusher has joined #osdev
xenos1984 has quit [Read error: Connection reset by peer]
Jingwiw_ has quit [Ping timeout: 265 seconds]
Jingwiw__ has quit [Read error: Connection reset by peer]
Jingwiw__ has joined #osdev
[itchyjunk] has joined #osdev
Ermine has quit [Remote host closed the connection]
Ermine has joined #osdev
xenos1984 has joined #osdev
dutch has joined #osdev
_xor has quit [Quit: brb]
Jingwiw_ has joined #osdev
GeDaMo has quit [Quit: That's it, you people have stood in my way long enough! I'm going to clown college!]
Jingwiw__ has quit [Ping timeout: 256 seconds]
terminalpusher has quit [Remote host closed the connection]
<heat>
kcov's cool. i feel moderately happy for having it
<heat>
it's not ASAN-cool, but it's cool
<heat>
i may not be very far from syzkaller for Onyx
<heat>
it's very funny how netbsd, openbsd and freebsd all accidentally emulated linux and its non-obvious API semantics on this. no one looked at linux code nuh uh no sir we would never.
<geist>
welcome to unix
<geist>
a hodgepodge of backwarsd compatibility and cargo culting so that stuff appears to work
<heat>
the hilarious bit is that every system got a slightly different interface, with slightly different ioctl names and arguments