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
<Mondenkind> ruuuuuuuuuuuuuuuuuuuuust
<Mondenkind> or perhaps verifast. Does verifast work for c++ or just c?
<mjg> just like cloud someone else's computer
<mjg> rust "concurrencY' is not
<mjg> what marketing claims
gog has quit [Quit: byee]
<Mondenkind> it should be able to at least ensure that you don't hold a lock on the thing, no?
<kingoffrance> C++ support (#236) October 29, 2021 05:43
d61 has joined #osdev
<kingoffrance> search also turned up some employment/tenant verification thing
<Mondenkind> 'basic C++ support to verify simple C++ programs' I'm assuming onyx is a massive c++-feature-fest
<mjg> mmap_upgrade_trylock
<mjg> upgrade_mmap_lock_carefully
<mjg> i'm tempted to add carelessly_upgrade_mmap_try
<mjg> send more ideas to linux-mm@kvack.org
<Mondenkind> mmap_upgrade_dontbothertryingtolock
<mjg> would not be a problem with rust!
<mjg> you would just write lock over the entier thing
<mjg> no games with read lock changing anything
<mjg> you know, as a freebsd complainer i used to complain a lot about freebsd
<mjg> but now that i'm mostly messing with linux i find the same "quality"
<mjg> in the acclaimed "The Matrix" movie one of the characters said "ignorance is bliss"
<mjg> at this point i can agree
MiningMarsh has quit [Ping timeout: 246 seconds]
nyah has quit [Quit: leaving]
heat has quit [Quit: Client closed]
d61 has quit [Quit: WeeChat 3.8]
<zid> good news, I woke up today and *didn't* feel like I had been stabbed
<zid> you may resume being awful to me
<zid> not that you all really stopped
nvmd has quit [Quit: WeeChat 3.8]
vdamewood has quit [Quit: Life beckons]
SGautam has joined #osdev
netbsduser has quit [Ping timeout: 246 seconds]
skipwich has quit [Quit: DISCONNECT]
skipwich has joined #osdev
MiningMarsh has joined #osdev
Hammdist has joined #osdev
linearcannon has quit [Remote host closed the connection]
linear_cannon has joined #osdev
mhall has quit [Quit: Connection closed for inactivity]
<Mondenkind> zid: hmmm
<Mondenkind> can I stab you?
vny has quit [Remote host closed the connection]
Valeria22 has quit [Quit: Konversation terminated!]
bradd has quit [Remote host closed the connection]
damo22 has joined #osdev
<damo22> do intel >= i586 cpus have MSR 0xc0000101 ?
<damo22> i mean in 32 bit mode
<zid> can I get that as an enum
<zid> ah, gs base
<zid> IA32_KERNEL_GS_BASE
<damo22> yea so 0xc0000102 is kernel_gs_base
<damo22> i think that is only on 64 bit?
<damo22> since the swapgs op is .code64
<zid> yea if it exists it won't do much
<damo22> it would still be handy to load the gs seg manually
<zid> think mov gs, ax should be valid
<damo22> a hok
<damo22> ah ok*
<zid> gs_base is just for swapgs
<zid> to know what to swap it.. to
<damo22> yeah i think the second gs base is so you can swap the gs more easily when you switch contexts
<zid> It's so you can swap it at all
<damo22> well you could disable interrupts
<zid> disabling interrupts will help you swap it?
<zid> pardon
<kazinsal> IA32_KERNEL_GS_BASE isn't needed in 32-bit mode because 32-bit GDT descriptors don't require a base of zero
<damo22> it will stop bad things happening if you try to store it somewhere temporarily
<zid> You don't *have* anywhere to put it, without swapgs, that's the point
<damo22> oh
<zid> mov [64bit absolute], gs doesn't exactly exist, and would suck bumholes in practice
<zid> (would need locking, one per core, mean the kernel isn't relocatable, etc)
<damo22> so how do you do that in 32 bit?
<zid> you don't use gs like that in 32bit
<zid> as far as I know?
<zid> maybe you do
<damo22> i just want to store some per-cpu variables in gs + some offset
<damo22> but the saved state is per thread afaik
<zid> does pmode let user code change gs?
<zid> that would be an easy solution
<zid> just pin to gs permanently
<damo22> hmm
<damo22> i think gs is used in userspace
<zid> fs gets used for tls (or gs, and fs and gs are swapped compared to what we're talking about)
<damo22> ok
<zid> but I don't recall both ever being used in userspace, and precisely because of the lack of swapgs might be why
<damo22> so there may be a free reg
<zid> but I'm not a pro at 32bit
<damo22> that would make sense
<damo22> im implementing SMP for GNU/Hurd
<damo22> i mean, it runs, but its very slow atm
<damo22> i think it will speed up when im not looking up the cpu number so often
orccoin has joined #osdev
<mjg> ? :D
<damo22> sysdeps/x86_64/nptl/tls.h: (*(struct pthread *__seg_fs *) offsetof (struct pthread, header.self))
<damo22> sysdeps/i386/nptl/tls.h: (*(struct pthread *__seg_gs *) offsetof (struct pthread, header.self))
DanielNechtan has quit [Quit: b0rk]
<damo22> so on 32 bit, %gs is for TLS
<zid> yea I think on windows and linux it's opposite also
<zid> 64bit forces gs to be the task struct, more or less
<mjg> not the teask struct, the per-cpu thing which also has a pointer to the task
SGautam has quit [Quit: Connection closed for inactivity]
GeDaMo has joined #osdev
<damo22> why dont we use the segment registers in userspace to have files == different memory segments
<damo22> like a super ramdisk that partitions ram
<GeDaMo> Other than fs and gs, segment registers don't work in x86 64-bit mode
<GeDaMo> "Four of the segment registers, CS, SS, DS, and ES, are forced to base address 0, and the limit to 264. The segment registers FS and GS can still have a nonzero base address." https://en.wikipedia.org/wiki/X86_memory_segmentation
<damo22> ok
<GeDaMo> s/264/2^64/
<zid> 264 is funnier
qookie has quit [Read error: Connection reset by peer]
Arsen has quit [Read error: Connection reset by peer]
qookie has joined #osdev
Arsen has joined #osdev
frkazoid333 has quit [Remote host closed the connection]
ThinkT510 has quit [Quit: WeeChat 4.0.3]
ThinkT510 has joined #osdev
<asarandi> not exactly osdev, i'm working on a ctf challenge. the program generates a random address where it mmap's the flag file. the challenge is to figure out the memory address. all syscalls are disabled via seccomp. challenge comes bundled with a specific libc.so version 2.31, author says that there is a way to test memory pages and check if mapped/unmapped using some libc mechanism without causing
<asarandi> access violation, any ideas about this? thank you
<zid> catch sigsegv?
<asarandi> yes but without syscall
<bslsk05> ​www.man7.org: signal(2) - Linux manual page
<asarandi> GeDaMo: that's with syscall
<GeDaMo> "By default, in glibc 2 and later, the signal() wrapper function does not invoke the kernel system call. Instead, it calls sigaction(2) using flags that supply BSD semantics."
<klange> That's still a system call, just a different one.
<zid> sys_rt_sigaction?
<zid> I don't actually know how linux does signals
<zid> do you get a generic 'signal' then you switch on the code, or do you register for each possible signal? etc
<klange> Linux has a lot of 'legacy' system calls that are not used but continue to exist to 'not break userspace' in the case of statically-compiled binaries
<damo22> xchgw %fs, %gs <--- is that valid?
<zid> don't believe so, 2 seconds will an assembler will tell you thoug
<zid> I think basically the only encodings available are mov seg, ax
<asarandi> i had some success with `prefetcht2` instruction and timing its duration via `rdtsc` - it is possible to discern between mapped and unmapped pages, however this is not the correct approach in this case because of the way `mmap` works where it does it's "lazy" thing and files are not truly mapped until first access
<zid> that actually makes timing attacks much much easier
<zid> but yea, not much help to you
<asarandi> yes but like i said .. the flag is never truly mapped, so the timing approach fails
<zid> clearly the solution is *(int *)rand()
<zid> be luckier
<asarandi> oh the proggie reads a seed from /dev/urandom so no luck there lol
<klange> The 'right' way to determine what memory is mapped for your process on Linux is to read /proc/$PID/maps, if you can.
<zid> that'd need many syscalls
<klange> On x86-64, probing of any sort would be mathematically infeasible.
<zid> meh it's only 34 billion pages to check
xenos1984 has quit [Read error: Connection reset by peer]
<asarandi> it's random in range, i think i'd have to probe a max of 27k pages
<mjg> asarandi: you could do prefetch twice?
<mjg> but then again, i'm surprised to find it does not crash
<asarandi> something like: `while (!(0x400 <= addr && addr <= 0x7000)) { addr = rand(); } return addr << 24;
<mjg> bu then again, i never tried it on something i knew was not mapped
<mjg> ;)
<GeDaMo> Could you preload a library which replaced mmap?
<asarandi> GeDaMo: no, it runs on remote server .. all i can do is supply shellcode
<GeDaMo> Ah
<zid> is it supposed to be hard or supposed to be easy, btw
<asarandi> mjg i was doing prefetch about 1000 in a loop and taking the shortest rdtsc reading
xenos1984 has joined #osdev
<asarandi> https://bpa.st/4E2A my prefetch timing code
<bslsk05> ​bpa.st: View paste 4E2A
<asarandi> zid others have solved but not too many ppl succeeded
Yoofie8 has joined #osdev
Yoofie has quit [Ping timeout: 246 seconds]
Yoofie8 is now known as Yoofie
[itchyjunk] has quit [Read error: Connection reset by peer]
benlyn has joined #osdev
<damo22> mov $4, %fs does that mean i need to write a pointer at physical address 0x40 to use fs:0 ?
asarandi has quit [Quit: WeeChat 4.0.1]
asarandi has joined #osdev
gog has joined #osdev
<geist> a bit more context is needed
<geist> is this x86-64 or x86-32?
<geist> protected mode i assume?
<geist> or real mode?
<geist> actyally this sound slike real mode, in which case yeah fs:0 is address 0x40
zxrom has quit [Quit: Leaving]
bradd has joined #osdev
<zid> I'd blanked real mode out from my mind, didn't even consider that
terminalpusher has joined #osdev
Left_Turn has joined #osdev
Gooberpatrol66 has quit [Quit: Leaving]
Gooberpatrol66 has joined #osdev
Turn_Left has joined #osdev
Left_Turn has quit [Ping timeout: 246 seconds]
Left_Turn has joined #osdev
Turn_Left has quit [Ping timeout: 246 seconds]
Turn_Left has joined #osdev
terminalpusher has quit [Ping timeout: 246 seconds]
Left_Turn has quit [Ping timeout: 246 seconds]
Left_Turn has joined #osdev
Turn_Left has quit [Ping timeout: 258 seconds]
<damo22> sorry i forgot, its protected mode
<damo22> i guess i need to add something to the gdt ?
<damo22> i dont really understand segmentation
dude12312414 has joined #osdev
dude12312414 has quit [Remote host closed the connection]
netbsduser has joined #osdev
Gooberpatrol66 has quit [Ping timeout: 248 seconds]
ZipCPU has quit [Quit: ZNC 1.7.5+deb4 - https://znc.in]
ZipCPU has joined #osdev
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
duderonomy has joined #osdev
duderonomy has quit [Client Quit]
Vercas has quit [Remote host closed the connection]
Vercas has joined #osdev
sinvet__ has joined #osdev
melonai has quit [Quit: Ping timeout (120 seconds)]
sinvet has quit [Remote host closed the connection]
melonai has joined #osdev
<gog> hi'
* gog knocks things off the shelf
stolen has joined #osdev
<mjg> gog: drop the vaes
<mjg> vase
Vercas has quit [Remote host closed the connection]
Vercas has joined #osdev
Valeria22 has joined #osdev
zhiayang has quit [Ping timeout: 245 seconds]
zhiayang has joined #osdev
<zid> I'm not convinced by intel's new pricing strategy
<bslsk05> ​www.ebay.co.uk: NEW UNUSED INTEL C4002-2 DATE 1976 - PHILIPPINE - IN PLASTIC HOLDER - C4004 | eBay
Turn_Left has joined #osdev
Left_Turn has quit [Ping timeout: 258 seconds]
* gog drops the vase from the shelf to the floor
<sham1> Quit breaking vases!
<Ermine> Nooo vases!
<zid> like any of us own vases
phoooo has joined #osdev
<mjg> i no longer do
<mjg> thanks gog
<phoooo> rather a question that requires an opinionated answer, but just asking to know what do you think. i am working on a tiny riscv os, would you go with virtio for the filesystem or just a plain initrd
<zid> depends on how late stage capitalism I am
<zid> initrd for small kernel, initrd for massive kernel
<zid> virtio for medium
<sham1> Well virtio isn't a filesystem, is it?
<sham1> IIRC the actual filesystem in use there is 9p2000
<zid> I don't think it was that usage of 'for'
<zid> virtio for (the filesystem) not virtio (for the filesystem)
<zid> sham1: that's virtio-9p anyway, there's also you know, virtio-blk
<zid> like people actually use
<sham1> Well in that case the question makes no sense since whether or not you're using virtio-{9p,blk} has no bearing on the use of an initrd
<phoooo> i was asking whether to use virtio-blk+{fat32, ext2} or just a tar initrd
<phoooo> might have phrased it wrongly
<zid> nah he's just being awks
<zid> I got what you meant
<zid> and I stick by my answer
<sham1> I still don't quite understand why it's a either-or question in that case
<sham1> You can have both
<sham1> Maybe tar would be easier at the outset, but you want to have block device support eventually
<zid> small kernel: just go with an initrd, there is no fs support, very large kernel: fat32/ext2 is now a driver so you need an initrd again, medium: You just hardcode everything to the one fs you support
<zid> :P
<sham1> And in that case you could make the virtio-blk driver into a module to be loaded, yeah
<sham1> Alongside the FAT or ext2 driver
<phoooo> yeah, of course, just wanted to have a barebones file system for the moment
<phoooo> so as to load some binaries and such
<sham1> Well I'd go with tar or some such
<phoooo> yeah
<sham1> USTAR is after all a quite simple format. Although I do wonder whether anyone supports the pax format by POSIX which is essentially just USTAR but extended
<zid> isn't an initrd in cpio format
<zid> normally
<phoooo> on linux it is
<phoooo> i dont know about other systems tho
<phoooo> i mean, both tar and cpio are kinda similar
<sham1> There's also squashfs which is also similar
<zid> ooh yea squashfs
<phoooo> isn't squashfs compressed
<zid> I'd hope so
<zid> otherwise they named it really terribly
<sham1> Yeah
rb has quit [Ping timeout: 245 seconds]
Vercas has quit [Remote host closed the connection]
Vercas has joined #osdev
rwb has joined #osdev
terminalpusher has joined #osdev
frkazoid333 has joined #osdev
phoooo has quit [Quit: Client closed]
troseman has joined #osdev
troseman has quit [Client Quit]
[itchyjunk] has joined #osdev
troseman has joined #osdev
heat has joined #osdev
<heat> hi
<heat> i had a dream where geist asked me for details on the PCI option ROM format and how EFI drivers can fit there
<heat> really woke up after that, no one is nerd sniping me in my dreams
<heat> btw initrds need a tmpfs
<heat> tar and cpio are *not* filesystems
<heat> they have no hierarchy whatsoever, it's just a collection of pathnames + stat info + data
<sham1> Down with the hierarchies, up with the databases!
goliath has joined #osdev
zxrom has joined #osdev
elastic_dog has quit [Ping timeout: 240 seconds]
elastic_dog has joined #osdev
Burgundy has quit [Ping timeout: 250 seconds]
<zid> heat: I just uncompress and while I do it, build a prefix tree of the files
<sham1> Yeah, it is a file system. It's just not serialised tree-wise
<zid> ssd too fast, need a filesystem optimized for it, that doesn't use a tree structure
<zid> and ram is even faster
heat has quit [Ping timeout: 246 seconds]
kingoffrance has quit [Ping timeout: 252 seconds]
<gog> hi
<gog> you know where you won't find any trees
<GeDaMo> The moon?
<zid> carpark
<zid> icelandfs
<zid> It's like a normal fs but it's got moss on it instead?
<zid> I think a moss is where you just put everything thinly spread over everything, basically an array?
<Ermine> gog: may I pet you
<Ermine> google spreadsheet dates are insane
<zid> At least in spreadsheets the glass is 2nd of february full
<zid> 2nd of january*
<mjg> personally i'm the "glass is crap" kind of guy
FreeFull has joined #osdev
ourdumbfuture has joined #osdev
<gog> Ermine: yes
* Ermine pets gog
* gog prr
<gog> i liek glass it's my favorite material
<gog> it's elegant and smooth and if you break it you can use it as a weapon
<gog> like me
kof123 has joined #osdev
<GeDaMo> Borosilicate is best glass
<gog> yes
<gog> it does not afraid of rapid temperature changes
<gog> at least not too rapid
<zid> disregard glass, aquire aluminium crystals
<GeDaMo> The gemstones sapphire and ruby are made of aluminium
<GeDaMo> There's a colourless form called corundum
<zid> Lots of things are just aluminium oxide with various structures and impurities
<GeDaMo> Are /you/ aluminium oxide? :|
<zid> partially
<zid> dumortierite, petalite, jadeite, sinhalite, kyanite, orthoclase, taaffeite, turquoise, kornerupite, euclase, hauyne, sillimanite, staurolite, sperssartine, iolite
<zid> brazilianite, spodumene, unarovite, rubellite tourmaline, amblygonite, sodlite, lazulite, vesuvianite, dravite, spniel
<zid> zoisite, pyrope, goshenite beryl, microcline, padparadscha, topaz, morganite, helidor beryl, tugtupite, hessonite, epidote, ruby, scapolite, sapphire
<zid> tektite, moonstone, grossular garnet, ziron
<zid> at least 2 of those contain aluminium
ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
troseman has quit [Quit: troseman]
duderonomy has joined #osdev
<gog> sodlite
<gog> how about sodlite off
<gog> amirite
<gog> amilite
<gog> haaa
nyah 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!]
Brnocrist has quit [Ping timeout: 248 seconds]
stolen has quit [Quit: Connection closed for inactivity]
SGautam has joined #osdev
dutch has quit [Quit: WeeChat 4.0.2]
Hammdist has quit [Quit: Ping timeout (120 seconds)]
<sham1> hi
<nikolar> Hello
troseman has joined #osdev
terminalpusher has quit [Remote host closed the connection]
benlyn has quit [Ping timeout: 245 seconds]
Gooberpatrol66 has joined #osdev
xenos1984 has quit [Ping timeout: 245 seconds]
<kazinsal> huh. just learned that shift+function keys produces F13 through F24 on windows
<zid> I don't think it does universally
xenos1984 has joined #osdev
heat has joined #osdev
<heat> hi
<Ermine> hey
<zid> I think I am cured.. I hope
<zid> I have eaten a banana even, so that I don't die of no vitamins
<gog> hi barbie
<zid> I am thinner than margot robbie
<gog> cool
<zid> They're casting me for the sequel
<zid> as long asI stick to my diet of diarrhea and a banana
goliath has quit [Quit: SIGSEGV]
<mcrod> hi
<mcrod> gog may I pet you
<gog> barbie: yes
<heat> margot robbie is attractive
<heat> subscribe for more HEATFACTS
<Mondenkind> ur attractive
<Cindy> hey osdev
<Cindy> i wanna ask you a question
<Cindy> what's the name of that scheduler that's priority-based and ages up processes to avoid starving
<zid> Subscribe to my bedroom for more loud ZIDFARTS
<heat> Mondenkind: oh thanks you're cute too 😳
<Mondenkind> 🥺
<heat> Cindy: weighted fair queueing?
<zid> I think I know what I want when I am able to eat again
<heat> seen in linux as CFS
<bslsk05> ​redirect -> www.reddit.com: Reddit - Dive into anything
<zid> Just found this gravy on reddit
<zid> heat: also known as unfair
<heat> WEIGHTLESS UNFAIR DEQUEUEING
<Cindy> heat: oh
<Cindy> i need this for my epic OS-9 reimplementation
<heat> well multilevel feedback queues are also kinda what you want too?
<heat> "thing that's priority based and ages up processes" fits almost all the decent OS-level schedulers
<zid> turns out fair queueing is bad cus processes are capitalist
<zid> and will absorb all resources until all that's left is a barren wasteland
<heat> i want to invest in processes
<zid> There need to be carbon credits
<heat> i'm an rcu_gp shareholder
<heat> i also have stocks in ksoftirqd
<Cindy> heat: yeah that sounds similar
<mcrod> gog: :(
gog has quit [Ping timeout: 248 seconds]
Arthuria has joined #osdev
gog has joined #osdev
sebonirc has quit [Remote host closed the connection]
sebonirc has joined #osdev
troseman has quit [Quit: troseman]
damo22 has left #osdev [#osdev]