klange changed the topic of #osdev to: Operating System Development || Don't ask to ask---just ask! || For 3+ LoC, use a pastebin (for example https://gist.github.com/) || Stats + Old logs: http://osdev-logs.qzx.com New Logs: https://libera.irclog.whitequark.org/osdev || Visit https://wiki.osdev.org and https://forum.osdev.org || Books: https://wiki.osdev.org/Books
heat has quit [Ping timeout: 256 seconds]
heat has joined #osdev
<rnicholl1> Is it possible to attach gdb to a kernel running in qemu somehow
<heat> qemu -s then in gdb "target remote :1234"
<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]
foudfou has joined #osdev
bradd has quit [Ping timeout: 240 seconds]
bradd has joined #osdev
<mrvn> do you have to consider page coloring?
<mrvn> heat: ^^
melonai4 has joined #osdev
melonai has quit [Ping timeout: 268 seconds]
melonai4 is now known as melonai
hrberg has joined #osdev
remexre has quit [Ping timeout: 268 seconds]
remexre has joined #osdev
terminalpusher has joined #osdev
mi7 has joined #osdev
GeDaMo has joined #osdev
ThinkT510 has quit [Quit: WeeChat 3.8]
ThinkT510 has joined #osdev
antranigv has quit [Quit: ZNC 1.8.2 - https://znc.in]
antranigv has joined #osdev
dinkelha1 has quit [Quit: WeeChat 3.5]
dinkelhacker has joined #osdev
antranigv has quit [Quit: ZNC 1.8.2 - https://znc.in]
antranigv has joined #osdev
elastic_dog has quit [Ping timeout: 240 seconds]
elastic_dog has joined #osdev
gmacd has joined #osdev
gmacd has quit [Ping timeout: 256 seconds]
goliath has joined #osdev
gmacd has joined #osdev
gmacd has quit [Ping timeout: 268 seconds]
jimbzy has quit [Ping timeout: 268 seconds]
bliminse has quit [Quit: leaving]
xenos1984 has quit [Read error: Connection reset by peer]
Left_Turn has joined #osdev
gmacd has joined #osdev
gmacd has quit [Ping timeout: 240 seconds]
xenos1984 has joined #osdev
nur has joined #osdev
Turn_Left has joined #osdev
justache- has joined #osdev
justache has quit [Ping timeout: 268 seconds]
Left_Turn has quit [Ping timeout: 246 seconds]
dutch has quit [Quit: WeeChat 3.8]
dutch has joined #osdev
Left_Turn has joined #osdev
Turn_Left has quit [Ping timeout: 250 seconds]
gmacd has joined #osdev
Andrew is now known as Andrew_
gmacd has quit [Ping timeout: 240 seconds]
wlemuel has quit [Quit: The Lounge - https://thelounge.chat]
ehmry has joined #osdev
pog has joined #osdev
gmacd has joined #osdev
Jari-- has quit [Ping timeout: 256 seconds]
gmacd has quit [Ping timeout: 240 seconds]
gmacd has joined #osdev
gmacd has quit [Ping timeout: 268 seconds]
gmacd has joined #osdev
gmacd has quit [Ping timeout: 268 seconds]
<zid> GeDaMo: was it you who turned on the hot?
<zid> it's like 15C hotter today than yesterday
<mcrod> hi
<pog> hi
<mcrod> it is cold
<zid> no it is 27C
<zid> 28.6C now
<zid> Rising 1.6C/hr
<pog> it's 9°C
<zid> peak temp tends to be at.. 13:14 though, exactly now, weird
<mcrod> 15C here
<mcrod> not bad, but in my room it feels quite cold
<zid> yea 15C is either 'just right' or 'a bit cold' depending on clothes/computers
gmacd has joined #osdev
terminalpusher has quit [Ping timeout: 245 seconds]
gmacd has quit [Ping timeout: 240 seconds]
bliminse has joined #osdev
slidercrank has quit [Ping timeout: 248 seconds]
Ali_A has joined #osdev
Bonstra has quit [Quit: Pouf c'est tout !]
Ali_A has quit [Quit: Ping timeout (120 seconds)]
Bonstra has joined #osdev
<mcrod> ..help me understand this
<mcrod> why does CMake not allow you to reasonably set the linker without going through what looks like 20 different otions
<mcrod> options
<sakasama> Pain is weakness leaving the body.
<mcrod> apparently -DCMAKE_LINKER:STRING=lld isn't enough for it to magically figure out what it needs to do
<SerHack> Question: what does a kernel do to be define "linux-compliant" to get it booting on GRUB via `linux filename_my_kernel` ?
<SerHack> to be defined*
<mcrod> and why the fuck is #cmake always dead
<mcrod> heh
<zid> They don't wanna answer these questions either
<mcrod> I have no idea how people write large scale projects in CMake
<mcrod> virtually no one answers questions regarding it, other than CMake posts from the dark ages
<mcrod> https://cmake.org/pipermail/cmake/2014-August/058271.html <- In order to use the linker you want, you would have to define a custom
<mcrod> > CMAKE_CXX_LINK_EXECUTABLE that uses "<CMAKE_LINKER>" in its definition
<bslsk05> ​cmake.org: [CMake] how to really change CMake linker
<mcrod> except if you definitions by the command line, it will nuke the existing flags
<mcrod> if you modify*
wootehfoot has joined #osdev
moberg has quit [Remote host closed the connection]
<bl4ckb0ne> you have to set the -fuse-ld= flag
justache- is now known as justache
<SerHack> Does multiboot2 work for aarch64?
<mcrod> bl4ckb0ne: that's all well and good, but how do I do that without nuking the existing flags through the command line
gareppa has joined #osdev
<mcrod> because -DCMAKE_CXX_FLAGS:STRING="-fuse-lld" will kill the whole build
<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
heat has joined #osdev
heat has quit [Remote host closed the connection]
heat has joined #osdev
<bslsk05> ​elixir.bootlin.com: vmscan.c - mm/vmscan.c - Linux source code (v6.3.7) - Bootlin
<zid> what's up?
<zid> oh is me
<zid> heat: Sure you don't want a free cat?
<zid> someone has to feed it and I can't afford to
<heat> no i have 2 already sorry
<sakasama> Feeding it should be cheap. You need to dispose of all those corpses anyways.
<heat> mjg, i suspect im going to end up porting opendtrace
<heat> proper tracing is hard and when i look at opendtrace i just go https://i.kym-cdn.com/photos/images/newsfeed/001/893/386/cf7.jpg
<dzwdz> fun fact: the dash shell does floating point math when you run "echo $$"
<dzwdz> if you figure out why, you get a cookie
<zid> cus it's stupid
<zid> insert cookie.
<heat> oh, oh, i know why
<dzwdz> dammit now i have to make a cookie
<dzwdz> one sec
<heat> cuz it calculates total process times with floating point?
<dzwdz> nope
<dzwdz> why would it even do that in that context
<heat> i dont know
<dzwdz> that just should print the pid
<heat> <zid> cus it's stupid
<heat> srsly why
<dzwdz> to compute the maximum length that $$ can have, obviously
<zid> strlenf
<bslsk05> ​git.kernel.org: shell.h « src - dash/dash.git - DASH Shell
xenos1984 has quit [Ping timeout: 248 seconds]
<zid> oh is that.. log2
<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
<heat> it Just Works
<zid> ldmxcsr has a less snappy name
<GeDaMo> SIMD Floating-Point Exceptions Overflow, Underflow, Invalid, Precision, Denormal
<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
<dzwdz> https://ttm.sh/BwN.txt this is ps after a clean boot
<zid> heat: they're not in your area, they're in mine
<zid> the ad said so
xenos1984 has joined #osdev
rnicholl1 has joined #osdev
CommH has joined #osdev
rnicholl1 has quit [Quit: My laptop has gone to sleep.]
CommH has quit [Client Quit]
elastic_dog has quit [Ping timeout: 250 seconds]
elastic_dog has joined #osdev
<zid> ah, new cat did not understand cat biscuits, but ate them wet
heat has quit [Ping timeout: 240 seconds]
heat has joined #osdev
<zid> heat: I have named him (pending) jigsaw.
<GeDaMo> Did you have to assemble them? :|
<zid> No, he's missing pieces
<GeDaMo> Ah
<heat> aw :(
<zid> and heat won't even buy him any biscuits, terrible person
Arthuria has quit [Ping timeout: 250 seconds]
GeDaMo has quit [Quit: That's it, you people have stood in my way long enough! I'm going to clown college!]
<jjuran> No sense in throwing a whole life away, just because he's banged up a little
<zid> right, keep piling on the pressure jjuran
oac has joined #osdev
<sakasama> He looks sad. :(
<zid> because heat won't feed him
rnicholl1 has joined #osdev
rnicholl1 has quit [Client Quit]
weinholt has quit [Ping timeout: 248 seconds]
dutch has quit [Quit: WeeChat 3.8]
dutch has joined #osdev
slidercrank has quit [Ping timeout: 256 seconds]
weinholt has joined #osdev
<mcrod> hi
<zid> mcrod you need to guilt trip heat too, or offer to take his place as the tripee
<mcrod> heat feed the cat
<zid> A decision has been made.
terminalpusher has joined #osdev
heat has quit [Remote host closed the connection]
heat has joined #osdev
Brnocrist has quit [Ping timeout: 250 seconds]
<heat> mcrod, feed the cat you monster
rnicholl1 has joined #osdev
<heat> yay, ads on irc
<Ermine> They really should promote Onyx when it's released
<heat> so, never
rnicholl1 has quit [Quit: My laptop has gone to sleep.]
terminalpusher has quit [Remote host closed the connection]