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
thinkpol has quit [Remote host closed the connection]
thinkpol has joined #osdev
X-Scale has quit [Quit: Client closed]
X-Scale has joined #osdev
Arthuria has joined #osdev
Arthuria has quit [Killed (NickServ (GHOST command used by Guest684531))]
Arthuria has joined #osdev
Matt|home has quit [Ping timeout: 256 seconds]
joe9 has quit [Quit: leaving]
joe9 has joined #osdev
X-Scale has quit [Quit: Client closed]
Matt|home has joined #osdev
edr has quit [Quit: Leaving]
Left_Turn has quit [Read error: Connection reset by peer]
gcoakes has joined #osdev
gog has quit [Ping timeout: 272 seconds]
navi has quit [Quit: WeeChat 4.2.1]
X-Scale has joined #osdev
terrorjack has quit [Quit: The Lounge - https://thelounge.chat]
terrorjack has joined #osdev
X-Scale has quit [*.net *.split]
foudfou has quit [*.net *.split]
chiselfuse has quit [*.net *.split]
gildasio has quit [*.net *.split]
gildasio has joined #osdev
foudfou has joined #osdev
chiselfuse has joined #osdev
housemate has joined #osdev
housemate has quit [Max SendQ exceeded]
housemate has joined #osdev
housemate has quit [Max SendQ exceeded]
housemate has joined #osdev
heat has quit [Ping timeout: 268 seconds]
Arthuria has quit [Ping timeout: 260 seconds]
joe9 has quit [Quit: leaving]
Jari-- has joined #osdev
housemate has quit [Ping timeout: 256 seconds]
<xenos1984> Maybe they had a pointer to a variable in some other register than rsp, which uses ds by default, so that it was `mov [some other register], eax` instead?
Affliction has quit [Server closed connection]
Affliction has joined #osdev
ThinkT510 has quit [Quit: WeeChat 4.3.4]
ThinkT510 has joined #osdev
<chiselfuse> xenos1984: oh i see why it was 'stack' instead of 'rsp` then hmm
<chiselfuse> well either way, i checked a process in linux and: `ds` is 0, `ss` is 0x2b (entry 2 in gdt, RPL=3). here `ds` and `ss` are different though they must both have 0 as base address. i assume he must've been talking about x86
<zid> cpu doesn't care if you don't fill out ss in long mode for some reason
<zid> err ds? whatever
<zid> 2b i s not entry 2 last I checked though?
<zid> (5*8) + 3 = 0x2B
<chiselfuse> i don't understand why in long mode one data segment (ss) gets filled to point to a descriptor that contains a bunch of attributes such as permissions while still having 0 base address while all other data segments (es/ds) are just nulled out
<zid> cpu doesn't bother to check them, and es is unused
<zid> not sure *why* it doesn't check them, but it is a thing that is true
<chiselfuse> zid: why does it bother with ss then
<zid> the only thing the tss has it in it is ss and rsp
<zid> so that it can do a correct context switch
<zid> it just assumes ds from ss
<zid> and cs
Jari-- has quit [Ping timeout: 252 seconds]
<zid> because.. long mode isn't segmented
<zid> it's literally just filling in basically dummy values, for the 1 or 2 bits of actually mutable pieces of data all long mode cares about from all that segmentation stuff. Which if segmentation had not existed, would certainly be stored somewhere else entirely.
<chiselfuse> ah yea you're correct, it's index 5, not 2
<zid> for interrupts to happen it needs to have a ring0 ss:rsp to push to
<zid> so that's pretty much the only valid field left in the tss that long mode actually cares about
<zid> right got interrupted myself, ironic. x
<zid> Which means, ss is the only selector that really ever changes and gets reloaded
<zid> so ds can just hang out being broken with no repercussions
rustyy has quit [Quit: leaving]
rustyy has joined #osdev
duckworld has quit [Server closed connection]
duckworld has joined #osdev
Matt|home has quit [Ping timeout: 264 seconds]
GeDaMo has joined #osdev
rom4ik has quit [Read error: Connection reset by peer]
rom4ik has joined #osdev
Left_Turn has joined #osdev
andreas808 has quit [Server closed connection]
andreas303 has joined #osdev
Turn_Left has joined #osdev
Left_Turn has quit [Ping timeout: 245 seconds]
cheapie has quit [Server closed connection]
cheapie has joined #osdev
alice has quit [Server closed connection]
nathanpc has joined #osdev
alice has joined #osdev
obrien has joined #osdev
netbsduser has joined #osdev
navi has joined #osdev
X-Scale has joined #osdev
heat has joined #osdev
X-Scale70 has joined #osdev
X-Scale has quit [Ping timeout: 256 seconds]
X-Scale70 has quit [Ping timeout: 256 seconds]
Irvise_ has quit [Server closed connection]
Irvise has joined #osdev
Gooberpatrol66 has quit [Ping timeout: 272 seconds]
X-Scale has joined #osdev
vdamewood has quit [Quit: Life beckons]
Affliction has quit [Ping timeout: 264 seconds]
Affliction has joined #osdev
goliath has joined #osdev
X-Scale has quit [Ping timeout: 256 seconds]
hirigaray has quit [Server closed connection]
X-Scale has joined #osdev
chiselfuse has quit [Remote host closed the connection]
X-Scale has quit [Ping timeout: 256 seconds]
chiselfuse has joined #osdev
Matt|home has joined #osdev
gog has joined #osdev
Matt|home has quit [Ping timeout: 246 seconds]
gog is now known as pog
Reinhilde has quit [Server closed connection]
Ellenor has joined #osdev
<adder> I'm wondering if I should disable paging before I map the available ranges... I'm currently not, and I'm getting a pagefault during the mapping process. I'm using limine
heat has quit [Read error: Connection reset by peer]
heat has joined #osdev
<heat> i can't advise on limine, sorry
Turn_Left has quit [Ping timeout: 265 seconds]
<adder> heat, what do you use?
<adder> handrolled I bet :)
<heat> grub
<adder> I think I might start over again
<mjg> heat did a bunch of text replacement on lfs
<adder> I don't like this thing a tiny bit
<mjg> s/Linux/Onyx/
<mjg> now claims he has a kernel
rustyy has quit [Quit: leaving]
<netbsduser> adder: limine already does map the available memory ranges into the higher half already
X-Scale has joined #osdev
Turn_Left has joined #osdev
<Ermine> heat: do your pipewire issues trigger when you use bluetooth headphones or when you use wired headphones as well?
<adder> netbsduser: so I'm not sure what part of paging am I supposed to do
<adder> do I need to set up page tables and reload cr3?
<adder> do I need to iterate over the memory maps and map that space then?
<netbsduser> i just reuse the tables limine sets up initially, but that does mean i don't reclaim the memory marked bootloader-reclaimable
<netbsduser> it is up to you what you want to do
pog has quit [Quit: byee]
<netbsduser> you can do likewise, or you could assemble your own page tables such that you map the kernel and map as much or as little of the available memory as you want wherever you want
bleb has quit [Server closed connection]
bleb has joined #osdev
<adder> I am trying to set up my own tables and reload cr3 but am pagefaulting in the process
<netbsduser> then a translation is failing - the tables do not map everything you need them to map, or maybe they are bogus
rustyy has joined #osdev
gimli has quit [Server closed connection]
xvmt has quit [Remote host closed the connection]
xvmt has joined #osdev
X-Scale has quit [Ping timeout: 256 seconds]
obrien has quit [Remote host closed the connection]
<heat> Ermine, wired. bluetooth headphones in linux lol
X-Scale has joined #osdev
<Ermine> well, in my case pw shits itself only with bluetooth ones, while wired work okay
gog has joined #osdev
gog has quit [Remote host closed the connection]
gog has joined #osdev
X-Scale has quit [Ping timeout: 256 seconds]
netbsduser has quit [Ping timeout: 246 seconds]
<heat> page table reclamation at unmap time, yes or no?
<gog> no
<mjg> yes
* mjg <-- contrarian
* gog claw mjg
* mjg hisses at gog
<gog> :o
Matt|home has joined #osdev
<heat> mjg are you aware of the freebsd behavior on that
<Matt|home> morn.
<mjg> no
<mjg> it's probably stupid, so just find out what it is and do the opposite
<mjg> yer welcome
<heat> linox only does it on munmap but it's a terrible approach where they go down the page tablen (and unmap pagen), then go back down later to free them
<heat> truly next level wtf ideas
<Matt|home> off-topic, brain no worky - average wifi connection speed w home router in MB/s ?
<mjg> they could stash them
<mjg> no need to do the walk twice
<Matt|home> 3/5g
<Matt|home> im guessing 25-30
<mjg> this is a rather bad channel to ask this mon
<heat> mjg, could also just free them at the same time they unmap
<mjg> i presume there are locks held while processing it
<mjg> so liek don't artificially extend hold time kthx
X-Scale has joined #osdev
<mjg> their free is dog slow
<heat> they'll hold the locks again to free the page tables, i hope at least
<mjg> look mon i don't know the original reasoning
<mjg> i'm saying you can probably collect tehse tables and free them after
<heat> YOU KNOW NOTHING
<Matt|home> o.o
<mjg> harsh but fair
<heat> the annoying big issue when doing this kind of stuff is that it's hard to know if the page table is completely free
Turn_Left has quit [Remote host closed the connection]
<heat> so, uh, stashing a page table refcount in a struct page or whatever? but then every set pte operation turns into some kind of cmpxchg
<heat> it might not be worth optimizing
Turn_Left has joined #osdev
<Matt|home> yay i got samba set up and working.. my laptop is no longer e-waste, i can use it as a really shitty file server :D
<vin> madvise seem to just be an "advise" to the kernel about what to do with a page. For example, when I say MADV_DONTNEED on a set of pages, even after waiting for a few seconds I see the RSS of that application not decreasing. Is there a more aggresive way to hint the kernel?
<heat> MADV_DONTNEED is not an advice
<heat> you're probably holding it wrong
<vin> I see! I will double check if my start address is page aligned and the size is smaller/equal to the total mmap size
<heat> i know RSS has some counter fuckyness, it's possible you're seeing old values. or the pages you think are present actually aren't
dgz has joined #osdev
<vin> is there a more reliable way to tell if the pages are swapped out? If not by looking at RSS
<vin> Also is there a source that documetns the unreliability of RSS somewhere?
netbsduser has joined #osdev
dgz has quit [Ping timeout: 264 seconds]
vai has joined #osdev
vai is now known as Jari--
netbsduser has quit [Ping timeout: 246 seconds]
XgF has quit [Server closed connection]
XgF has joined #osdev
gcoakes has quit [Ping timeout: 268 seconds]
X-Scale has quit [Quit: Client closed]
goliath has quit [Quit: SIGSEGV]
khrbtxyz has quit [Server closed connection]
khrbtxyz has joined #osdev
<clever> vin: on linux, /proc/$PID/pagemap is basically an export of the leaves of the paging table
<clever> for a 64bit system, it is a flat array of 64bit physical addresses, telling you what page every page of the VM maps to
<clever> and with 64bit virtual mode, that makes it an array of uint64_t[2^64]
<clever> you can just read any offset you want to query, and if its resident, youll get a non-zero number
obrien has joined #osdev
<vin> Perfect, thanks clever! This is almost like page table scanning (for access bits) in user space.
X-Scale has joined #osdev
Matt|home has quit [Ping timeout: 258 seconds]
mazzter has joined #osdev
mazzter has quit [Quit: Leaving]
seds has joined #osdev
osdev199 has joined #osdev
X-Scale has quit [Ping timeout: 256 seconds]
mazzter has joined #osdev
seds has quit [Remote host closed the connection]
seds has joined #osdev
Arthuria has joined #osdev
<vin> Seems like I can't use that clever from the madvise man page: On MADV_DONTNEED "The kernel is free to delay freeing the pages until an appropriate moment. The resident set size (RSS) of the calling process will be immediately reduced however." So the pagemap might still show a page as resident even if DONTNEED is called on it
<vin> Only the RSS seem to be reduced right away. Unfortunately though my RSS remains the same after DONTNEED
Jari-- has quit [Ping timeout: 258 seconds]
vai has joined #osdev
vai is now known as Jari--
emm has joined #osdev
_whitelogger has quit [Server closed connection]
_whitelogger has joined #osdev
osdev199 has quit [Quit: Leaving]
<heat> vin, that is NOT what the man page says
<heat> man page says: ""The kernel is free to delay freeing the pages until an appropriate moment. The resident set size (RSS) of the calling process will be immediately reduced however."
<heat> so, simply put: the pages may not be freed, but the rss is reduced and the pages are unmapped
<heat> (pages are only not freed when e.g they're shared)
<vin> meaning the offset of /proc/self/pagemap will be 0 even if the pages aren't freed yet?
<heat> yes
<heat> not offset, value i imagine
<vin> Got it!
<heat> re: RSS inaccuracy
<bslsk05> ​man7.org: proc_pid_statm(5) - Linux manual page
<heat> "Some of these values are inaccurate because of a kernel-
<heat> internal scalability optimization. If accurate values are
<heat> required, use /proc/pid/smaps or /proc/pid/smaps_rollup
<heat> detailed information."
<heat> instead, which are much slower but provide accurate,
<heat> TL;DR mjg fucked it up
<mjg> i literally did not, but probably would have
obrien has quit [Remote host closed the connection]
<heat> didn't you touch rss a few weeks back or so?
<mjg> i did not *alter* the state mofo
<heat> damn. mofer.
<mjg> that was all g men
<mjg> i only made it suffer less on fork/exec
<mjg> and have some more patchen in the makingz :X
<mjg> however
<mjg> i don't see any reasons for that statm sucker to even know about it
<mjg> it literally could sum it up if needed
<heat> yeah ONYX USES AN ATOMIC MON
<mjg> wll
<mjg> linux > onyx then
<mjg> :X
<heat> so no idea what kind of games they're pulling off with rss
<mjg> it's a per-cpu counter with batching
<mjg> 's like the most cliche game in town
<mjg> the counter used to be distributed per-thread
<mjg> so if anything it was those guys who fucked it up 8S
<heat> aha yes a classic
<heat> was the terribleness the pcpu allocator?
<mjg> yes
<mjg> i have further patchen to sort it out
<mjg> did not productize them yet
<heat> productize? is corporate-speak mjg upon us
<mjg> 's ok word mofo
<mjg> what i did not implement yet but will have to add is the destructor support for slabz
<mjg> to pair up with ctor
<heat> haha good luck
<mjg> ye we will see
<mjg> i have an idea how to sort things out without adding one, but it would be very hacky
<vin> the man page says looks at smaps or smaps_rollup and not pagemap for accurate rss estimation. Why is that?
<heat> i believe smaps does proper page table walking
<heat> yep, code checks out
<heat> well, pagemap would also accurately estimate RSS probably, but without locks
xenos1984 has quit [Read error: Connection reset by peer]
<heat> but pagemap really isn't the way to estimate RSS :)
<mjg> my estimate: 20
nshp has quit [Server closed connection]
nshp has joined #osdev
<bslsk05> ​github.com: pure-linux-threads-demo/threads-x86_64.s at master · skeeto/pure-linux-threads-demo · GitHub
<heat> my early onyx processen actually hover around ~1MB RSS
<heat> probably because of being dynamically linked
<chiselfuse> when assembled, how does this exit? i imagine execution starts at _start, but doesn't it continue after the last instruction in _start? where does it stop?
froggey has quit [Server closed connection]
<heat> it looks forever
<heat> loops
froggey has joined #osdev
<chiselfuse> oh, right it's an unconditional jump
<chiselfuse> wait, weird, i built and ran it and it stops after a while
<mjg> some overflow ?
<chiselfuse> doesn't say it segfaultetd
<heat> check_count does exit actually
<chiselfuse> oh right
seds- has joined #osdev
seds- has quit [Remote host closed the connection]
seds has quit [Remote host closed the connection]
Marsh has joined #osdev
MiningMarsh has quit [Ping timeout: 252 seconds]
seds has joined #osdev
Marsh is now known as MiningMarsh
gcoakes has joined #osdev
xenos1984 has joined #osdev
X-Scale has joined #osdev
<mjg> __ia32_sys_vfork+72
<mjg> do_syscall_64+82
<mjg> backtrace
cultpony has quit [Server closed connection]
cultpony has joined #osdev
<heat> great backtrace mon
marshmallow has quit [Server closed connection]
<mjg> thanks
gcoakes has quit [Ping timeout: 246 seconds]
Starfoxxes has joined #osdev
housemate has joined #osdev
housemate has quit [Max SendQ exceeded]
dostoyevsky has quit [Server closed connection]
dostoyevsky has joined #osdev
housemate has joined #osdev
housemate has quit [Max SendQ exceeded]
housemate has joined #osdev
housemate has quit [Max SendQ exceeded]
X-Scale has quit [Ping timeout: 256 seconds]
housemate has joined #osdev
housemate has quit [Client Quit]
goliath has joined #osdev
emm has quit [Ping timeout: 265 seconds]
* Ermine yawns
mazzter has quit [Quit: Leaving]
GeDaMo has quit [Quit: 0wt 0f v0w3ls.]
Arthuria has quit [Ping timeout: 246 seconds]
V has quit [Server closed connection]
MrCryo has joined #osdev
V has joined #osdev
<chiselfuse> apparently you can _not_ share signal handlers across threads in linux with CLONE_SIGHAND
MrCryo has quit [Ping timeout: 264 seconds]
Gooberpatrol66 has joined #osdev
gcoakes has joined #osdev
seds has quit [Remote host closed the connection]
melonai has quit [Server closed connection]
melonai has joined #osdev
<chiselfuse> at the start of a c program i compiled, the value at fs:28h is put onto the stack of main never to be accessed again (i checked this by adding a tracepoint). what is it for?
<zid> reminds me of a stack canary
<zid> but you said it's not checked
<zid> so.. boot.s is written with them but the biary isn't built with it? idk
<chiselfuse> zid: how are stack canaries checked?
<zid> one of the -fstack-protector= options will check them
<chiselfuse> meh, 0x0.st replies with the text "segmentation fault" if you try to post an elf to it
<chiselfuse> v funny
<chiselfuse> just `gcc main.c`
<zid> I already said what my guess was, you're seeing the canary *once*, because boot.S (from the libc startup code) is initializing it, but the actual body of the program isn't built to bother checking it
<zid> because the startup code doesn't know if stack protectors iwll be used or not
<chiselfuse> oh that message was for me
* kof673 .oO ( uuencode )
<zid> so is just blindly doing it
<chiselfuse> i see
* kof673 .oO ( boo )
melonai has quit [Quit: Ping timeout (120 seconds)]
dennisschagt has quit [Server closed connection]
dennisschagt has joined #osdev
X-Scale has joined #osdev
Gooberpatrol66 has quit [Ping timeout: 246 seconds]
Starfoxxes has quit [Read error: Connection reset by peer]
gcoakes has quit [Ping timeout: 264 seconds]
Gooberpatrol66 has joined #osdev
gcoakes has joined #osdev
goliath has quit [Quit: SIGSEGV]
Arthuria has joined #osdev
X-Scale has quit [Quit: Client closed]
Ellenor is now known as Reinhilde
<bslsk05> ​thundergolfer.com: Computers are fast – Jonathon Belotti [thundergolfer]
<heat> its a hard quiz i'll tell you that
<nikolar> I was never off more than one away from greens
<chiselfuse> does daily driving a computer that is 15 years old make you not know computers automatically then
<heat> >A newer computer won’t make any of the benchmark code run 1000x faster.
<nikolar> Correct
<nikolar> 15 years ago was 2009
netbsduser has joined #osdev
gildasio has quit [Ping timeout: 260 seconds]
<zid> 2011 is the minimum viable compuer
<nikolar> Lel
<zid> man, you REALLY gotta know python for that part
<zid> how the fuck should I know if their optimizer elides empty loops, or if it ends up interpreted and thus 10/s
<zid> Also, this guy's computer has really shit memory bw
<zid> guess because it's a laptop
<nikolar> zid but it's a new arm apple
<nikolar> *macbook
<zid> yes, a macbook is a laptop
<zid> all laptops have shit dram, I should have realized
netbsduser has quit [Ping timeout: 264 seconds]
netbsduser has joined #osdev
xal has quit []
xal has joined #osdev
melonai has joined #osdev
<bslsk05> ​'Why You Shouldn't Learn Romanian' by Living Ironically in Europe (00:19:45)
<nikolar> Heh great title
netbsduser has quit [Ping timeout: 265 seconds]
<zid> romanul vrea sa plece din romania cat mai repede
<zid> romanul vor sa fure un radio
xenos1984 has quit [Read error: Connection reset by peer]
<nikolar> Ah, you're confusing them with gypsies
<zid> no? gypsies aren't plumbers
xenos1984 has joined #osdev
<kof673> supposedly :D > Kheb-si the child or descendant of Kheb, Kab, Kab-t, Egypt, is our Gipsy > the Lee tribe of Gipsies, who told Barrow that their name in Egypt signified an onion > Rekh (Eg.) the equivalent of Leek, signifies heat, and Leek modifies into Lee. Moreover, the onion is worn in the hat by the Welsh, and the Egyptian Hut is both onion and hat.
<kof673> it was the style at the time ...
vdamewood has joined #osdev
X-Scale has joined #osdev
<heat> i've realized i have a bunch of tricky page table clearing logic i haven't implemented
<heat> annoyin
<heat> (mainly when it comes to invalidating the pt walker cache, *especially* before freeing the page table)
\Test_User has quit [Quit: e]
\Test_User has joined #osdev
j00ru has quit [Server closed connection]
j00ru has joined #osdev
X-Scale has quit [Quit: Client closed]
X-Scale has joined #osdev
gildasio has joined #osdev
Jari-- has quit [Remote host closed the connection]