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> fprintf(file, ", \"stack\": ["); vs fputc(',', file);
<heat> C is really high quality stuff
<kof123> "filled to the brim with debates" "i'm not quite sure how to articulate this into works [sic]" see freebsd faq or so re: bikeshedding
nyah has quit [Quit: leaving]
<zid> I 100% of the time have to look up which end the file goes on at some point in the file code of every project
eddof13 has joined #osdev
<zid> usually for fgets, apparently I just can't remember ever
<zid> if it's buf size nmemb file or the opposite
<heat> i'm pretty sure i regularly get size and nmemb wrong for calloc and fread/write
<zid> fread*
<mjg> meh!
<bslsk05> ​'Tuco uses the Infinity Stones in the MOST efficient way' by Alternative Cuts (00:00:48)
<bslsk05> ​lore.kernel.org: ksys_sync_helper
<mjg> lmao
<heat> what?
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Bitweasil has quit [Read error: Connection reset by peer]
Bitweasil has joined #osdev
eddof13 has joined #osdev
eddof13 has quit [Client Quit]
<linkdd> ok, I feel dumb. At some point, in my printk function, I have this declaration: `char num_buf[65] = {0};` (context: this is the buffer for itoa, lowest base is binary, so 64 digits + null character).
<zid> with you so far
<linkdd> My printk function in a C kernel: works fine. the same in C++ makes the vm crash (i have not yet dumped the vm's traceback)
<linkdd> char num_buf[65]; // fixes the issue
<linkdd> so the = {0}; in C++ have a different behavior than in C ??
<zid> No idea, I don't know C++, but there's a chance it ends up copying the zeros .data I guess, and that could defo be screwing things up if you're not expecting it, seems unlikely though
<zid> seems fairly debuggable though
<heat> i think = {0} is wrong in C++, yes
<heat> actually, no, seems to work
<linkdd> memset(num_buf, 0, 65); after the declaration works fine as well.
<heat> what's the codegen
<linkdd> if i put a `char foo[65] = {0};` at the very beginning of my entrypoint (kmain), it reproduces the bug
<bslsk05> ​godbolt.org: Compiler Explorer
<heat> whats the codegen
austincheney_ has joined #osdev
<linkdd> heat: let me check, i don't remember the command :P
<heat> gdb <kernel elf binary>; disassemble <symbol>
<zid> clang also identical codegen between C and C++
<zid> is it really different in C++?
<zid> I know they have like 400 extra meanings for = {0} though
austincheney has quit [Ping timeout: 260 seconds]
<linkdd> heat: yeah but i don't remember how to find the symbol (thank you c++ name mangling)
<heat> write the c++ symbol and it'll probably work
<heat> (no () though)
<heat> i.e disassemble printf
<heat> or disassemble log::myprintf
<linkdd> (gdb) disassemble klibc::io::printk
<linkdd> No type "io" within class or namespace "klibc".
<linkdd> (nested namespace)
<heat> do you have DWARF?
<heat> also: just nm your binary | grep printk
<heat> will probably give you correct-ish results
<heat> if in doubt, c++filt
<linkdd> ffffffff80000c20 T _ZN5klibc2io6printkEPKcz
<linkdd> ffffffff80000cc0 T _ZN5klibc2io7vprintkEPKcP13__va_list_tag
<linkdd> yeah, thank you c++ name mangling <3
<heat> first one
<linkdd> actually, second one, the first one just use cstdarg to call the second one
<bslsk05> ​bpa.st: View paste 3RFA
<zid> your kernel probably shouldn't be using avx
<zid> just throwing that out there
<zid> -mgeneral-regs-only
<zid> (although this looks like clang's output? gcc gave rep, clang gave avx, on godbolt)
<heat> there we go
<heat> thats the problem
<zid> does clang have m'general
<linkdd> so i should add this to those options: -march=x86-64 -mabi=sysv -mno-red-zone -mcmodel=kernel ?
<heat> this is SSE btw
<heat> -mgeneral-regs-only
<zid> avx is just sse 4.3
<heat> actually, no
<heat> mgeneral-regs-only will shit itself when it sees a float
<bslsk05> ​wiki.osdev.org: SSE - OSDev Wiki
<zid> good, floats are for suckers
<heat> want a fun annecdote? your beautiful C++ headers have a bunch of inlined functions that call the __builtin
<heat> so there are a bunch of floats there, even if you never call them
<heat> so -mgeneral-regs-only does not work
xenos1984 has quit [Read error: Connection reset by peer]
<zid> 'sse5 is now fma, avx and xsave', see
<zid> It's incestuous as always
<bslsk05> ​github.com: Onyx/kernel/arch/x86_64/make.config at master · heatd/Onyx · GitHub
<zid> heat: when -mgeneral-but-also-3dnow!
<heat> this mouthful linkdd
<linkdd> thx
<heat> you only need the -mno-{sse, avx, ...} stuff
<zid> heat why does your kernel have floats in it
<heat> <heat> want a fun annecdote? your beautiful C++ headers have a bunch of inlined functions that call the __builtin
<heat> <heat> so there are a bunch of floats there, even if you never call them
<zid> 'the __builtin'
<zid> the builtin what?
<heat> __builtin_<whatever standard float function>()
<zid> okay, and what's the problem?
<heat> -mgeneral-regs-only errors out at the sight of a float
<zid> even if it's parsed and then eliminated, before it tries to register allocate?
<heat> yep
<zid> sucks to be C++ then I guess
<zid> but we knew that already
<heat> which obviously does not work when the toolchain intercepts all your standard C includes
<linkdd> instead of passing -mno-sse etc... i can enable it in my kernel? i see there are some example code in the osdev wiki page
<heat> no
<heat> do not
<heat> FPU in the kernel is a bad idea for many reasons
<zid> you'll have to constantly xsave it on every single interrupt etc won't you
<linkdd> right
<heat> yep
<linkdd> ok
<linkdd> ok i shamelessly copied your CFLAGS, now it works
<heat> great
<linkdd> so the explanation, to make sure i understood, is that the compiler saw the opportunity to optimize the initialization of the array using SIMD instructions, which i have not enabled in my kernel startup code, is that correct?
<zid> std_abs.h:80:12: error: '__builtin_fabsl' requires 'long double' type support, but target 'x86_64-unknown-linux-gnu' does not support it
<zid> 80 | { return __builtin_fabsl(__x); }
<zid> heh, I tested it
<heat> linkdd, yes
<linkdd> does that also mean that if i don't enable those instructions, a program which targets my OS would not be able to use them?
<zid> You need to enable them globally, but give your kernel never changes the regs
<heat> yes, you'll want to enable them eventually for user code
<zid> they'll be fine through syscalls
<zid> given*
<zid> so you can basically just ignore them, unless you wanna zero them at process creation/teardown for SECURITY
<linkdd> ok, cool, another problem for future me (that guy is good, he'll take care of it)
<heat> you zero them manually when allocating the fpu state
<heat> set up some fpu regs you need and zero xmm/ymm/zmm etc while you're at it
<zid> Imagine needing some fpu regs
<zid> what are we, a C++ header
xenos1984 has joined #osdev
netbsduser` has quit [Ping timeout: 245 seconds]
wblue has quit [Quit: wblue]
Harriet has joined #osdev
Cindy has quit [Quit: ZNC 1.8.2 - https://znc.in]
TheCatCollective has quit [Quit: Meow Meow Meow Meow Meow Meow Meow Meow]
terminalpusher has quit [Ping timeout: 246 seconds]
TheCatCollective has joined #osdev
TheCatCollective has quit [Quit: Meow Meow Meow Meow Meow Meow Meow Meow]
TheCatCollective has joined #osdev
<mcrod> god damn
<mcrod> it'll be almost 5 years since terry davis has been gone
<mcrod> 4 days
TheCatCollective has quit [Remote host closed the connection]
<heat> 5 years or 4 days?
<mcrod> 4 days until 5 years
<mcrod> not going to lie, i'm one of those people who look up to him
<heat> wtf
<mcrod> why wtf
<heat> why would you
<mcrod> the dude was an absolute fucking crackpot through no fault of his own, plagued with a *deeply* debilitating psychiatric illness
<mcrod> and did a shit ton of complex stuff with bouts of incarceration and homelessness
<mcrod> he was particularly lucid when discussing computers, anything else was basically babbling
<mcrod> the shit that he pulled off while also believing the CIA/FBI is after you, probably living in fear on a regular every day basis, is impressive
<mcrod> *was after him
bnchs has joined #osdev
bnchs is now known as Cindy
Cindy has quit [Quit: ZNC 1.8.2 - https://znc.in]
Harriet has quit [Quit: Gender dysphoria]
smeso has quit [Quit: smeso]
TheCatCollective has joined #osdev
smeso has joined #osdev
vdamewood has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bnchs has joined #osdev
heat has quit [Ping timeout: 246 seconds]
duderonomy has quit [Remote host closed the connection]
Vercas has quit [Quit: buh bye]
Vercas has joined #osdev
Vercas has quit [Client Quit]
Vercas has joined #osdev
Vercas has quit [Client Quit]
Vercas has joined #osdev
Vercas has quit [Client Quit]
Vercas has joined #osdev
deflated8837 has quit [Ping timeout: 246 seconds]
[itchyjunk] has quit [Ping timeout: 250 seconds]
m3a has quit [Ping timeout: 246 seconds]
bgs has joined #osdev
deflated8837 has joined #osdev
TheCatCollective has quit [Quit: Meow Meow Meow Meow Meow Meow Meow Meow]
[itchyjunk] has joined #osdev
[_] has joined #osdev
[itchyjunk] has quit [Read error: Connection reset by peer]
bnchs has quit [Killed (NickServ (GHOST command used by bnchs__!~bnchs@user/bnchs))]
TheCatCollective has joined #osdev
Harriet has joined #osdev
Jari-- has quit [Ping timeout: 246 seconds]
duderonomy has joined #osdev
bliminse has quit [Quit: leaving]
bnchs has joined #osdev
zxrom has joined #osdev
DanielNechtan has joined #osdev
les_ has joined #osdev
wereii_ has joined #osdev
bgs has quit [Remote host closed the connection]
sebonirc has quit [*.net *.split]
moberg1 has quit [*.net *.split]
wereii has quit [*.net *.split]
les has quit [*.net *.split]
clever has quit [*.net *.split]
dennisschagt has quit [*.net *.split]
linkdd has quit [*.net *.split]
jeaye has quit [*.net *.split]
cheapie has quit [*.net *.split]
bombuzal has quit [*.net *.split]
jeaye has joined #osdev
moberg has joined #osdev
dennisschagt has joined #osdev
cheapie has joined #osdev
goliath has joined #osdev
[_] has quit [Read error: Connection reset by peer]
<geist> hmm, fiddling with this Nezha D1 riscv board. it's slooow
<geist> like almost so slow i wonder if it's somehow completely misconfigured
<mjg> :)
elastic_dog has quit [Ping timeout: 246 seconds]
sebonirc has joined #osdev
elastic_dog has joined #osdev
<geist> like, it's generally benchmarking approximately 200mhz arm i'd say
<mjg> cpu benching?
<geist> yeah, i't's almost like it's misconfigured
vinc has quit [Quit: Lost terminal]
<bslsk05> ​bugs.launchpad.net: Bug #2024935 “cpu 2.7x slower on ubuntu server 23.04 riscv64 Nez...” : Bugs : linux-allwinner package : Ubuntu
<geist> looks like running at 400mhz instead of 1Ghz
clever has joined #osdev
gildasio has quit [Remote host closed the connection]
gildasio has joined #osdev
awita has joined #osdev
bliminse has joined #osdev
<sham1> hi
<moon-child> yes
danilogondolfo has joined #osdev
heat has joined #osdev
linkdd has joined #osdev
Burgundy has joined #osdev
<ddevault> hrmph
<ddevault> WRITE DMA EXT hangs the port on my hardware, the command never finishes
<Mutabah> Not causing an error that you're not noticing/
<Mutabah> E.g. you didn't turn on the relevant interrupt
<ddevault> oh, I'm stupid
<ddevault> I didn't set the write flag on the fis
zxrom has quit [Quit: Leaving]
<ddevault> hm, well, I didn't set that flag, but that was not the issue it seems
GeDaMo has joined #osdev
thaumavorio has quit [Quit: ZNC 1.8.2 - https://znc.in]
thaumavorio has joined #osdev
gog has joined #osdev
gog has quit [Read error: Connection reset by peer]
<ddevault> cool I am getting some error details now
gog has joined #osdev
<ddevault> ...transient data integrity error?
<ddevault> handshake error?
<ddevault> found someone else with a similar issue and no resolution to their thread -_-
<bslsk05> ​xkcd - Wisdom of the Ancients
<GeDaMo> Bah! You beat me to it :P
<ddevault> short of it is that I have read dma ext working correctly
<ddevault> on real hardware
<ddevault> and write dma ext works fine on qemu, but not real hardware
gildasio has quit [Ping timeout: 240 seconds]
<ddevault> I just updated the command byte and set the write flag on the AHCI command list
<ddevault> no other changes
<ddevault> oh I also set the prefetchable flag, but it makes no difference
gildasio has joined #osdev
Left_Turn has joined #osdev
<gog> meow
<ddevault> ayy got it
<ddevault> now I'm surprised that read ever worked in the first place
<GeDaMo> Operation failed successfully :P
<Mutabah> Qemu? it can be pretty "nice" when you're doing things the wrong way
<Mutabah> I.e. it will accept incorrect hardware usage in some cases
<gog> mewo meow
<ddevault> yeah I run into that rather often
<ddevault> took me a couple of days to get AHCI working on qemu and a week to get it on real hardware
<gog> oops
<gog> i got lightly scolded for an unauthorized change to a spec
<gog> ¯\_(ツ)_/¯
phoooo has joined #osdev
<gog> i maintain i made it better
<phoooo> * says hi
* phoooo says hi
kof123 has quit [*.net *.split]
kof123 has joined #osdev
MiningMarsh has joined #osdev
rein-er has quit [*.net *.split]
lanodan has quit [*.net *.split]
danlarkin has quit [*.net *.split]
MaxLeiter has quit [*.net *.split]
kazinsal has quit [*.net *.split]
ggherdov has quit [*.net *.split]
dragestil has quit [*.net *.split]
Ameisen has quit [*.net *.split]
Amanieu has quit [*.net *.split]
XgF has quit [*.net *.split]
phoooo has quit [Ping timeout: 246 seconds]
<heat> ddevault, afaik write works backwards
<heat> you set write in the dma descriptor when you want the controller to write to the buffer you gave it
<ddevault> nah, it works forwards
<ddevault> got it working
<ddevault> now I have a read/write ext4 filesystem in my OS :D
<nortti> oh, nice. with working journaling and all?
<heat> well, your driver is wrong
<ddevault> lemme try to enable the journaling
<ddevault> heat: no, in this case you are wrong
<heat> list->desc_info = fis_len | ((req->flags & BIO_REQ_OP_MASK) == BIO_REQ_READ_OP ? AHCI_COMMAND_LIST_WRITE : 0);
<heat> tested on real hardware
<ddevault> I have read over the spec, checked multiple implementations, and tested on real hardware
<heat> and all the VMs
<mjg> GeDaMo: you laugh but i have a case of rust failing to fail succesfully
<ddevault> I think yours may just happen to work
<mjg> GeDaMo: runtime panics on a condition (expected), but then panics while panicking :d
<mjg> operation failed to fail
<mjg> in the expected manner
<ddevault> yes, journaling works
<ddevault> anyway, it's not particularly difficult to do ext4, I just used lwext4
<ddevault> heat: AHCI spec 1.3.1 page 48
<GeDaMo> Triple panic! :P
<ddevault> "Write (W): When set, indicates that the direction is a device write (data from system memory to device)"
<heat> ddevault, hmm, TIL, thanks, I'll fix that then
<ddevault> np
<heat> quite weird that nothing ever failed
ggherdov has joined #osdev
MaxLeiter has joined #osdev
lanodan has joined #osdev
danlarkin has joined #osdev
rein-er has joined #osdev
Ameisen has joined #osdev
dragestil has joined #osdev
kazinsal has joined #osdev
XgF has joined #osdev
Amanieu has joined #osdev
<ddevault> not sure all implementations make use of this bit
rein-er has quit [Max SendQ exceeded]
<ddevault> I don't think it's actually necessary to use the bit to implement a controller correctly
<heat> IDE i'm pretty sure is reversed in that regard
<heat> when starting DMA, you set WRITE for reads, READ for writes
<heat> I remember virtualbox asserted pretty agressively on that
<heat> qemu does not seem to even check it
rein-er has joined #osdev
<ddevault> yeah, it looks to be inverted on IDE from a shallow survey
bauen1 has quit [Ping timeout: 246 seconds]
Turn_Left has joined #osdev
Left_Turn has quit [Ping timeout: 246 seconds]
m3a has joined #osdev
netbsduser` has joined #osdev
<heat> mjg, hey hey hey new linux SLUB idea!
<heat> get this: instead of working with slabs directly, you get a sort of cache per cpu that you look at fir- what do you mean that's an old idea
<bslsk05> ​lore.kernel.org: [RFC v1 0/5] SLUB percpu array caches and maple tree nodes - Vlastimil Babka
<mjg> lol
<mjg> i had so many criticizing e-mails to write
<mjg> including one to linus himself
<mjg> i'm not even going to respond to this one
<mjg> s/had/have/
<heat> i asked on #mm
<mjg> spin lock protection is SLOW AF
Turn_Left has quit [Ping timeout: 260 seconds]
<heat> wait what happened with linus?
<mjg> he patched memset, memcpy and so on to not use rep mov/stos for small sizes
<heat> yes, i remember that
<mjg> as in utilize the existing scalar non-rep routines for them
<mjg> the problem is they don't do rep for bigger sizes
<mjg> so perf goes to shit for big bufs
<heat> https://lore.kernel.org/all/?q=guzik <-- best lore query ever
<bslsk05> ​lore.kernel.org: guzik - search results
<heat> >rep for bigger sizes
<heat> huh?
<mjg> he got a regression report for copy_to_user and fixed that, but memset and so on remain unfixed
<mjg> what
<heat> he patched memset, memcpy and so on to not use rep mov/stos for small sizes
<mjg> that's right
<heat> ^^this is good and makes sense
<mjg> yes
<heat> the problem is they don't do rep for bigger sizes
<mjg> it was done by just using routines which NEVER use rep
<mjg> that's right
<heat> but is it for *small* sizes?
<mjg> there is no problem for small sizes. there is a BIg problem for big sizes
<heat> i don't understand if this is __builtin_constant_p trickery or if he just switched everything to the shits
<mjg> mate
<mjg> the original code had ALTERNATIVE -- you either go to a routine which issues movs by hand *OR* use rep
<heat> link me the commit IDIO^W
<mjg> rep was used with ERMS and FSRS
<mjg> he removed ERMS from the equation -> you *never* use rep in these if you don't have FSRS
<bslsk05> ​git.kernel.org: memset_64.S « lib « x86 « arch - kernel/git/torvalds/linux.git - Linux kernel source tree
<mjg> i verified big sizes happen a lot in common code paths
<heat> i have read the file
<heat> show me commits
<mjg> git log on it mofo
<mjg> for example fork memsets the new kernel stack, 16KB
<heat> huh
<heat> bizarre
<mjg> brainfart i think
<mjg> i'm going to flame about it later
<mjg> i have like 2 other flames to write down for vfs
<heat> linus t and the t stands for testosterone
<mjg> one scolding them for halving fstat performance
Turn_Left has joined #osdev
<mjg> btw multi KB memcpy-s happen when doing real-world i/o
<bslsk05> ​dpaste.com <no title>
<mjg> the linuxen like to claim 64 byte cutoff for rep
<mjg> by that standard things are pretty bad
<mjg> (they are pretty bad anyway fwiw)
<heat> i do 512
<mjg> cause you benched on one cpu
<heat> i remember benching on other CPUs
<mjg> it is anywhere from 256-ish up
<heat> zen too IIRC
Turn_Left has quit [Remote host closed the connection]
Turn_Left has joined #osdev
<mjg> lemme restate, relatively modern
<mjg> not old f-worded yellers like MY HASWELL
m3a has quit [Ping timeout: 256 seconds]
Turn_Left has quit [Remote host closed the connection]
<bslsk05> ​Note by Dare Obasanjo: "A broken clock fixed by taping a working clock over it is a metaphor for every codebase you’ll encounter in your professional career as a software developer." https://media.mas.to/masto-public/media_attachments/files/110/850/691/236/020/960/original/3e304e9622ebc9bc.jpeg
Turn_Left has joined #osdev
<heat> you're the second person to send that shit in 20 minutes
zhiayang has quit [Quit: oof.]
<heat> congrats, you lost
<mjg> runner up is a great spot
<mjg> i take it
<mjg> congratulate the winner from me
<mjg> wait
<heat> it's vlastimil from SLAB
<mjg> 13:20 < heat> i asked on #mm
<mjg> what did you ask and (if anything) they said
<heat> you'll be able to congratulate him later when you write the flame email
<bslsk05> ​gist.github.com: gist:b02f0b76f39d799933d79d7103342a42 · GitHub
<mjg> 8A
* mjg <-- loser
<mjg> i don't think he answered what's up with new per-cpu caching though
<mjg> as in why not the existing one
<heat> the existing one is in slab.c
<mjg> i'm buggering off the subject
netbsduser` has quit [Ping timeout: 256 seconds]
<bslsk05> ​lore.kernel.org: [RFC v1 0/5] SLUB percpu array caches and maple tree nodes
<heat> now we wait
<mjg> this does not give safety in irq paths
<mjg> since preempt_* does not disable interrupts
<heat> yes but the OG patch does trylock
<heat> and if it fails, just skips the cache
<mjg> so it does work interrupts
<mjg> enabled
<heat> yes
<mjg> but your proposal does not
<heat> sure it does
<mjg> with teh assumption that code runningfrom irqs is supposed to be able to use it
<heat> you'd just if (READ_ONCE(accessing) == 0) { ...
<mjg> no
<mjg> oh in that sense, sure, it's an atomic-less trylock
<mjg> you did not mention this bit
<mjg> anyway both ideas suck as they bypass the caching
<heat> no
<mjg> .. if "trylock" fails
<heat> they're good as they're able to provide a common fastpath
<mjg> the *current* per-cpu stuff works does not have the problem, but has a different one: utterly slow single-threaded
<mjg> interestingly still faster than what theg uy posted
<mjg> but slower than yours
<heat> if you can't yank out hardirq memory allocation you might as well provide a common fast path
<mjg> yours would be pretty good *if* there were no interrupt fuckers to eal with
<mjg> ye i'm saying it should be possible to make it work regardless
<mjg> with a lot of hackery tho
<mjg> actually you gonna need compiler barriers after and before write_once
<mjg> after the first and before the second
<mjg> i have vague recollection i told you that last time around
<heat> WRITE_ONCE has a compiler barrier implicit doesn't it?
stolen has joined #osdev
<heat> it's a volatile store, you can't re-order volatile stores
<heat> i think
<mjg> i don't know if you can reorder volatile vs other volatile, i have conflicting recollection on the matter
<mjg> in therms of codegen
<mjg> however, you can defo reorder volatile vs non-volatile
<mjg> and that is what you are dealing with
<heat> oh ew i see
<heat> this is cursed isn't it
<heat> fwiw msvc has ACQUIRE and RELEASE semantics on volatile loads and stores
<heat> big up msvc, superior compiler
<mjg> look mate, you can totally have atomic-less fast path which beats the shit of what he proposed
<heat> https://gcc.gnu.org/onlinedocs/gcc/Volatiles.html gcc tells you to fuck off
<bslsk05> ​gcc.gnu.org: Volatiles (Using the GNU Compiler Collection (GCC))
<heat> yes, i know
<mjg> but i'm saying the entire idea of merely trying to alloc is crap
<heat> my proposal is close to correctness
<heat> it's crap but it is what it is?
<mjg> i already considered it when tinkering myself vs per-cpu
<heat> unless you want to local_irq_save() and restore
<mjg> well look mate, i don't have it all mapped out, but i think it will be possible to make it work without fukcing with interrupts
<mjg> nor cmpxchg
<heat> what's your idea?
<mjg> fundamental concept boils down to rseq- like behavior in presence ofi nterrupts
<mjg> i can detect alloc/free was already in progress, *finish* it for the interrupted codepath
<mjg> and then do my own
<mjg> and redirect their IP to a known spot which assumes it worked
<mjg> if there is no memory, go to a spot which assumes it failed
<mjg> gotta hack it with some asm to make sure registers line up 'n shit
<heat> oh ew
<heat> that's a nasty idea pal
<mjg> brah
<mjg> i can probably do it better after i sleep on it
<mjg> but it is *doable*
<mjg> i'm gonna push out my current flames first, then i'll really think about it
<heat> it's doable
<heat> but nasty
<mjg> also believe it or not i have my dayjob 8S
<heat> having a dayjob is a boomer moment
<mjg> heat: execute this command: /nick freeloader
<mjg> thank
<heat> wish i fucking lived in poland
<heat> i'd just leech and live off your taxes
<Ermine> I think this isn't the most pleasant place to live
<mjg> it is the most peasant place to live tho
<heat> what isn't?
<heat> poland is a utopia
<heat> you have so many beautiful city names like Bydgoszcz
<mjg> Chrząszczy-Rzewoszyce
<mjg> oh, it is even better
<Ermine> Iceland is fun
<mjg> Chrząszczy-żewoszyce
<Ermine> and how do you read those diacritics
<mjg> you don't, it's a pratical joke played on foreigners
<mjg> all slaves are in on it
<mjg> slavs
<bslsk05> ​i.imgur.com <no title>
<heat> yeah gosh darn slave-uh i mean slavs
<Ermine> o_O
benlyn has quit [Ping timeout: 244 seconds]
lg has joined #osdev
netbsduser` has joined #osdev
<heat> mjg, can you do page LRU without a big global lock?
<mjg> yes and no
<mjg> what you *can* do is BATCH a bunch of pages for requeue
<mjg> so that contention is lessened big time
<mjg> however, LRU is the cop out mechanism to begin with
<mjg> "just slap in something plausibly better than FIFO"
<Ermine> I have feeling that everybody uses LRU
<mjg> nope
<sham1> LRU is good
<Ermine> mjg: who doesn't?
<mjg> Z-fucking-S for example
<mjg> (arc)
<mjg> also check out things like clock, tinylfu and others
<mjg> every single algo claims to beat the rest
<mjg> sham1: so one classic anti-LRU is its lack of scan resistance
<Ermine> There are many algorithms described in Tanenbaum's book
<mjg> i have not read it, i don't trust the guy
<mjg> may happen to be decent
<mjg> but given the age of the book there is utter disregard for smp, so...
<netbsduser`> Ermine: i am working to migrate to wsclock
<Ermine> mjg: hm, iirc there's a chapter on smp in 4th edition
<Ermine> netbsduser`: cool!
<mjg> i'm sure it discusses smp issues for somethingl ike lru
bauen1 has joined #osdev
<heat> linux uses MGLRU now, tho
<Ermine> ... which ends in LRU
<Ermine> Btw I haven't tested it under memory pressure yet
<heat> but it's quite more complex than "haha list go brr"
<zid> wait, list does NOT go brr!?
<zid> :(
<netbsduser`> i hope mglru is an improvement over their previous state of affairs
<netbsduser`> linux performance under vm pressure i found to be despicable
gorgonical has quit [Ping timeout: 260 seconds]
<Ermine> I once run my monte-carlo simulation with large amount of paths and small step size and graphics hung
<Ermine> Also I tried to decompress nvidia leaked source with the same result
<netbsduser`> i tried to build something big, might've been LLVM, on a linux box, and it ground to a near halt
<netbsduser`> graphics was unusable, i was able to rescue the laptop by switching to console, logging in (took 5 minutes or so), and killall -9'ing the needful
<Ermine> I have just reset my box
<nortti> did you have swap set up? I've only ever seen that behaviour on swapless systems
<Ermine> Yes
<heat> yep, swapping doesn't make a difference
gog has quit [Ping timeout: 256 seconds]
<Ermine> gog got swapped out
zhiayang has joined #osdev
bnchs is now known as Cindy
MiningMarsh has quit [Ping timeout: 256 seconds]
MiningMarsh has joined #osdev
vdamewood has joined #osdev
<ddevault> ares is going really well :3
xenos1984 has quit [Read error: Connection reset by peer]
<ddevault> I think I can install it on my laptop within the month, perhaps dual-boot with linux
joe9 has joined #osdev
xenos1984 has joined #osdev
<Ermine> Great job!
<heat> thats dope
<heat> mjg, fyi if you want a bench comparing cmpxchg vs locked cmpxchg vs READ/WRITE_ONCE: https://gist.github.com/heatd/49c9be23ccb1f4ad8dfeac231da2647a
<bslsk05> ​gist.github.com: bench-cmpxchg.cpp · GitHub
<heat> READ/WRITE_ONCE is about 5x faster than cmpxchg and 10x faster than lock cmpxchg
<heat> in my hw
Turn_Left has quit [Ping timeout: 260 seconds]
<bslsk05> ​www.reddit.com: Reddit - Dive into anything
bauen1 has quit [Ping timeout: 260 seconds]
knusbaum has quit [Max SendQ exceeded]
Turn_Left has joined #osdev
SGautam has joined #osdev
knusbaum has joined #osdev
<SGautam> 0xC2 0xA9 is the copyright sign but why is FreeType returning me some Japanese character? https://usercontent.irccloud-cdn.com/file/bDPCHDph/image.png
<SGautam> I'm turning 0xC2 0xA9 -> 0xC2A9 and passing it to freetype in FT_Get_Char_Index()
<heat> is this utf8? 0xC2 0xA9 isnt 0xC2A9
<SGautam> Yeah
<SGautam> Why..not?
<netbsduser`> nortti: it was with sufficient swap
<heat> because that's not how utf8 works SGautam
<netbsduser`> linux page replacement was violently evicting the working set of essential processes like xorg, i presume
<SGautam> Yeah, I did read that page.
<heat> right
<heat> so where's the question?
<heat> you can't just append bytes until you get a codepoint, that's not how utf8 is encoded
<FireFly> I mean presumably you're lookin gup codepoint 0xC2A9
<bslsk05> ​www.compart.com: “슩” U+C2A9 Hangul Syllable Seunj Unicode Character
goliath has quit [Quit: SIGSEGV]
<FireFly> SGautam: you'll have to decode the UTF-8 into a stream of codepoints and look those up
<FireFly> or well, render those
<SGautam> Okay, well I was stupid to think it was this simple.
<FireFly> UTF-8 isn't too bad to decode
<SGautam> Ah
<SGautam> I must strip those leading bits
<GeDaMo> C2 A9 -> 1100 0010 1010 1001
<GeDaMo> 0 0010 10 1001 -> 000 1010 1001 -> A9
<FireFly> right, you wanna mask out and shift the bits into place since the bits making up the codepoint are essentially the "payload", the rest is just framing/encoding it in a nice way
<FireFly> (with some useful properties like being able to do random seeking and then find a codepoint boundary)
<FireFly> or recovering in case of corruption
<GeDaMo> The high bits on the first byte tell you how many bytes there are
<SGautam> Yeah I noticed that
<jimbzy> Yay. My computer parts shipped.
dutch has quit [Quit: WeeChat 4.0.2]
m3a has joined #osdev
<jimbzy> I haven't decided what I'm going to do with 16kb of ROM and 32kb of RAM, but it's going to be fun!
<SGautam> thanks guys for keeping up with my shenanigans
dutch has joined #osdev
<zid> cute
<heat> ok now do right-to-left text
<heat> only then will you have my undying respect
<zid> when is trinitron technology
<GeDaMo> "The Gray-1, a homebrew CPU exclusively composed of memory" https://web.archive.org/web/20170205053755/http://2x-1.net/ob/gray1/
<bslsk05> ​web.archive.org: The Gray-1, a homebrew CPU exclusively composed of memory – Unusual projects
<zid> cray + grey goo?
<jimbzy> I'm not that ambitious, so I'll stick to the 6502. :p
<SGautam> heat: Let's skip that
<SGautam> I'm lowkey proud of my UTF-8 handling coz it implements an LRU cache for the glyphs lol.
<SGautam> although i'm guessing its standard protocol since it was suggested to me here
<mjg> heat: i don't need a bench mate, this sis liek common knowledge
<mjg> heat: apart from people who don't do smp
<zid> Now render them with raymarching
<heat> >lru cache
<heat> full circle baybee
<heat> mjg, sure, it's "common knowledge", but now I have numbas
<heat> also no cmpxchg being slow is not common knowledge
gog has joined #osdev
<zid> why would it ever not be slow
<heat> because without the lock prefix it's functionally equivalent to if (a == b) a = c; in a single instruction
<heat> but it turns out the instruction for LITERALLY DOING THIS OPERATION is 5x slower than handcoding it
<zid> maybe splitting it improves the scheduling and thus latency
<zid> read; some stuff; writeback
<zid> and the xchg can't be split
<Ermine> gog: may I pet you
phoooo has joined #osdev
phoooo has quit [Client Quit]
Left_Turn has joined #osdev
goliath has joined #osdev
Turn_Left has quit [Ping timeout: 246 seconds]
bgs has joined #osdev
zxrom has joined #osdev
<jimbzy> Ermine, Gotta watch that. Next thing you know she'll be knocking everything off your desk.
<gog> hi
<gog> yes you may pet me
<gog> i'm having a tough day
eddof13 has joined #osdev
bauen1 has joined #osdev
<jimbzy> Sorry to hear that, and I hope things get more gooder.
<gog> thanks <3
Turn_Left has joined #osdev
Harriet has quit [Quit: WeeChat 4.0.2]
Harriet has joined #osdev
Left_Turn has quit [Ping timeout: 246 seconds]
<mjg> heat: 16:48 < mjg> heat: apart from people who don't do smp
<mjg> heat: there is a bunch of multicore 101; atomic and related ops being expensive af is part of it
<mjg> your bench is downplaying the real cost
<mjg> majority of the cost comes from fucked store buffer
<mjg> you don't accumulate much state if you just atomic op in a loop
Harriet_ has joined #osdev
Harriet has quit [Killed (palladium.libera.chat (Nickname regained by services))]
Harriet_ is now known as Harriet
Harriet has quit [Client Quit]
Harriet has joined #osdev
antranigv_ has joined #osdev
antranigv has quit [Ping timeout: 240 seconds]
* Ermine pets gog
* mjg pets heat
* gog prr
<mjg> can i get a pack on the back
<Ermine> gog: iirc you did some website with blazor?
phoooo has joined #osdev
xenos1984 has quit [Ping timeout: 246 seconds]
xenos1984 has joined #osdev
<gog> Ermine: no it's something i want to look at as an alternative to react
dutch has quit [Quit: WeeChat 4.0.2]
vdamewood has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dutch has joined #osdev
danilogondolfo has quit [Quit: Leaving]
phoooo has quit [Ping timeout: 246 seconds]
netbsduser` has quit [Remote host closed the connection]
netbsduser` has joined #osdev
bauen1 has quit [Ping timeout: 260 seconds]
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<moon-child> mjg: wer arm
<bslsk05> ​www.theregister.com: Who has over half all Arm server CPUs in the world? Amazon • The Register
gog has quit [Quit: Konversation terminated!]
<Ermine> Somewhy I'm not surprised
<moon-child> mjg: best I can do is a gingerly tap on the shoulder
<mjg> no thanks, i kissed a girl *ONCE*
<Cindy> i never kissed someone
<Cindy> i'm too scared to even touch someone
eddof13 has joined #osdev
xenos1984 has quit [Ping timeout: 240 seconds]
antranigv_ is now known as antranigv
SGautam has quit [Quit: Connection closed for inactivity]
antranigv is now known as antranigv_
antranigv_ is now known as antranigv
gog has joined #osdev
xenos1984 has joined #osdev
<moon-child> gog: why are you in lowercase now ;-;
<gog> wdym
<moon-child> gog (~Ada@user/gog) has quit (Quit: Konversation terminated!)
<moon-child> gog (~ada@user/gog) has joined #osdev
<gog> oh
<gog> my ident on windows is capitalized and i never bothered to fix it
<Ermine> Expectable on Windows
bauen1 has joined #osdev
goliath has quit [Quit: SIGSEGV]
<sham1> It's case-insensitive
<Ermine> But Their APIs Are All Capitalized
<Ermine> Win32, C#, EFI
gareppa has joined #osdev
dutch has quit [Quit: WeeChat 4.0.2]
<Ermine> AND FAT LIKES CAPS
<zid> ALL CAPS ARE PIGS
<gog> C# C# C#
<gog> CEEE SHARP
<heat> mjg, btw i have no way to test the atomic store stuff or whatever, short of patching the patch myself
<heat> which is an /idea/ but requires effort
<heat> vlastimil talked about maybe needing spinlocks for remote drain anyway
<heat> and PREEMPT_RT needs em as well, can't disable preemption there
sortie has quit [Quit: Leaving]
<jimbzy> I like C#
<heat> i dont c# i need glases
<heat> hahahahah ha ah ahhaha ha ha ah ahha haha ha
melonai has joined #osdev
<jimbzy> It's just c++++
<netbsduser`> on linux adding per-cpu caches to its allocator: i thought it would already have done so
<netbsduser`> bonwick and adams describe it in their vmem paper from 2002
<mjg> it *was* done so
<mjg> WAY BACK
<mjg> which maeks the above proposal a wtf
<heat> netbsduser`, complex question
<netbsduser`> all the five BSDs also have similar and i think the lineage of each traces directly back to the paper of Bonwick himself
<heat> their slab allocators have had pcpu allocation since forever
<heat> SLAB has a magazine-like pcpu cache (like discussed in the patch set i linked, for SLUB)
<netbsduser`> especially in this age of numa (numa iei) it's valuable
<heat> SLUB ditched all the queuing SLAB had, because hurr durr it's bad, so it keeps a slab as a percpu thing plus optionally (KConfig) a pcpu partial slab list
<heat> aw fuck thats a great pun
<heat> citing dragostea din tei is always a big win in my book
<mjg> it predates you
<heat> no it doesn't
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<sham1> heat: C# is quite funny, yea
MiningMa- has joined #osdev
MiningMarsh has quit [Ping timeout: 246 seconds]
MiningMa- is now known as MiningMarsh
eddof13 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!]
vdamewood has joined #osdev
SGautam has joined #osdev
<zid> I went outside today, didn't see any grass though thankfully, my touchgrassginity remains intact
<bslsk05> ​gist.github.com: Flint Specification 0.0.1 · GitHub
<heat> i dont get it
<zid> I also don't get it
<SGautam> hm
<kazinsal> I would just use excel, OP
<SGautam> It's just supposed to be a little language to modify a CSV dynamically.
<zid> I'd use GOOGLE SHEETS because WEB 3.0 IS THE ONLY OPERATING SYSTEM WORTH USING
<zid> ah yea that sounds cool I suppose
<sham1> GNU Octave
<zid> I thought it just read from them and made graphs, and I'm like, that's gnuplot
* sham1 gags from reading zid's pitch for web3
<zid> I win
gareppa has quit [Quit: WeeChat 3.8]
<heat> i use google shits because i am the shit
<heat> and i have the shits please help
<sham1> Also Google Sheets is Web 2. It's not web3. Doesn't even use a crypto~~scam~~currency. smh
<zid> YET
<heat> does web3 even use the linux kernel?
<zid> also, google is heavily invested into ruining all their products with ML, that will be the true web 3.0
<heat> no? not interested
<zid> where nothing works and nothing is true
<sham1> heat: on average? Yes, it's using Linux
<heat> no its not
<sham1> Either that or a weird hybrid of Mach and BSDs
<sham1> (Android and iOS)
<heat> linux ekrnal
<heat> kernal of opeartng of systme
<sham1> kernal? This ain't no Commodore 64
<sham1> Although an Amiga might work
<heat> hello amigo
<sham1> The explicitly female computer
<heat> women are cool
<heat> +1 to women
<sham1> yes
<zid> idk if computers are women
<zid> I've never wanted a computer to sit on my head
<heat> women don't use IRC though
<sham1> Well Amigas certainly are
* zid drops an amiga on sham1's face
<zid> enjoy
<sham1> nice
<heat> i dont want anyone to sit on my head
<sham1> Honestly I'd just take that trade just so I could have an Amiga
<heat> that seems unpleasant
<zid> heat: Imagine it was a footballer's thighs gently massaging you to sleep
<heat> no
<zid> no need to imagine, that's your IRC posture?
<heat> have you seen female footballers' thighs though?
<heat> death by fucking snu snu
<zid> I neer said male
<zid> you thought it
<heat> i did
<heat> that was wrong of me and i apologize
<zid> I think you need to have a long hard look at yourself, then marry a man.
<SGautam> Lads how do I even begin writing a compiler. I've wanted to do this for over 8 years now but I feel confident but still unsure.
<geist> wait, weren't you trying to write an OS?
<geist> and an excel clone a few minutes ago?
<bslsk05> ​eli.thegreenplace.net: Parsing expressions by precedence climbing - Eli Bendersky's website
<zid> now I can write compilers
<SGautam> I need to compile the language for the excel clone eventually tho, geist
<geist> ...
<zid> I knew what needed to happen but not how specifically a decent way to solve the issue this solves was
<SGautam> To some abstract representation at least.
<heat> you're all over the place SGautam
<SGautam> Like a bytecode.
<zid> me too
<zid> I half write LOTS of projects, sue me
<heat> pick something and *focus* on that
<heat> or don't, it's your life
<zid> disgusting behaviour, heat
<SGautam> I'm focusing on the excel clone, yeah, I'm thinking of how to parse and interpret the language I just designed in 5 minutes trying to be as reasonable as possible while not making it look like Forth.
<geist> if it's an excel clone doesnt that pretty much dictate the language?
<zid> he means 'spreadsheet program'
<zid> rather than direct clone of excel
<zid> TABULAR DATA PROCESSOR.elf
<geist> i suppose that's true
<SGautam> Sorry, I really shouldn't use the term "excel clone", more like a spreadsheet program where every sheet has a script attached to it.
<heat> microshit winblows officrap eshitcel
<geist> been a while since i have thought of 'excel' as the defacto spreadsheet
<geist> but that's because i mostly end up using either google sheets or the mac one just because that's what i have in front of me
<sham1> heat: micro$hit
<SGautam> Google Sheets is really good now
<SGautam> I stopped using Excel coz my uni subscription expired
<zid> I've never used excel on anything but an office computer that wasn't my own
<geist> hmm, did they ever port excel to mac classic...
<geist> that would be a fun experience
<sham1> Excel is the most frequently used database software
<zid> I had open office installed for a bit before google sheets became a thing
* sham1 runs
<SGautam> Are any of you guys into retro computing? I kind of expect osdev to be retro PC enthusiasts
<heat> ITAAAAAAAAANIUUUUUUUUUUUUUUUUUUUUUUUM
<heat> is itanium retro yet
<gog> RUST ITANIUM
<gog> yes
<gog> well
<geist> i am yes
<gog> maybe
<heat> ROST
<SGautam> IA64?
<heat> yes
<heat> (IA128 in the future)
<gog> the legendary microarch that was cool and everybody liked
<geist> that's why i was just thinking huh it'd be fun to dig up an old version of excel for my mac SE
<heat> gog, it's NOT a microarchitecture gog wtf
<SGautam> Wait why do I have this feeling that there are many packages suffixed with ia64 instead of x86_64 even though they mean x86_64?
<gog> i mean ISA
<heat> get your terminology straight
<gog> i don't get anything straight ok
<heat> get your terminology gay
<SGautam> I've seen ia64 suffixes a lot of times.
<geist> oh huh interesting, actually excel 1 was released for macintosh *firsT*
<geist> then 2.0 was released for windows as windows was developed
<zid> heat: x86s's correct terminology name is "Itanium 3" don't foret
<SGautam> Yah cuz I think Windows copied Mac's UI
<zid> forget*
<heat> you mean winblows
<geist> re: ia64 being misused, i haven't seen that at least
<geist> most folks just dont know about ia64 the moniker
<bslsk05> ​gcc.gnu.org: Intel AVX10.1 Compiler Design and Support
<heat> it's rolling baybeeeeeee
<SGautam> Just the other day I was thinking how software has kind of completely changed my way of thinking w/ English words.
<zid> 10.2 already planned, heh
<SGautam> On seeing Windows, I'm no longer reminded of a rectangular opening in the wall with glass panes but the Windows operating system.
<zid> homo words in english are nothing new (or language in general)
<SGautam> Same for "terminal".
<SGautam> I wonder how that came to be
<heat> sir you have terminal cancer
<heat> haha terminal ttys haha
<SGautam> I'm guessing the word was used to describe an end point of a connection.
<zid> If someone says 'seed' I very rarely thing 'lose territory in a war'
<geist> hmm, qemu v8.0.4 is released
<zid> SGautam: You wound me.
<zid> (around a tree, it hurt)
<SGautam> Is that supposed to be pronounced like "round" except r->w?
<zid> yes
<zid> except also no
<SGautam> Huh, interesting word
<zid> there's also woond, to cause injury to
<SGautam> Yea
<zid> English has a word that has 430 definitions btw
<SGautam> I'm guessing the former is now archaic
<zid> nope, just completely different meanings
<heat> geist, anything interesting or just bugfixes?
<geist> i was just thinking that while driving yesterday: i wonder what english word has the largest number of homonyms
<geist> heat: a fair amount, but mostly bugfixes. it's in the dotfix branch
<zid> fine -> good / monetary penalty, mortar -> device for grinding / portable artillery, nail -> part of finger, wood fastener, etc
<geist> v8.1 is in RC
<zid> english loves homographs
<zid> geist: those are known as 'multinyms'
<zid> liar, lier, lyre
<zid> bi, buy, by, bye
<zid> cite, cyte, sight, site is a good set
* geist nods
<heat> linux, linuks, leenux, leenuks
<zid> Any guesses as to what the word with 430 definitions is?
<geist> though if considering pronounciation, then it also gts complicated because it may depend on dialect of the speaker
<zid> very
<zid> it means you can cheat though and say some things have 10 nyms if you allow mixed accents :P
<bslsk05> ​www.marlodge.net: John Higgins's silent alphabet
<zid> set -> put/lay/stance/adjust/harden/move below the horizon/a collection/dispoition/television/hairstyling/fixed/...
<zid> (400 more results)
<geist> yeah figured it would be something like that, or be
<geist> or is
<zid> does is have more than one even?
<kof123> see also: différance is a French term coined by Jacques Derrida.
<zid> It has the most fucked up conjugation in english at least probably
<geist> i also tend to pronounce 'sit' as set too, something i had worked on to change over time
<zid> pin/pet merger
<geist> to make it even worse
<geist> yah
<zid> The map of that is interesting
<zid> are you don != dawn?
<zid> they have significant overlap but it isn't total
<geist> in speech i'd probably say it the same, but if reading it i might try to make a slight difference
<zid> wee you have contradictory geographical ideolectical characteristics
<zid> that's a good set of words right there
<geist> i tried to fix the pin/pet merger in my speech onc ei moved to seattle, so i can match Fred Armisens accent bit
<bslsk05> ​'Fred Armisen Does Every North American Accent | Standup For Drummers | Netflix Is A Joke' by Netflix Is A Joke (00:05:57)
<zid> (don/dawn merger is northwest, pin/pen merger is south east, having both isn't normal)
<zid> I found an amazing UK linguist recently
<zid> He knows a bunch of languages and is ridiculously good at UK accents
<zid> I think he's a language coach in terms of his income, but he makes neat youtube videos
<geist> yeah, there's an anglish professor that does these interesting vids every once in a while on accents and whatnot
<bslsk05> ​'Hilarious English Accent Spoof Pharma Ad' by Dave Huxtable (00:06:01)
<geist> there's of course 10k of these, but still
vdamewood has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<geist> anyway enough fartin around. need to do some unit of work for the man
<geist> one tick of the galactic game engine, produce 1unit of work from N units of input
<heat> as a local scholar once said
<heat> <sham1> fart fart far
<heat> t
<geist> word.
CaCode has joined #osdev
dutch has joined #osdev
jimbzy has quit [Ping timeout: 245 seconds]
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mhall has quit [Quit: Connection closed for inactivity]
zxrom has quit [Quit: Leaving]
jimbzy has joined #osdev
<bslsk05> ​comsec.ethz.ch: Inception: how a simple XOR can cause a Microarchitectural Stack Overflow - Computer Security Group
<Ermine> Argh, yet another attack???
<nortti> Ermine: well guess what, https://downfall.page/
<bslsk05> ​downfall.page: Downfall
<Ermine> nortti: this one was posted in another channel
<bslsk05> ​git.kernel.org: kernel/git/torvalds/linux.git - Linux kernel source tree
<heat> x86/bugs: Increase the x86 bugs vector size to two u32s
<heat> fucking hilarious
<nortti> :D:
<zid> Top tip, cpus with speculation are not secure in multiuser configs
<zid> stop trying, guys
<Ermine> I've got the same feeling tbh
<nortti> honestly a bit surprised there's not been a push to just fully clear microarchitectural state on context switches. guess modern caches etc are so big that they'll still have some of your data next time your process gets to execute
<moon-child> the cost of context switches is already high enough ..
<nortti> and/or clearing the state is costly
<moon-child> https://cseweb.ucsd.edu/~tullsen/halfandhalf.pdf I think this would protect against that particular attack
<moon-child> but I agree with zid
<heat> so what's the strategy? no multiuser systems no more?
<zid> who needs em
<zid> computing hw is cheap
<zid> kick users off between switching customer if you're doing hw pools
<nortti> heat: does itanium speculate?
<nortti> ah, I guess it probably does, because branch predictor
<Griwes> yes, it speculates that it is a useful architecture
<Ermine> But really, are those vulnerabilities inevitable?
<moon-child> nortti: I am pretty sure it does not
<heat> itaniuuuuuuuuuuuuuuuuuuuuuuuuuuuuum
<kof123> obviously the compiler/programmer does the "speculation" j/k
<moon-child> Ermine: by definition, there will always be side channel attacks. Having applications share as much as they do when they run on shared hardware just gives you a lot more opportunities to exploit some such
<moon-child> but I can still steal your ssh key by shining a laser at your window to catch harddrive vibrations, so
<Ermine> It's on ssd lololololol
<heat> >non-free
<heat> RMS is crying, cheers
<zid> to be fair, every hotlink of anything is piracy
<moon-child> hey technically I donated like $3 to wikipedia at some point a long time ago
<Ermine> heat: RMS is being trolled by this nonfree trollface
<moon-child> so
<moon-child> ya know
<zid> moon-child is a partial owner of wikipedia
<zid> ergo it's all under licence to moon-child
<moon-child> yes
<zid> needs to pay himself royalties though
<moon-child> if you ever link to anything on wikipedia you have to pay me
<Ermine> Also my cat would detect your laser
<Ermine> I'm super secure
<zid> my cat detects very high power lasers pretty well
<zid> the fur starts to smoke
<heat> the best way to get someone's password is to just ask them for it
<moon-child> hey heat
<moon-child> what's ur passwort
<Ermine> That's why I don't know my passwords
<heat> kernallover69
<bl4ckb0ne> hunter3
vdamewood has joined #osdev
awita has quit [Remote host closed the connection]
eddof13 has joined #osdev
[itchyjunk] has joined #osdev
stolen has quit [Quit: Connection closed for inactivity]
heat has quit [Remote host closed the connection]
heat has joined #osdev
austincheney_ has quit [Ping timeout: 260 seconds]
Turn_Left has quit [Read error: Connection reset by peer]
<linkdd> i'm using limine as a bootloader, more specifically the SMP request to detect the bootstrap processor and application processors. limine gives me their lapic_id and processor_id. I saw that both those ids seem to be 0<id<cpu_count, is that a guarantee or is it just a coincidence in qemu?
austincheney has joined #osdev
vdamewood has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<mcrod> hi
SGautam has quit [Quit: Connection closed for inactivity]
<geist> linkdd: that's a coincidence
<geist> apic ids are not guaranteed to be compact, they can and do have gaps in them in real hardware
<mcrod> another day, another compiler bug
<geist> i think the only thing that's really guaranteed (though i can't tell you where it's written down) is the boot cpu is apic id 0
<linkdd> ok, so i won't use them as index lol
<linkdd> thx
<linkdd> a simple O(n) search through the array will do the trick
<linkdd> i don't expect a computer to have millions of CPUs anyway
<geist> yeah in general thats why logical cpus numbers are all you need
<geist> in practice i've found that logical cpu -> physical id (apic on x86) is a far more common search, and you can yourself make sure the logical id is compact and based at 0
<geist> because that's your numbering
<geist> it's fairly rare to go from physical -> logical, so if it happens to be O(n) then so be it
<geist> and when i say 'logical id' i just mean 'whatever numbering convention your OS uses' which is almost always 0...N-1 where N is the number of known cpus
<linkdd> well, that's because i can read the apic registry to get the physical id of the currently running cpu, which allows me to search the array of "cpu_locals" (which contains the cpu-dependent data, like the virtual memory page map, etc...)
<linkdd> this is a very dumb way to do this, i remember heat talking about mapping the same virtual address to different physical address for each cpu
<geist> right, but there's a better way to do that. on x86 the defacto solution that virtually all OSes do is use the gs: segment to point at a per cpu structure
<linkdd> but i'm not there yet
<geist> and every other arch has some sort of similar 'register/mechanism per cpu to point to a local cpu structure'
<linkdd> geist: as in, store the lapic_id (32 bits) in the gs registry?
<klange> x18 my beloved
<geist> linkdd: as in use the gs: segment to point at it, such that you can reference it via gs:offset
<geist> and you can put a pointer to the strcture itself in slot 0 if you want, for example
<geist> such that gs:0 -> pointer to structure
dutch has quit [Quit: WeeChat 4.0.2]
<geist> and then have a per cpu structure wher eyou can anchor all this stuff on
<geist> on x86-32 this would e via a regular segment, on x86-64 this is why there's a whole MSR for it, and swapgs the instruction exists, etc
<linkdd> right, i think my dumb way will do fine for now, it can still be easily refactored later on :)
<bslsk05> ​github.com: toaruos/base/usr/include/kernel/process.h at master · klange/toaruos · GitHub
<geist> yep. my only suggestion there is treat it as that: a per cpu structure, even if there's only one
<geist> and then you can hide the 'get a pointer to my current cpu' behind some function that you can optimize later
<geist> get_current_cpu()->some_stuff, etc
<linkdd> i already have this function. i implemented the O(n) search in a cpu, but seeing the values in QEMU i was wondering if
<linkdd> erf
<geist> gotcha
<linkdd> i already have this function. i implemented the O(n) search in a cpu_locals[] array, but seeing the values in QEMU i was wondering if i could use the apic_id as index, but as said earlier, they are not compact
<geist> yah, and anyway reading the apic_id off the local cpu in x86 is expensive anyway
<linkdd> right, so i will want to optimize this anyway later on
<linkdd> problem for future me :D
<linkdd> make it work, make it right, make it fast, in that order :)
<geist> yup. you dont have to optimize it now of course, it's just generally nice to structure your stuff so it can be easily optimized, which sounds like what you're doing
<geist> that's where experience, etc comes in. building thigns such that you know you'll eventually optimize it in some way, and then at least make sure you didn't paint yourself into a corner in v1
<geist> and this is not so much directed at you, btw. i'm just sort of having a little soliloquy as i tend to do
<linkdd> years ago i was working on a 32 bits kernel in C for x86 only. recently, i was interested in doing it with multi-arch in mind, even if i only implement x86_64, and adding the niceties like smp support, acpi, not doing the task scheduling on the PIT interruption, etc...
<linkdd> the multi-arch forces me to consider the interfaces of my data structures and how i access them
<linkdd> what to put in the "generic" code, and what to put in the "target specific"
<linkdd> how to glue them together, etc...
<linkdd> i also want to make it a microkernel, and implement capabilities (i've been reading the source code of ddevault's kernel for some inspiration and as a way to learn hare at the same time)
<linkdd> i also want to try this idea of a VFS based on urls instead of a file/folder tree
<linkdd> driver://device:partition/path
<linkdd> ext4://hd0:3/hello/world.txt
gog has quit [Quit: byee]
<geist> nice
<kazinsal> similarly I do mountpoint:path/to/file
Burgundy has quit [Ping timeout: 245 seconds]
<kazinsal> simple enough that I can eventually add virtual mountpoints for things like tftp: and https:
<kazinsal> which will honestly probably reside in userspace drivers because I'm not baking SSL into the kernel
<moon-child> no ktls? laaaaaaaaame
<moon-child> not webscale
<linkdd> lol
<linkdd> as a microkernel, all vfs drivers will be in userspace as well
<linkdd> so i can imagine a https:// vfs path as well
<linkdd> but i have no concept of "mountpoint" nor the commands mount/umount from unices. I do like windows in that aspect, if the device is plugged, there is a letter for it (well, here, an URL)
<geist> i always kinda like thwe way VMS does it, where you end up with generated mount points, somewhat like what you're saying
<geist> and then the ability for the system to set aliases to them for nicer use
<geist> ie, boot: could be an alias for <some long device path>:
<geist> and stuff like home: could be boot:/some/path/within/it
<geist> really it's fancy environment variables, but environment variables that the VFS understands intrinsically, not just some local user space construct
<linkdd> well, i'm not there yet :) i currently have an initrd (tar archive), a physical memory manager (with a bitmap, classic), a heap (with liballoc), framebuffer with flanterm, the beginning of SMP support (i'm implementing the cpu local data), and a draft of a virtual memory manager
<linkdd> i might also embed https://github.com/zserge/jsmn in my kernel to parse the config files in the initrd
<bslsk05> ​zserge/jsmn - Jsmn is a world fastest JSON parser/tokenizer. This is the official repo replacing the old one at Bitbucket (732 forks/3345 stargazers/MIT)
<linkdd> > no dependencies (even libc!)
gildasio has quit [Ping timeout: 240 seconds]
m3a has quit [Ping timeout: 245 seconds]
<heat> percpu is hard
<heat> having a get_current_cpu() works but it's kind of messy, you get a big struct full of nothing, and non-optimal instruction sequences to get it
<heat> full of everything*
<heat> i play linker script + inline asm tricks to get pcpu data
<heat> but it doesn't fully work, linux for instance has a percpu allocator for dynamic data
<heat> which gets painfully needed when you realize that for dynamic structures you either reserve MAX_CPUS copies (properly padded to avoid cache line sharing), or you're screwed
gildasio has joined #osdev
<kof123> "but environment variables that the VFS understands intrinsically" maaaaaaaaaaaaaaaaaaaaaaagic symlinks
<linkdd> heat: yeah, that would be a concern if my goal would be "optimized, ready for production, totally not a fun experiment". i'm good with using a single global allocator with a spinlock
<heat> mjg down bad after looking at this msg
heat has quit [Quit: Client closed]
wblue has joined #osdev
heat has joined #osdev