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
anandn has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
irl25519 has joined #osdev
[itchyjunk] has quit [Remote host closed the connection]
Celelibi has quit [Ping timeout: 245 seconds]
sdfgsdfg has joined #osdev
anandn has joined #osdev
pretty_dumm_guy has quit [Quit: WeeChat 3.4]
lkurusa has quit [Quit: I probably fell asleep (or went out). Who will ever know.]
Celelibi has joined #osdev
biblio has quit [Quit: Leaving]
irl25519 has quit [Quit: irl25519]
<geist> heat: re:thinlto yeah it's not too bad
<geist> a few times slower than a non thinlto, but nothing like a full LTO. though of course the slowness of LTO i thnk goes up perhaps nonlinearly with the complexity of the code base
<heat> I let my laptop compile llvm with ThinLTO and it took like 140 minutes
<heat> so like +100 minutes which is not too bad for an older laptop
<heat> taking into account it just freaking LTO'd
<heat> I imagine using a big workstation-ish CPU you could do it in what, 20-30 minutes? amazing
anandn has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<geist> good question. i'll give it a try later today to see
<geist> how did you configure it for thinlto vs lto?
<geist> oooh i'll build it on the arm workstation
<heat> it's the -DLLVM_ENABLE_LTO= switch on the llvm cmake
<geist> =thinlto?
anandn has joined #osdev
<heat> =Thin, =On (Full), =Off
<geist> kk
<heat> then you also have -DLLVM_PARALLEL_LINK_JOBS=N if you want to limit parallel link jobs
<geist> good idea
<geist> i only have 128GB on this machine
<heat> hahahaha "only"
* geist flexes
<geist> well, 256 cores and 128GB. so its a bad ratio
<gog> that's like my whole SSD in this thing
<klange> I think 64GB is the chipset maximum for what I'm running in this box...
<bslsk05> ​ark.intel.com: Intel Core i56600K Processor 6M Cache up to 3.90 GHz Product Specifications
<zid> nice webserver you've got there
<heat> I think consumer intel only goes up to 128GB anyway
<zid> I go up to 275GB and nobody has ever come up with a reason for such a weird number that's convincing
<klange> I had a 64-bit Atom board that only supported 2.
<zid> 375GB*
<zid> need me some 46.875GB dimms and an 8 slot mobo
<geist> hmm, think my x570 ryzen goes up to 128
<geist> guess that's not the chipset though, that's the ryzen. 4 channels of 32
<geist> well 2 channels, but two sockets epr
<geist> per
<gog> does that require NUMA?
<geist> nah that's a non numa
<geist> so far the numa ryzen stuff was isolated to just the first gen threadripper, where it had multiple full dies on board
<gog> also does the M1 have NUMA because of how it is?
<geist> when they went to zen2 and above they moved to a single IO die (with the memory controller) + a variable number of cpu chiplets
<geist> i dont think M1 does no
<gog> hm interesting
<heat> don't the really big epyc chips with really high memory-cpu density have NUMA?
anandn has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Burgundy has quit [Ping timeout: 256 seconds]
<geist> ah fun. i already oomed the system when doing a non lto build but with -j256
<geist> there's a compile phase in clang build where it just has 256 compilers running with >= 500MB active memory
<zid> it's still numa but on the same scale as L3
<heat> hah
<heat> if you feel better my rpi zero 2 w has 4 cores and 512MB
<zid> it has to track across the chiplet things and do requests across them and blah cus it's 2x channels on 4 chiplets, not 8 channels
<heat> it OOMs compiling trivial stuff :)
<geist> that's what i mean by saying 128GB isnt enough for a 256 core machine. the ratio of GB/cpus should be at least 1, if not 2 or 4
<zid> I have.. 6x because I am weird
<zid> (and I couldn't be bothered to get matching kits)
<geist> generally if i can do it, i try to keep at least 2GB/core. so my main ryzen box is 32c/64g
<geist> etc
<geist> OTOH, this arm core is SMT4, and honestly past benchmarks have shown me that 4x SMT doesn't really help for compiles and whatnot
<heat> what does it help with?
<geist> that's a good question
<heat> compute?
<geist> presumably something with a lot of data stalls or whatnot
<geist> maybe databasy stuff
gog has quit []
<geist> but for things like compiling linux kernel or qemu or whatnot i think i've seen that SMT2 is like 30% faster and SMT4 is basically within a few percentage of SMT2
<zid> I always call them webserver cpus
<geist> so it really doesn't make sense to run the cpu in SMT4 mode, but it's just too exotic *not* to
<zid> where you need a meg or two of memory for a thread of apache, but a lot of https on the cpus
<geist> huh okay tht's odd. i am rerunning with -j128 and watching linux load up one node (it's a two node system) and leave the other one basically idle
<geist> that's not what it should be doing!
<geist> 90% utilization of all the 128 threads of one cpu socket, while the other one is lik e7%
<heat> something cool popped up in upstream LLVM yesterday: BOLT
<heat> you profile your program and run bolt on it, and it re-arranges your binary's layout optimally
<geist> neat
<zid> so like pgo?
nyah has quit [Ping timeout: 240 seconds]
<heat> pgo for code layout yeah
Lugar has quit [Ping timeout: 256 seconds]
<zid> pgo already re-orders switches and generates .hot and .cold and stuff I thought?
<heat> possibly but bolt does a lot more, not just .hot and .cold
<heat> and you don't need to recompile it
<heat> says you just need a symbol table and for max performance, relocations
<zid> oh, that's neat
[itchyjunk] has joined #osdev
mahmutov has joined #osdev
anandn has joined #osdev
anandn has quit [Client Quit]
sdfgsdfg has quit [Quit: ZzzZ]
anandn has joined #osdev
Ellenor is now known as Reinhilde
anandn has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
NiD27 has joined #osdev
<NiD27> Hey guys a novice getting into bootloaders here, The osdev wiki suggests that boot signature as byte 510 as 0x55 and 511 as 0xAA but the linked IBM resource suggests last 2 bytes(510, 511) should be 0xAA55 those 2 arent the same right?
<NiD27> which would be the correct one 0x55AA or 0xAA55
<klange> The IBM doc is considering it as a 16-bit value.
<klange> As bytes, it's 0x55 0xAA; as a little-endian 16-bit value it's 0xAA55.
<NiD27> oh ok gotcha
<NiD27> thanks :)
terrorjack has quit [Quit: The Lounge - https://thelounge.chat]
terrorjack has joined #osdev
<geist> where on the wiki does it say 0x55 0x55? we should fix that if so
<geist> er 0xaa 0xaa
<NiD27> I meant byte 510 = 0x55 and byte 511 = 0xAA
<NiD27> its correct but since the IBM had it as 0xAA55 it confused me but now I know that its little endian 16bit it makes sence
<kazinsal> in practice I think most clone-era and later BIOSes just accepted either one
<geist> or didn't care. it was only a defacto standard that there had to be one there
<geist> huh. looks like you can get a free VM on a z system?
<bslsk05> ​developer.ibm.com: Get started with IBM LinuxONE – IBM Developer
<geist> that might be fun to fiddle with for a little bit
NiD27 has quit [Quit: Leaving]
dude12312414 has joined #osdev
mahmutov has quit [Ping timeout: 256 seconds]
jstoker has quit [Remote host closed the connection]
anandn has joined #osdev
anandn has quit [Client Quit]
jstoker has joined #osdev
anandn has joined #osdev
anandn has quit [Client Quit]
srjek has quit [Ping timeout: 240 seconds]
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
anandn has joined #osdev
sonny has joined #osdev
xenos1984 has quit [Read error: Connection reset by peer]
sonny has quit [Remote host closed the connection]
sonny has joined #osdev
heat has quit [Ping timeout: 250 seconds]
xenos1984 has joined #osdev
sonny has quit [Remote host closed the connection]
the_lanetly_052_ has joined #osdev
the_lanetly_052_ has quit [Max SendQ exceeded]
the_lanetly_052_ has joined #osdev
sonny has joined #osdev
sonny has quit [Remote host closed the connection]
sonny has joined #osdev
sonny has quit [Remote host closed the connection]
rb has quit [Quit: ZNC - https://znc.in]
sdfgsdfg has joined #osdev
rwb has joined #osdev
ElectronApps has joined #osdev
the_lanetly_052_ has quit [Ping timeout: 250 seconds]
gxt has quit [Remote host closed the connection]
gxt has joined #osdev
rwb is now known as rb
radens has quit [Quit: Connection closed for inactivity]
lkurusa has joined #osdev
lkurusa has quit [Quit: I probably fell asleep (or went out). Who will ever know.]
lkurusa has joined #osdev
lkurusa has quit [Quit: Textual IRC Client: www.textualapp.com]
anandn has quit [Ping timeout: 240 seconds]
sdfgsdfg has quit [Quit: ZzzZ]
<kazinsal> the more I read the VAX ARM the more I wish microVAX had become the dominant VLSI CISC in the early 80s instead of x86
sonny has joined #osdev
sonny has quit [Remote host closed the connection]
sonny has joined #osdev
sdfgsdfg has joined #osdev
<klys> article 1/3 starts on page 82/116
sonny has left #osdev [#osdev]
alexander_ is now known as alexander
<geist> kazinsal: right? the exotic one off instructions are really not the interesting part
<geist> the regularity of the main ISA is pretty elegant
<geist> also reading vax really informs how much the motorola folks must have been fan when they did 68k
GeDaMo has joined #osdev
<geist> nice thing 68k has is the base word size being 16 bits really makes the base opcode a bit more flexible
<geist> vax opcodes are still fundamentally 8 bit, and they also ran out, had to start adding escape opcodes, etc over time
<geist> also id ont think there' smuch of a pattern to the original opcode layout, but since it was explicitly microcoded from the get go, there's no real reason to have any pattern there. it just selects lines in a microcode rom
<GeDaMo> IBM 360 opcodes use halfwords (16 bits) http://weblog.ceicher.com/2006/12/ibm-system360-green-card.html
<bslsk05> ​weblog.ceicher.com: IBM System/360 Green Card - Disinfotainment
<geist> GeDaMo: yah not surprising
<GeDaMo> The opcode itself is still 8 bits but you don't have to fit operands in there too
<kazinsal> yeah, the vax architecture is just extremely well designed. they were totally aiming to make an ISA they could sell for 15+ years and still have consistent and backwards compatible and they accomplished that
<geist> in fact: if you look at the VAX opcodes by byte, they simply started at 0 and counted up to looks like 0xDF. the opcodes are laid out basically in the order they were added it seems
<geist> and then what appears to be the one and only escape opcode was 0xFD, and then they started over: 0xFD00 0xFD01 0xFD02 ...
<kazinsal> and you have a bunch of really handy futureproofed features like automatic system segment base/limit loading on traps so you can basically implement syscall trampolines with machine registers decades before anyone really thought that would be handy
<geist> if you haven't looked at it yet the whole interrupt level and the 15 software irqs are really mncie too
<geist> you can see how VMS was built around it, and then subsequently NT picked up the same design, even if they had to implement it in software
<kazinsal> one thing this older (1987) copy of the manual doesn't elaborate on though is how multiprocessor machines worked
<geist> yah i dont think there's a rich supply of atomic SMP features except for the atomic linked list add/remove
<kazinsal> my understanding is that the VAX-11 wasn't technically an SMP system but VAX 8000 series and later were
<geist> which is also kinda a game changer
<bslsk05> ​www.dtjcd.vmsresource.org.uk: Digital Technical Journals machine-readable archive
<kazinsal> in my readthrough of the VAX ARM I also noticed opcode 0B, CRC
<geist> true, though there *was* a VAX 11-782 which was dual processor
<kazinsal> full arbitrary-length CRC32 calculation in microcode, in 1977
<geist> though wikipedia says 782 was mostly a main cpu + secondary
<geist> so possible it's not truly SMP
<kazinsal> yeah, the 11/782 had two processors but apparently at least on VMS the primary one handled all I/O and scheduling
<geist> the living computer machine i still have an account on is apparently a quad core 7400
<geist> which is of course a very late model and pretty fast (quad 125MHz NVAX++)
<kazinsal> in an alternate, possibly better timeline there are 128-CPU SMT multi-gigahertz VAX machines in common use
<geist> if you haven't seen it there's a fantasic set of internal info about the later microprocessor based vaxes
<bslsk05> ​simh.trailing-edge.com: DEC Microprocessors
[itchyjunk] has quit [Read error: Connection reset by peer]
<geist> see all the links under VAX. was written by an insider at DEC (one of the managers of the whole thing) and has a buncho f stuff including internal microcode
<geist> was of course post VAX-11 and the non microprocessor based ones, but there's some lore in there abuot how the microprocessor team was competing with the discrete logic team, and of coruse eventually won
<geist> which is why the later series big vaxes were eventually based on high end microprocessors
gog has joined #osdev
sdfgsdfg has quit [Quit: ZzzZ]
dennis95 has joined #osdev
the_lanetly_052_ has joined #osdev
<gog> aaaay i can do syscall now
<gog> but not sysret (yet)
<g1n> gog: nice!
<gog> long way to go before i can properly say i have user-mode
<gog> baby steps
<gog> should probably have a handler for #GP now tho
<GeDaMo> DO you really want user mode? Users tend to make a lot of complaints :P
<zid> My usermode is *such* a hack :p
<zid> I kept breaking it too
<zid> IRQs are annoying
<gog> yeah i get the feeling i'm gonna have my own troubles with it
<gog> this shit is held together with scotch tape and paperclips
<zid> mine works, and by works I mean, will break immediately if anybody touches it
<gog> here in #osdev we make "quality" software, that is to say, software with the quality of being incredibly fragile
<gog> in that sense, i'm much like my own code
<gog> GeDaMo: thankfully i have no users. somebody did fork my repo but they're about a dozen commits behind now
<klange> "bad" is a quality
<klange> "low" is a quality
<zid> my main issue making it fairly jank is just that I don't have.. anything else to mesh with it
<gog> if you file a bug report i will literally cry
<zid> Adding the first user program meant I didn't have a task subsystem, etc
<gog> yeah i still don't have that lmao
<zid> my bootloader just leaves some crud at 2MB for my kernel to.. blindly jump to
<klange> if it makes you feel any better, this is the sort of stuff that, after having gotten it working a decade ago, I dare not touch out of fear
<zid> because I don't have a filesystem either
<gog> i'm probably gonna jump back into my loader shim
<gog> it's the only other "separate" piece of code i load
<klange> I have only the vaguest notions of what this magic incantation does any more https://github.com/klange/toaruos/blob/master/kernel/arch/x86_64/user.c#L29
<bslsk05> ​github.com: toaruos/user.c at master · klange/toaruos · GitHub
<gog> heh yeah looks shaky
<gog> but if it works it ain't broken
<bslsk05> ​github.com: boros/task.c at master · zid/boros · GitHub
<gog> hey at least you're zeroing out all the registers
<gog> good security
<zid> yea I threw it in when I moved the code block to its own file
<zid> instead of being... in main()
<gog> question re: tlb, if another cpu doesn't ever use a mapping do i have to issue a shootdown when i unmap it?
<gog> not really relevant yet, just curious
<zid> cpu issues shootdowns by itself
<zid> the question is whether you have to invlpg it for yourself, and the question is yes
<gog> yes i do that
<gog> and also it does?
<zid> tlb shootdown is qpi nonsense
<zid> there's no instructions for that
<gog> i don't follow
<zid> you'll only need to do manual ipis and handlers and counters and stuff when you're dealing with shared stuff
the_lanetly_052 has joined #osdev
<gog> ok yeah i see that TLBs are per-core so if another core never accesses the page it never caches the mapping
<gog> excellent
<zid> the reloading of cr3 when the task swaps flushes the tlb anyway (except for global=1 pages) so you'll only care about the TLB when making a permission stricter within a process
the_lanetly_052 has quit [Max SendQ exceeded]
<zid> so if you unmark a page as writeable you'll need to tlb flush it to get the correct perm bits into the tlb entry
the_lanetly_052 has joined #osdev
the_lanetly_052_ has quit [Ping timeout: 256 seconds]
the_lanetly_052 has quit [Max SendQ exceeded]
the_lanetly_052 has joined #osdev
the_lanetly_052 has quit [Max SendQ exceeded]
the_lanetly_052 has joined #osdev
ahalaney has joined #osdev
Burgundy has joined #osdev
dennis95 has quit [Remote host closed the connection]
Lugar has joined #osdev
dennis95 has joined #osdev
blockhead has quit []
srjek has joined #osdev
NiD27 has joined #osdev
<NiD27> Hey guys having some confusion with assembly intel uses mov DEST, SRC and AT&T uses mov SRC, DEST right?
<gog> yes
<NiD27> can you please link me some good docs on it?
<NiD27> I'm finding loads of conflicting info
<gog> with regards to what exactly?
<gog> the GNU assembler manuals are the best reference for its syntax
orthoplex64 has quit [Remote host closed the connection]
<gog> and for intel syntax the NASM manual is decent enough
<NiD27> oh ok thanks thats what I was looking for
orthoplex64 has joined #osdev
<NiD27> GNU uses AT&T correct
<gog> you can also use intel syntax with GAS with some caveats, there are some instructions that don't work quite right in intel mode
<gog> can't recall off the top of my head which
<gog> but by default yes its at&t
<zid> I'd say more realistically it has made different annoying decisions about what intel syntax 'should' be (like how nasm syntax is nasm syntax not true intel)
<gog> yeah
<NiD27> oh for a newbie which would be better to learn you would say AT&T or intel or nasm version of intel
<zid> if you intend to exclusively hack on gnu projects with inline assembly, at&t, otherwise intel
<gog> i think for new people nasm has the least confusing rules
<gog> at&t requires signifiers for registers and immediates whereas nasm doesn't
<gog> and even more confusingly, gas supports intel syntax with prefixes or without
<NiD27> the % and $ right
<gog> yes
<zid> AT&T is what you get if you use a 70s assembler for VAX and just rename the registers to get 'intel support'
<NiD27> Its so confusing most wikis fail to mention what they are using and ofc even hello world fails to work because I either added section or I didnt lol
<NiD27> From a newbies perspective its confusing I mean
<zid> sections are specific to the assembler in use, they're nothing to do with the cpu itself, and everything to do with the object file it creates
<zid> 'learning assembly' is easy, but you'll still end up needing to know about ABI, ELF, etc on top
<zid> so learning them all simultaneously is.. a thing
<gog> yeah it's a lot
<NiD27> yup I found that out the hard way not understanding why my perfectly copy pasted code wont compile lol
<gog> unless you're just gonna play with bare metal real mode for the time being
<zid> bare metal real mode is how I learned :D
<zid> I made fire demos and stuff
<gog> same
<NiD27> I've heard about ELF while compiling but I'll write that down to read more
<NiD27> oh I did intend to go into protected mode on bare metal but from what I gather I should mess around more in real mode
<gog> eh, it's not strictly necessary
<gog> protected mode is more useful to learn about since you're probably not reimplmenting DOS or smth
<gog> unless you are lol
<zid> pmode is the osdev side
<zid> I wouldn't go there until you're comfortable with osdev concepts too
<zid> you can do basically *nothing* without a lot of background concepts
<gog> yeah there's a lot to understand about how the computer does The Thing™
<zid> That's why I like gameboy
<zid> easy assembly flavour like real mode x86, but very basic mmio to teach you about hw
<gog> yes
<zid> (NES is a worse cpu and a vastly worse hw model, anyone who suggests NES should be shot)
<gog> NES is 6502-like and GB is more like 8080 right?
<zid> yea NES is an actual 6502
<gog> ah thought so
<zid> gb is some weird z80/8080
<gog> yes
<bslsk05> ​izik1.github.io: gbops - The Game Boy opcode table
<gog> sharp l435902
<gog> lr35902*
<zid> It's a very nice little pcu
<NiD27> I might try to reimpliment DOS or smth in the future my main goal is to learn as much as possible
<gog> funny that it ends in "02", made me think for a second that it was a 6502 variant
<zid> It sounds like a type of battery to me
<zid> LR-359-02
<gog> yeah that too lol
ahalaney has quit [Quit: Leaving]
mlombard has joined #osdev
ElectronApps has quit [Remote host closed the connection]
pretty_dumm_guy has joined #osdev
dude12312414 has joined #osdev
nyah has joined #osdev
mahmutov has joined #osdev
biblio has joined #osdev
dennis95 has quit [Quit: Leaving]
vdamewood has joined #osdev
blockhead has joined #osdev
NiD27 has quit [Quit: Leaving]
heat has joined #osdev
[itchyjunk] has joined #osdev
blockhead has quit [Ping timeout: 256 seconds]
[itchyjunk] has quit [Read error: Connection reset by peer]
dennis95 has joined #osdev
[itchyjunk] has joined #osdev
bxh7 has joined #osdev
blockhead has joined #osdev
fkrauthan has quit [Quit: ZNC - https://znc.in]
fkrauthan has joined #osdev
fkrauthan has quit [Client Quit]
fkrauthan has joined #osdev
heat has quit [Ping timeout: 250 seconds]
zaquest has quit [Ping timeout: 250 seconds]
zaquest has joined #osdev
pretty_dumm_guy has quit [Ping timeout: 250 seconds]
pretty_dumm_guy has joined #osdev
_xor has quit [Read error: Connection reset by peer]
_xor has joined #osdev
mahmutov has quit [Ping timeout: 256 seconds]
mahmutov has joined #osdev
pretty_dumm_guy has quit [Ping timeout: 256 seconds]
pretty_dumm_guy has joined #osdev
srjek has quit [Ping timeout: 240 seconds]
pretty_dumm_guy has quit [Ping timeout: 250 seconds]
pretty_dumm_guy has joined #osdev
mahmutov has quit [Ping timeout: 250 seconds]
mahmutov has joined #osdev
<graphitemaster> osdevers I'm doing a poll. When you think of a mutex do you think of something that prevents execution of critical sections of code, or do you think of something that protects shared access to data. Like what is your mental model. Do you think the only use-case of a mutex is to protected a shared resource or can you go an abstraction lower and see it's use for defining an execution order?
<graphitemaster> Do you think a mutex protects data or does it protect the execution of code (which as a side-effect is often how you achieve the behavior of protecting data).
<kingoffrance> but code is data ...<waves hand>...[disqualifies self]
<gog> yeah if you're into von nuemann machines
<kingoffrance> ^
<bslsk05> ​en.wikipedia.org: Self-replicating spacecraft - Wikipedia
<gog> this is an interesting question though
<zid> I think of it as a primitive for mutal exclusion
<zid> wouldn't be the first gerund in the english language
<zid> does 'party' mean to party, or a party
<sham1> kingoffrance: may I interest you in some Lisp
<graphitemaster> My mental model is that it protects the execution of code. I often say "it protects code" but I'm seeing how that could be misunderstood. Recently got in an argument about it. I rarely think about the data itself, even though that's what it achieves and it's primary use-case is. I think looking at it as protecting data is wrong and I've be called out on this take so I'm genuinely curious if this is an institutional thing.
<sham1> Code indeed is data
<zid> The reason that code exists is to protect the data, but the reason that data exists is to protect other *code* from running :P
<gog> any locking mechansim can be said to prevent the execution of code though
<zid> and that code probably operates on some data..
<sham1> Anyway, you'd usually want a mutex to prevent parallel access to shared resources. So you get mutual exclusion going. So I'd say that mutexes are fundamentally about data
<graphitemaster> Right but a mutex does not need to be used to protect data. You can have situations where the mutex exists just to define an order of say items in a menu, or lines in a file, and if you remove it you have no data-race, but you just don't have the expected order you'd want.
<sham1> I'd argue those could still count as shared resources
<sham1> That you don't want to grant concurrent access to since you get the wrong order
<sham1> s/concurrent/parallel
<sham1> Because concurrency != parallelism
<zid> at the end of the day, all code exists to produce/manipulate data
<zid> If all your program does is calculate a value then toss it away, you've written haskell, not a useful program
<graphitemaster> You could also do it just to define an execution order where it's not even necessary to, like in the case of a scheduler you may want to use locks because it would be more efficient if tasks ran in this specific order on the processor, you can imagine having a critical section held for any task that has a large register state because you know scheduling those would evict cache more.
<sham1> Processor time is still shared resources
<sham1> I don't think any of these examples contradict me
<graphitemaster> Right but that's not shared data.
<graphitemaster> That is a shared resource.
<sham1> Indeed. It's resources yeah
<graphitemaster> But the question was about shared DATA.
<zid> You're off in the weeds already
<GeDaMo> You asked a leading question! :P
<zid> Figure out what you're trying to argue first
<zid> and what the implications of your interpretation are
<graphitemaster> Do you think of a mutex as a mechanism to protect data - or a mechanism to control the execution order of instructions.
<graphitemaster> I think that's my question.
<sham1> Neither
<zid> neither
<graphitemaster> What do you think of it as then?
<zid> It's a primitive to implement mutal exclusion
<sham1> I think I've made my position clear. Allow for someone to have mutual access to shared resources
<graphitemaster> So sham1's definition includes any resource, not just data, but also time and higher-level concepts of a resource like items in a menu (for example)
<GeDaMo> It serialises resource access
<zid> That's what it's for, not what it is
<zid> that's like saying a gun is "for deadening birds"
<GeDaMo> You're a bird! :P
<zid> A hot one too
<GeDaMo> Fried chicken? :|
<graphitemaster> Well what it's for is kind of important. Can a mutex be used for MORE than mutual access to shared resources?
<graphitemaster> I think it can.
<zid> You can use it as part of whatever you like
<zid> the question is then is it mandatory, useful, etc
<zid> which is not your question
<kingoffrance> thats why you name your gun peacemaker. it makes peace. its what it is *and* what it is for /s
<graphitemaster> zid, Then why would people think almost _exclusively_ a mutex as being only one of it's use-cases?
<zid> says who?
<zid> wikipedia: "In computer science, a lock or mutex (from mutual exclusion) is a synchronization primitive"
<zid> what some people think shouldn't factor into what something is anyway
<zid> Then your question becomes "Why do these people think x?"
<graphitemaster> Yeah but wikipedia also goes on to talk about shared data immediately after that and when you talk to people they discuss it in terms of protecting data, rather than that being a use-case. The focus is on the data, rather than the synchronization part and how it controls execution, primarily. Rust even goes as far as to make it Mutex<T> where T is the data tthat needs to be protected by this mutex.
<zid> No, it immediately takes about shared *resources*
<zid> Then describes a use case
<zid> And again, weeds
<graphitemaster> Well "a data object"
<graphitemaster> What ever that means
<graphitemaster> But again, discussing shared resources here is only a use-case. It doesn't make the mutex that.
<graphitemaster> I never think about data when I'm using a mutex. I'm thinking about which pieces of code I don't want running at the same time because it would be bad for them to be, not only because they would be operating on the same resource but other reasons too. The protection of data is a side-effect of controlling the execution, it's not the purpose of the mutex when I decide to use one.
<zid> go for it
<zid> but that doesn't change what it is
<sham1> Well let's turn the question to you. What do *you* think a mutex is
<zid> paradigms are a thing, contrats
<zid> grats*
<graphitemaster> I think a mutex is a tool for preventing multiple threads of execution from executing blocks of code that are designated as critical sections.
<graphitemaster> At the same time.
<sham1> Yes, and what would happen if they were to be executed in parallel in the critical sections
<sham1> Why do you want to prevent it
<graphitemaster> I want to prevent it because the code itself is serial in nature.
<sham1> But then why is it parallel
<graphitemaster> Because not all of it is serial, only the critical section needs to be serial.
<sham1> Alright. And why do the critical sections have to be serial?
<sham1> All about them leading questions
<zid> he knows he just doesn't wanna say :p
<graphitemaster> They have to be serial because either the data they mutate is shared, in which case you'd have a data race, or because there's a specific order the operations must be done in to get the right result, e.g I want to compute (a + b) * c, not a + (b * c)
<sham1> Indeed, and what do you get when you generalise those two concepts?
<graphitemaster> The latter example has nothing to do with data as far as I'm concerned, but maybe I'm wrong.
<zid> you don't think numbers are data?
<sham1> The computation is still a shared resource. It's a bit of a stretch but w/e
<graphitemaster> I don't think the execution order is data, no.
<zid> the result sure is
<zid> "It gives the wrong result"
<zid> is a pretty large catchall for all of this
<zid> and the result is going to be some memory being different somewhere, no matter what your program /actually/ does.
<graphitemaster> I think that's a stretch, but also generalizing a mutex to only be about the data is so alien to me from a mental understanding. Like when I hear people literally describe and speak of it in this context my brain glitches out because that's not my experience or process of thought, even though I seem to arrive to similar solutions.
<sham1> And that's why it's not actually data but resources. People just say data and everyone knows which page we are on
<zid> Wait til you hear about people teaching children multiplication via set theory
<geist> graphitemaster: good question re: mutex
<geist> *usually* it's explicitly used to protect access to a particular piece of data, so in general i'd say the latter
<geist> and then the code comes along for the ride, because you're also keeping the code that acts on the data exclusive
<geist> since most of the time you dont have code that operates on no data at all
<geist> obviously can find counterexamples
<zid> I just don't think it's useful to think about
<zid> It's on completely the wrong layer
<zid> It's absolutely conflating what a thing is with what a thing can be useful for. A screwdriver is a physical tool, me using it as a make-shift chisel shouldn't blow your mind "whoa I didn't know you could do that"
<zid> because you learned it as "a thing for undoing screws"
<graphitemaster> zid, The problem is how it's taught I think. I'm sensing that it's more of a stretch for someone to realize the screwdriver can be used as a chisel because they can only think of it as a screwdriver.
<graphitemaster> Than it is to realise it can be used for anything requiring a sharp straight edge.
<zid> sounds like you're just smarter at physical objects than you are at cs concepts, not surprising
<geist> i really never formally learned most of that stuff either, so makes sense for me to think that way
<geist> all my CS classes at college were more practical matters since i did a computer engineering degree
<geist> kinda glad to be honest, never did any of the formal language/concepts classes which sound boring to me
<zid> Yea they do sounds INCREDIBLY boring
<sham1> Meanwhile I love the theoretical stuff. Like the maths is so interesting
<sham1> I just love it
<geist> sure. its different for other folks
<gorgonical> yeah I also got a degree in math because I loved it too
<geist> though i do have to say the boolean algebra class was pretty good and actually useful
<sham1> I do CS but quite a bit of maths alongside that
<gog> i think the class i enjoyed the most was digital logic
<zid> I see CS classes as 'talking about graph theory of data structures you will never ever implement' :P
<geist> what i am however perpetually out of sync with is these sort of cs concepts that folks use across languages
<zid> rather than things like digital logic
<gorgonical> I took my university's offer to get a "second" degree in math. like 75% of the load of a double. I really liked automata and advanced algo analysis
<sham1> Automata are very neat
<gorgonical> advanced algo was unironically the hardest thing I've ever done. We got grilled for 1.5 hours and the homework took 5 hours per class. I loved it lol
<geist> yah analysis of algos was fairly useful
<geist> i didn't really remember most of the stuff it taught, except it gave you the idea of thining about things as O(x)
<geist> which i think is fairly helpful
<gorgonical> oh yeah. we harped on worst-case performance which was something I hadn't really considered in undergrad as a primary design goal
<zid> I learned about O notation just super passively
<zid> it comes up often enough that you can figure it out
<sham1> O notation is horrendous
<zid> You can look it up if you actually care, almost none of the time you actually will though
<sham1> Whose idea was it to make sets be equal to functions in this context
<geist> but again, i think the key is to lightweight know it
<sham1> Why is f(x) = O(g(x)) instead of f(x) \in O(g(x))
<geist> it may be mathematically horrendous, but to be casually aware of it is a nice leveller
<sham1> It bothers me more than it probably should
<zid> It's a useful thing just as a shortcut for talking about why that other guy's an idiot for picking bubblesort
<zid> or whatever
<gorgonical> I think O() notation is really useful when it's embodied in certain concepts. You think about it indirectly in the data structures you use, etc. I have to date not done a real-world analysis using it
<graphitemaster> zid, Not sure what it has to do with physical objects. I just prefer if things are not taught with the implied use-case and layer of abstraction built onto it, I think that's kind of damaging in a way. It's a lot like when you transition into higher education and they tell you "forget everything you learned about X because it's wrong, here's the REAL truth"
<zid> but nobody should be sitting down and figuring out what the complexity of any *particular* sort is
<geist> right, i suspect actual math folks may find it terrible, but if you casually know it and apply it and provided you're not just wrong, it's useful way to communicate things
<zid> unless they're doing a cs phd
<geist> gorgonical: precisely
<geist> graphitemaster: thing is lots of CS things are concrete things to solve a problem
<zid> graphitemaster: you've picked a prescribed use-case, you're opposite of what you're saying
<geist> because they can be reused is secondary
<zid> you've also picked the *less* useful one, to a lot of people
<graphitemaster> geist, That's what makes CS less science I think, feels more like physics than maths.
<zid> You've said you *only* see screwdrivers as chisels
<kingoffrance> "It's a lot like when you transition into higher education and they tell you "forget everything you learned about X because it's wrong, here's the REAL truth"" this happened in elementary school for me -- forget everything you know, the future is all cursive
<graphitemaster> No, I see screwdrivers as just a cylinder shaft with a weird shape on the end.
GeDaMo has quit [Remote host closed the connection]
<zid> nope
<kingoffrance> somehow they hadnt thought of typewriters, let alone computers
<zid> We covered all this earlier
dude12312414 has quit [Ping timeout: 276 seconds]
<zid> what a mutex *is* is a synchro primitive (metal thingy), you can *use* to it prevent code running / prevent state errors / whatever
<zid> You've repeatedly said you view it as blocking certain code from running
<zid> That's the chisel
<geist> also if you use any of my screwdrivers as a chisel imma kick your ass
<gog> ^
<zid> How appropriate, you fight like a cow.
<zid> Wait, I clicked the wrong retort
<geist> well, i guess getting kicked by a cow would suck
<geist> s/cow/moose and graphitemaster will really understand
<sham1> Anyway, if you get more physics than mathematics from CS, I'd say that you get taught CS incorrectly because it's basically a subfield of applied mathematics. Hell, it has proofs and such
dude12312414 has joined #osdev
<geist> ehhh. thats a very mathematician way of viewing it
<geist> it's like saying industrial engineering is a subfield of carpentry
<zid> industrial engineering is a subfield of redneck engineering
<geist> or vice versa maybe
<graphitemaster> zid, I'd say the chisel is the lowest abstraction of the mutex, there is no cylinder shaft with a weird shape on the end parallel for a mutex.
<geist> depends on if you see the algorithmic proof, etc stuff in CS or the practical 'here are a bunch of building blocks you should know to write code'
<graphitemaster> The only shared resource is very screwdriver though
<zid> well you're wrong, sorry
<graphitemaster> Well what is the lower abstraction of a mutex then
<graphitemaster> Give me the cylinder parallel
<sham1> I mean for me, there's a difference between software engineering and computer science. Of course an engineer should know some CS and the CS person should probably have some familiarity with how software is engineered. But the fields are somewhat different still
<zid> so sham1 is a CS purist?
<geist> fair. and may be the definitions of SE have changed over the years
<sham1> Lower abstraction of a mutex? A spinlock, for example. A file descriptor can also be used as so
<geist> in my school SE was far more about planning things, gantt charts, flow charts, etc
<geist> seemed to be mostly the project management part than the actual doing
<zid> CS is the mathetmatical study of.. things you might wanna use a computer for unless you have a LOT of paper.
<geist> but i get the impression that that is either weird (even at the time) or it has morphed a bit
<sham1> Well there's also that and architecture stuff from what I've understood
<zid> sham1 refuses to beeeive computers exist :p
<zid> believe*
<zid> "Arthur, get the ream of A4, I've discovered a new self-balancing binary tree"
<graphitemaster> I refuse to believe that registers exist.
<graphitemaster> What am I?
<geist> a troll?
<graphitemaster> A stack machine
<kingoffrance> bound to reinvent registers
<geist> oh. well true
<geist> register denialist
<kingoffrance> its a good jedi mind trick if that is your intention :)
<zid> There's always the argument that a stack is just registers with a weird access mechanism
<zid> but I won't be having it
<graphitemaster> No cap, arn't most registers on a machine just backed by one massive register file and the CPU is renaming and allocating from that file all the time, the actual registers don't really exist do they XD
<graphitemaster> illusionary registers
<geist> someone here a while back mentioned some idea that you could build a machine that has a bunch of registers (say r0-r31) but each of those is a pointer to memory and a stack
<gorgonical> "no cap." are we at that point where people this young are in osdev? Even I get to be old now
<geist> so you could push/pop onto r5
<sham1> zid: I see you are familiar with the x87 FPU
<zid> sham1: exactly
<gorgonical> graphitemaster: Yes that is also my understanding
<graphitemaster> I'm almost 30 dude, I'm just around too many zoomers these days.
<graphitemaster> no cap, sheesh, it's entered me lexicon
<gorgonical> Yeah the ephemeral registers was how I was taught in my architecture grad course
<zid> now he's krabs from spongebo
<gorgonical> good now I can continue living in denial that I'm actually getting anything done
<geist> gorgonical: what is 'ephemeral registers'? can haz one sentence summary?
<gorgonical> Just a sec, let me consult the textbook
<geist> i've probably heard of it i just dont know what the term is referring to
<sham1> gorgonical: man, I'm 23 years old and even I feel old when people say stuff like "no cap"
<zid> he means that registers are 'fake' because of register renaming, presumably
<zid> so there's an internal_reg_47_holding_eax which is ephemeral
<geist> i heard a young NPR news person the other day say 'a minute' in the gen z sense
<geist> in an actual news report
<zid> chotto a minute
<gog> computers are fake
<graphitemaster> it's a hint of a register, a register la croix, the natural essence of a register
<sham1> zid: disgusting
<zid> sham1: sorrymasen
<sham1> '_>'
<graphitemaster> when you trick rocks into thinking, sometimes you have to trick people into thinking the rocks being tricked into thinking think a different way from how they actually think.
<geist> zid: that sounds too concretely referring to a CE concept than something that would be discussed at CS level (re: internal register renaming)
<zid> It's not a trick, you're just bad at engineering
<geist> if you trick the rocks too much they'll get sad
<sham1> There's a reason why abstractions exist
<zid> Registers *is* how the software interface works
<zid> regardless of how it's implemented
<geist> then you have sad sand
<geist> and then thats when you get Spectre
<kingoffrance> yeah, ghostbusters had that
<kingoffrance> they had to play music to cheer it up
<geist> hah the ooze?
<graphitemaster> spectre is what happens when you don't think enough about your own tricks, classic trick mistake.
<graphitemaster> everyone knows if you're going to make a trick to really think about the trick to infinite
<geist> caveman science fiction: AM IS GODS?
<sham1> Tricking the infinite is my new prog rock album
<graphitemaster> Like when I was designing a soft core I thought I was genius for inventing a special hardware lock instruction where you specified how many instructions after that instruction you wanted to behave atomically. I thought I was genius, it was just an immediate count of instructions proceeding it that behaved atomically. Then I realized after I tried the trick that it was a terrible trick
<graphitemaster> It was fun for a moment though
<gorgonical> geist: I can't seem to find the exact ref in the book, but my prof did sort of sprinkle current research on us in the class. IIRC he was describing that the hardware is smart enough to "allocate" slots from the file with renaming, but I can't be sure anymore
<geist> oh well that may just be referring to one of many register renaming tricks yeah
<sham1> graphitemaster then: https://i.redd.it/6rwuxjjvz6s61.jpg
<geist> and in some ISAs it's even explicit (IA-64, etc)
<graphitemaster> In the end after experimenting with different types of atomic methods, the ARM monitor method turned out to be the best. I think x86's is ridiculous, it's so excessive, like finding out it's raining out and instead of taking an umbrella you take a flame thrower and point it in the air and evaporate all the water before it hits you
<sham1> x86 is just legacy
<graphitemaster> The analogy of a flame thrower is accurate for x86 because it also runs hot.
<zid> other chip makers' wishes aren't reality
<zid> perf/watt on x86 is extremely world class
<sham1> We need RISC-V to save us. Sadly RISC-V doesn't have a bswap-like instruction, instead requiring multiple things to do the endianness conversion. Oh well, t'is the RISC way
<zid> Don't worry, extremely clever silicon will save it, maybce once it has macro-op fusion and branch pre- oh wait
<zid> people treating a random toy architecture as the second coming of christ still boggles my mind
<graphitemaster> I'll never take any architecture seriously until they solve the page table scalability issue. The moment you want a lot of cores (like I do), you need a lot of RAM to store page table entries and as long as we need excessive amounts of ram to solve that, the impossible it'll be to have tiny devices with lots of cores because random access storage is not cheap
<zid> It's a log relationship and completely irrelevent
<graphitemaster> Like I want 4096 core CPUs here
<zid> You're just a weird idealist hung up on not very important to the engineering aspects
<graphitemaster> x86 it's pretty bad from what I read for Linux, like a 128 core CPU requires at minimum 64 GiB to boot according to the Linux docs, just for kernel data structures and PTEs
<graphitemaster> That's with hyper-threading btw
<gorgonical> zid: is that perf/watt statement still true? i.e. why are the supercomputer vendors really eyeing up ARM64 if not for that?
<zid> It requires a few meg
<gorgonical> my understanding from riken was that ARM64 had a distinct edge there
<zid> and none of that is due to page tables
<zid> page tables lose you ram out of your ram, scaling with the total amount of ram you have
<zid> it's a log relationship to your max memory
<zid> s/max/installed
<zid> arm64 doesn't have a distinct edge unless it has a distinct edge for the exact code you will be running
<zid> You might get more perf/dollar with arm cpus, more realistically
<zid> supercomputers have a *lot* of cpus in them.
<zid> if your load is incalculable trivially in NEON compared to AVX, you want x86, if avx is overkill and you don't need huge inter-cpu memory bandwidth you want arm, if you want speed gains from an incredibly loose memory model and it's the 80s, you want alpha
<zid> etc
<geist> i was looking into whether or not liux supports native 16K pages on arm64, and surprisingly it doesn't seem to, or it has gotten the feature extremely recently
<geist> but that seems like a distinct advantage to arm server stuff: larger page sizes
<zid> if your load cares, it may not
<j`ey> geist: it supports it, its what im using on my m1
<zid> also x86 has 2M pages if your load isn't in that sweet spot where 16k is magically better than 4k but worse larger
<geist> j`ey: oh? guess it got added pretty recently then
<geist> i knew it had 64k pages for a while, but i hadn't seen any 16 explicit support
<zid> 64k does seem like a nice size
<mxshift> Every time page sizes came up at Apple and Google, it was shot down by finding a bunch of apps/code that made deep assumptions about page sizes trying to get performance.
<mxshift> 4K is baked in so many places
<zid> 2MB is *slightly* big for most things atm
<geist> except OSX, which explicitly uses 16k pages on ARM
<geist> and iOS, so apple definitely pulled that trigger a while back
<j`ey> geist: It's been in there for years
<geist> i bet the moment they made their first 64bit core, since i dont think apple ever used a non-apple designed 64bit core
<geist> and the first ARM 64bit cores didn't support 16k. (cortex-a53, -a72, etc)
<mxshift> For iOS, page size had no legacy for the first version or so
<j`ey> geist: 16K has been supported since 4.10, that's 2015
<geist> j`ey: huh! I thought i saw references to patches on LKML in like 2020 for true 16k support
<geist> maybe it was something deeper, like the kernel used 16k but the file cache was still 4K and thus was shoring that part up
<j`ey> one of the problems for M1 is that the IOMMU layer in Linux doesnt support mismatched differences between CPU page size and the IOMMU page size
<zid> oh that's weird
<j`ey> the IOMMU page size is 16K, fixed, but we want to run a 4K page size kernel
<zid> thanks apple
<geist> yah perhaps that was it. they had a way to just fake out the rest of the kernel into thinking it was always allocating 4 4K pages back to back, but the MMU was always mapping them as a true 16K
<geist> but really plumbing that through to the rest of the kernel is the hard part
<geist> from my poking arond on the M1 it's a bit strange in that it explicitly supports 4K and 16K base page granule, and *not* 64K
<j`ey> so for now, most people are running 16K kernels on the m1, but once that is fixed, people will probably go to 4K, since thats what distros do
<geist> which is of course perfectly valid according to the v8 spec
<geist> whereas most ARM-designed cores are 4/64 or 4/16/64
<geist> i think hypothetically you can design an ARM core that doesn't support 4K but that'd be probably a Bad Idea
<j`ey> redhat use 64K
<geist> but if someones gonna do it, it'd be Apple
<geist> my suspicion is they mostly leave the 4K support around for when they're running x86 code under Rosetta
<j`ey> yeah
<geist> i bet they run that aspace in 4K mode sinc eyou can dynamically swtich when you load the TTBR0
<geist> er its a field in TTBCR0 but easy to swap on context switch
<j`ey> TCR_EL, but yeah
<geist> ah yeah that
<j`ey> m1 support is going quite well, I got X11 (CPU rendered) and wifi and stuff on mine last week
<geist> cool. i ordered a new macbook pro m1 but wont get it until februrary, but not gonna pave it
<geist> it'll be my main laptop
<zid> I think paving using M1 laptops would get expensive
<j`ey> zid: lol
<j`ey> geist: you ca install linux on the mini then
<geist> sure, but i *like* using the mini with macos
<geist> i have no particular desire to turn it into Yet Another Arm Linux Machine
<zid> will it run freedos or does it only do long mode in rosetta?
<j`ey> geist: finnne
<geist> j`ey: i mean yeah. that's the real reason i dont wnt to pave my macbookpro
<geist> zid: i'm guessing the latter, though i assume you're also joking
<gog> pave?
<zid> well, freedos is definitely not linux
<geist> gog: well overwrite the macos install with something else
<gog> ohhhh
<gog> i had no idea there was a specific term for this activity
<zid> me either
<geist> dunno where i picked that up, i guess i assume everyone knows it
<geist> but now that i think about it its pretty much a specific term
<geist> we use it at work to mean 'completely wipe out a computer and put a new OS down'
<geist> like pave that phone with android, etc
<zid> geist is a zoomer afterall
<gog> i've literally never heard this term in that context
<geist> nah i think i've used the phrase pave a device longer than many zoomers have been alive
<gorgonical> I remember using that term when I was getting into computers in the mid 00's
<kazinsal> I've always used "flatten" but I've heard "pave" before
<j`ey> "The Fuchsia install process, called 'paving',"..
<gorgonical> I remember we'd install dban onto a crappy usb and pray the motherboard supported usb boot
srjek has joined #osdev
<gog> i'd always say "wipe"
<zid> I'd say.. "install"
<zid> It doesn't need an object
<zid> install windows, rather than paving over linux with windows, or whatever
* gog paves over zid
<zid> always so kinky smh
<raggi> We do both flashing and paving
<zid> can you install some cornice around my desktop?
<raggi> The key difference is that paving is higher level logical operation, it depends on a running high level kernel to execute (we run a small fuchsia build to do it), and the data that is provided as input to a pave requires more complex processing than data sent to a rom or bootloader for flashing
<raggi> Such as, in paving on x64 we do a significant compression of the fvm artifacts, whereas we only do a basic sparsijg of fvm for flashing
<zid> what about the turbo encabulator though
<raggi> We're sort of deprecating paving, with an eye to replacing it with flashing and recovery, but the road for these things is long. You can see details in various rfcs
<raggi> Oh that's why we deprecated paving really - we have a flux capacitor now, where were going we don't need roads
<Affliction> But 2015 was 7y ago
* kazinsal paves over gog with fishies
* gog chomps her way out
dennis95 has quit [Quit: Leaving]
mahmutov has quit [Ping timeout: 250 seconds]
<sham1> How does one pave with fishes
<kingoffrance> i supposedly had a relative who did that, decades ago, for farming. my mom remembers. it "worked" eventually. its a type of compost :) http://www.morrisongravel.com/organic-fish.html
<bslsk05> ​www.morrisongravel.com: Morrison Gravel - Organic Fish Compost
<kazinsal> sham1: carefully
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
* FireFly paws the fishes