<bslsk05>
github.com: Onyx/pagealloc.cpp at e3dd8a6ab57f573e656017f4d8b05c2e43f9c836 · heatd/Onyx · GitHub
xenos1984 has quit [Read error: Connection reset by peer]
<heat>
follow alloc_pages for regular page alloc, free_page for freeing
<heat>
i don't have any visibility into this code atm as this is all IRQs-off
<heat>
i'm seeing similar values to my host linux soooo, nice?
goliath has quit [Quit: SIGSEGV]
xenos1984 has joined #osdev
mi7 has quit [Read error: Connection reset by peer]
<heat>
oh wow in this test having slab on top of the direct map is far slower
<heat>
this deserves some tlb miss cpu metrics
[itchyjunk] has quit [Ping timeout: 240 seconds]
Left_Turn has joined #osdev
Left_Turn has quit [Read error: Connection reset by peer]
[itchyjunk] has joined #osdev
rnicholl1 has quit [Quit: My laptop has gone to sleep.]
rnicholl1 has joined #osdev
nvmd has joined #osdev
dutch has quit [Quit: WeeChat 3.8]
<geist>
yeah i suppose if the slabs aren't clustered virtually at all it propbably gets slow TLB misses since the page walker doesn't get any real help
dutch has joined #osdev
<heat>
well they'll be fairly clustered in the 1GB pages
<heat>
in this case I'm even only running on 512MB pages, so it should be all clustered in a single GB page
<heat>
so either something really funky is going on, or my page allocator sucks. but I don't think it's my page allocator, the slab allocator barely fetches from the backend, it usually only serves from its caches
rnicholl1 has quit [Quit: My laptop has gone to sleep.]
rnicholl1 has joined #osdev
pog has quit [Ping timeout: 250 seconds]
nvmd has quit [Quit: WeeChat 3.8]
rnicholl1 has quit [Quit: My laptop has gone to sleep.]
skipwich has quit [Quit: DISCONNECT]
skipwich has joined #osdev
heat_ has joined #osdev
heat has quit [Read error: Connection reset by peer]
[itchyjunk] has quit [Remote host closed the connection]
riverdc has quit [Ping timeout: 268 seconds]
riverdc has joined #osdev
heat_ has quit [Ping timeout: 246 seconds]
foudfou has quit [Remote host closed the connection]
<bslsk05>
github.com: xray-16/CMakeLists.txt at dev · OpenXRay/xray-16 · GitHub
<bl4ckb0ne>
yeah setting flags via command line is no good
<GeDaMo>
zid: it's quite cool here today :P
<bl4ckb0ne>
it overrides everything
<mcrod>
that's incredible.
<zid>
GeDaMo: So you gave me all the hot, 29C here
<GeDaMo>
Although it's warm enough that I have a window open
<zid>
It's so warm here opening the windows would be a death sentence
<mcrod>
I guess what I have to do now is patch CMake's CMakeLists.txt
<mcrod>
isn't that _amazing_
<zid>
need my fibreglass and doubleglazing to save me from the viscious death orb
<bl4ckb0ne>
cmake is dumb and full of footgun
<bl4ckb0ne>
what do you want to do mcrod
<mcrod>
i want to use lld
<mcrod>
.
<mcrod>
that's all
<mcrod>
i wonder if I can patch OverrideC.cmake and OverrideCXX.cmake in this thing
[itchyjunk] has joined #osdev
<bl4ckb0ne>
to build cmake itself?
<mcrod>
yes,
<mcrod>
in the interest of speed
<mcrod>
(this is being built as part of a toolchain on CI)
<bl4ckb0ne>
have you tried to set the exe ld flag on thr command line
<mcrod>
you mean CMAKE_CXX_LINK_EXECUTABLE?
<mcrod>
if so, yes it blows up
<bl4ckb0ne>
lovely
<bl4ckb0ne>
toolchain file maybe?
<mcrod>
yeah, that's what I'm thinking, I'm trying something else as a hail mary
<bl4ckb0ne>
and you set CMAKE_LINKER in it
<mcrod>
well, I'm on the right track, my fix worked
<zid>
My fix would be to delete every file with cmake in the name then replace it with a .sh script that does gcc *.c -o project -O3 -W -Wall -fwhole-program
<zid>
may not be applicable
<mcrod>
string(APPEND CMAKE_CXX_LINK_EXECUTABLE " -fuse-ld=lld") was the 'fix'
<bl4ckb0ne>
nice
<mcrod>
the fact that I can't do that by the command line is remarkable.
<bl4ckb0ne>
append is the way
<bl4ckb0ne>
my last fix proposal wouldve be to switch to meson
<mcrod>
zid: i wish it were.
<mcrod>
i'm honestly so bored of this stupid fucking build script
<mcrod>
works fine on linux sh, but not on mac sh
<bl4ckb0ne>
mesooooon
dude12312414 has joined #osdev
<alethkit>
Is zig mature enough as a build system for your purposes?
gareppa has quit [Quit: Leaving]
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
<zid>
The one eyed cat keeps coming back now that he's figured out there's cat food inside
<dzwdz>
it multiplies the amount of bits by log10(2)
<zid>
yes
xenos1984 has joined #osdev
<zid>
why do they have $$ of arbitrary byte length
<zid>
and not say, int
<dzwdz>
they don't lol
<heat>
what 😭😭😭
<zid>
then why is this parameterized
<dzwdz>
the argument is just sizeof(something)
<zid>
...
<zid>
#define DIGITS_FOR_UINT32
<heat>
oh my fucking god
<heat>
int len = max_int_length(sizeof(val));
<heat>
fmtstr(buf, len, "%" PRIdMAX, val);
<heat>
char buf[len];
<heat>
setvar(name, buf, flags);
<dzwdz>
zid: hey that's not portable
<zid>
Don't even need a +12 safety factor, there's literally only one answer
<dzwdz>
what if you're running on a 7byte machine
<zid>
posix says char_bit is 8
<dzwdz>
i bet you won't have a digits_for_uint56 constant
<zid>
I only support posix shells sorry
<heat>
also... this does the wrong thing for non-int values
<heat>
and setvarint takes intmax_t
<heat>
is this bog
<zid>
I wanna pass it -1
<zid>
I assume they malloc this
<dzwdz>
on a related note, do either of you have a clue why i might be getting a floating point exception on this
<dzwdz>
on mulsd
<zid>
I thought you said it was constant :/
<heat>
dzwdz, you didn't enable fp
<dzwdz>
i did
<zid>
constants don't generate muls
<dzwdz>
otherwise i'd get an undefined instruction exception
<heat>
you didn't enable it correctly
<heat>
see your fpcw
<heat>
or whatever that's called in x86
<GeDaMo>
Don't you sometimes get FPE on things like divide by zero?
<dzwdz>
first presbyterian church of wilmette?
<dzwdz>
it has byte in the name so it could be related
<zid>
If one or more exception flags are set in the FPU status word prior to loading a new FPU control word and the new control word unmasks one or more of those exceptions, a floating-point exception will be generated upon execution of the next floating-point instruction
<heat>
sorry, it's mxcsr
<zid>
(fldcw)
<zid>
but that's x87 not sse
<heat>
set mxcsr to 0x1F80 as recommended by intel
<zid>
mxcsr documents *not* having the behavior, explicitly, which is fun
<heat>
<zid> I assume they malloc this <-- nope, it's a VLA
<zid>
oh even better, that's an easy exploit
<zid>
I can now sprintf into the return addr
<zid>
granted this code is internal
<dzwdz>
fun fact 2, they use alloca in the parser too
<zid>
alloca is sort of understandable in a parser tbh
<zid>
if you don't want to blind recursion
<zid>
granted, it's UB if alloca fails, but that UB is probably better than C's UB
<zid>
like a page fault
<heat>
hm, no, there's no exploit here, it's just crap code
<zid>
well it's internal so there's no exploit
<heat>
there was no exploit to begin with
<zid>
regardless of how buggy it is or isn't to use as a developer on dash
<zid>
yes
<zid>
It just makes it impossibler to use correctly because of the bad interface, which can lead to exploits
<zid>
it isn't itself an exploit
<dzwdz>
heat: thanks, that fixed it
<dzwdz>
also thanks for telling me i was being extremely stupid about /proc/ earlier
<dzwdz>
i came up with the design like over a year ago, didn't see the obvious way to fix it, and didn't think much about it since
<zid>
wait, someone needed calling stupid
<heat>
how did you fix it?
<zid>
and I wasn't there!?
<dzwdz>
nothing really required fixing as the issue i thought i had wasn't really an issue
<dzwdz>
now when you mount /proc/, a new namespace is created with all your current children in it - who keep their ids and are removed from the previous namespace
<zid>
dzwdz: ping me next time, I live for this
<heat>
do you have pids now
<dzwdz>
the next issue is that each time you call ps 369 processes are created
<dzwdz>
i do
<zid>
369 processes? not bad
<zid>
just need to trim it down by 300
<dzwdz>
it's somewhere around 7-10 processes for each file in /proc/ you open
<bnchs>
1 processor with 369 processes or 1 process with 369 processors?
xenos1984 has quit [Ping timeout: 250 seconds]
<bnchs>
which one is better
slidercrank has joined #osdev
Arthuria has joined #osdev
<zid>
did you make a microkernel on purpose or accidentally
<dzwdz>
i was trying to make a microkernel
<dzwdz>
but i don't think it deserves being called a microkernel
<zid>
Oh, flying colours then, gj
<zid>
ofc it's a microkernel, it started 369 processes for `ps`
<zid>
That's the definition
<heat>
why do you need a process to open a file?
<heat>
is this the microest kernel
<dzwdz>
bad code, mostly
<dzwdz>
so /proc/ is the first filesystem mounted
<dzwdz>
and after it i mount a bunch more stuff
<dzwdz>
but to have the mounts show up when reading a directory
<dzwdz>
on each mount i'm doing another overlay mount on /
<dzwdz>
which injects the directory entry
<dzwdz>
there are multiple ways to solve this, it's a temporary thing
<dzwdz>
i just kinda don't care
<heat>
369 but the 3 is silent
<zid>
I mean, if you cared, you wouldn't have made such a successful microkernel
<zid>
if you wanted to chase performance with hot caches and low process creation etc you'd have made a normal OS
<heat>
oh fuck oh yeah hot caches
<heat>
onlycaches.com
<dzwdz>
if you're curious about the processes involved