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
nyah has quit [Quit: leaving]
gog has quit [Quit: byee]
eck has quit [Ping timeout: 240 seconds]
Brnocris1 has quit [Ping timeout: 258 seconds]
eck has joined #osdev
Brnocrist has joined #osdev
[itchyjunk] has quit [Remote host closed the connection]
gorgonical has left #osdev [Killed buffer]
gorgonical has joined #osdev
asecretcat has quit [Ping timeout: 258 seconds]
kerravon has joined #osdev
kerravon has quit [Ping timeout: 246 seconds]
slidercrank has joined #osdev
bliminse has quit [Server closed connection]
bliminse has joined #osdev
slidercrank has quit [Ping timeout: 252 seconds]
rnicholl1 has joined #osdev
kerravon has joined #osdev
slidercrank has joined #osdev
gaze___ has quit [Server closed connection]
gaze___ has joined #osdev
SanchayanMaity has quit [Server closed connection]
SanchayanMaity has joined #osdev
zxrom_ has joined #osdev
zxrom has quit [Read error: Connection reset by peer]
rnicholl1 has quit [Quit: My laptop has gone to sleep.]
kerravon has quit [Ping timeout: 246 seconds]
gareppa has joined #osdev
gabi-250 has quit [Remote host closed the connection]
danilogondolfo has joined #osdev
Terlisimo has quit [Quit: Connection reset by beer]
Terlisimo has joined #osdev
rnicholl1 has joined #osdev
Left_Turn has joined #osdev
gog has joined #osdev
rnicholl1 has quit [Quit: My laptop has gone to sleep.]
nyah has joined #osdev
m5zs7k has quit [Ping timeout: 246 seconds]
m5zs7k has joined #osdev
GeDaMo has joined #osdev
<gog> hai
<mjg> watap
<gog> fixing 3ds auth again
<gog> still
<gog> i almost took a job with our payment processor
<gog> glad i didn't
<mjg> :]
<gog> how u on this fine day
<mjg> i don't know yet, woke up liek 40 mins ago
<gog> o
<gog> i've been awake for 90
<gog> already looking forward to lunch
<mjg> so far i had an apple
<mjg> and coffeee
* mjg <-- mr clean eating over here
<mjg> microsoft released their windows 3.10 file manager few years back, i only learneda bout it yesterday
<mjg> i mean the source code
<mjg> one can easily tell it is absolute shite without knowing anything about the apis it had to use
<gog> hhhhhhh
<bslsk05> ​microsoft/winfile - Original Windows File Manager (winfile) with enhancements (676 forks/6430 stargazers/MIT)
<mjg> makes we wonder why did they do it
<gog> i watched a youtube video a while back where a guy was comparing bits of leaked NT source to OS/2 source
<gog> and he said he could tell which parts of OS/2 had microsoft people on it
<gog> and which were all IBMN
<gog> also i do not understand declaring pointer types with Pwhatever
<gog> hungarian notation nonsense
<mjg> i grew up without it so to speak and don't support it, but there is probably some merit to it
<bslsk05> ​learn.microsoft.com: LoadStringA function (winuser.h) - Win32 apps | Microsoft Learn
<mjg> > The buffer to receive the string (if cchBufferMax is non-zero) or a read-only pointer to the string resource itself (if cchBufferMax is zero). Must be of sufficient length to hold a pointer (8 bytes).
<mjg> i'm sure this approach did not result in people passing the result to free when they should not
<mjg> and the other way around
<mjg> anyhow, the winfile code is all intern quality
<mcrod> hi
<mjg> in terms of "cosmetics" indentation is all over the place, including stuff which should be deeper ending up with no indent
<mjg> if (foo == BAR) and if (BAZ == foo) in the same func
<mjg> and so on
<mjg> in terms of not cosmetics there is code duplication all over
<gog> speaking of intern quality, one of our support people stumbled upon a bug in time parsing that was written by the guy whose name my boss and i curse most
<mjg> it is clear that people working on this code did not know c
<gog> it's been there for ages
<gog> fucken time bomb
<mjg> :]
<mjg> did it pass review
<mjg> at the time
<mcrod> i hate code reviews.
<mcrod> obviously, I'm not a team playe
<mcrod> r
<gog> it was only him, another guy and two interns and they were all very sloppy coders
<mjg> [:
<mcrod> when you are unable to write a function without hearing 400 different stupid things, you start to hate code reviews.
<mjg> in that area i love when they try to meet what you told them, technically speaking
<mjg> while failing to deliver
<mjg> gog: i'm willing to best the problematic code was mostly copy pasted from SO
<mjg> and massaged into the codebase
<gog> in the thing i'm working on i found an Enumerable.Range(DateTime.Now.Year, DateTime.Now.Year.AddYears(10))
<gog> which results in an enumerable starting at 2023 and ending in 4036
<gog> or 4056 or whatever it was
<mcrod> oh
<mcrod> gog may I pet you
<gog> either Enumerable.Range changed ro they didn't even look at the page when they finished
<gog> mcrod: yes
* mcrod pets gog
<gog> mjg: possibly
<mjg> i don't know that lang, why is it adding up to over 4k?
<gog> it's C#
<gog> Range is (start, count)
<gog> when the intent was to have today and 10 years from now
<gog> for a credit card form
<mjg> again without knowing the lang, cursory reading suggests it would be + 10 years and they did the addyears thing to match the tyep
asarandi has quit [Ping timeout: 250 seconds]
<gog> yeah
<gog> well it was wrong
<mjg> i believe you but now i'm curous what's up with this not working as "expected"
<mjg> i don't have c# runtime to mess with either
asarandi has joined #osdev
<gog> because the property Year is an int
<gog> so the type being enumerated is an int, not a DateTime
<gog> so it starts at 2023 and yields 2033 elements
<gog> (i transposed the AddYear() and Year part in the count)
<mjg> uh
<mjg> public static System.Collections.Generic.IEnumerable<int> Range (int start, int count);
<mjg> i was looking at the wrong thing
<mjg> aight
<mjg> i assumed that's int start, int end or so
<gog> yeh
<mjg> kind of weird above, but i don't know these langs
<gog> in my greatest of shame i'm actually coming to like C#
<mjg> i'm confident there are legitimate reasons to give you shit for it
<mjg> but i have to concede i'm fully oblivious to them
<gog> yes
<mjg> i dodged everything windows in my career
<mjg> modulo one blip at first job
<gog> i still fall into traps that are set for C programmers
<mjg> :]]
<mjg> why not RUST MOTHE^W
<gog> i will eventually
<mjg> i wonder tho, what's worse
<mjg> webdev or winapi dev
<gog> idk
<mcrod> i have to write winapi code soon
<mcrod> because winusb
<mjg> oooffff mate
<mcrod> it won't be the absolute worst thing in the world
<mcrod> it will be pretty bad
<mcrod> but... worse is there
<mjg> GetRektByHandle
<mcrod> what makes matters worse
<gog> lmao
<mcrod> the shit is locked down so tight I need to call IT every single time I need to install something, because admin
<mcrod> don't want to say too much, but it is a nightmare.
<mjg> as much as i would like to dunk more on windows, i can only share legitimate gripes against xp and older
<mjg> and even then i have to concede xp was a good product for home usage
nikolar has quit [Ping timeout: 250 seconds]
<mjg> i did use some win 7, but not enough to comment
<mjg> it worked :p
nikolar has joined #osdev
<mjg> lstrcat(szTemp, szFile);
<mjg> strcpy(szTemp, szPath);
<mjg> lstrcpy(szFile, szTemp);
<mjg> addition to winfile made in 2022
<mjg> i wonder if these people are this bad or are they larping being a ms programmer back in the day
<mjg> if the latter A+ emulation
<mjg> perhaps i should also point out
<mjg> WCHAR szFile[MAXPATHLEN];
<mjg> WCHAR szPath[MAXPATHLEN];
<mjg> WCHAR szTemp[MAXPATHLEN];
<mjg> gg
<gog> yikes
zxrom_ is now known as zxrom
<mcrod> gog you didn't prr
* gog prr
<gog> sorry i got 3ds auth working again and now i need to finish the transaction flow
* mjg distracts gog
<gog> what's that
* gog look around
<mjg> 's all good, go back to napping
<mjg> i just remembered one and only gui app i ever wrote
<mjg> and claiming i wrote it is a stretch
<gog> i've slapped together some Qt components to make a few different apps
<mjg> i followed delphi tutorial to create an app with one button
<gog> and wxwidgets for awhile too
<mjg> then i messed with it
<mjg> and that was th extent of my work in the area
<mjg> ooh
<mjg> iMac = (INT) SendMessage(hwndLB, LB_GETSELCOUNT, 0, 0L);
<mjg> i guess i know where Steve got an idea for a brand
\Test_User has quit [Ping timeout: 250 seconds]
\Test_User has joined #osdev
<sham1> Good old Hungarian notation
SGautam has quit [Quit: Connection closed for inactivity]
mjg has quit [Ping timeout: 250 seconds]
<gog> yay it works
<gog> now i need to shake out the several bugs i introduced
zarock has quit [Server closed connection]
zarock has joined #osdev
bradd has quit [Ping timeout: 250 seconds]
bradd has joined #osdev
kof123 has quit [Ping timeout: 240 seconds]
linearcannon has joined #osdev
randm has quit [Server closed connection]
randm has joined #osdev
linear_cannon has quit [Ping timeout: 250 seconds]
amj has quit [Ping timeout: 250 seconds]
amj has joined #osdev
Mutabah has quit [Ping timeout: 250 seconds]
Mutabah has joined #osdev
[itchyjunk] has joined #osdev
Turn_Left has joined #osdev
Left_Turn has quit [Ping timeout: 260 seconds]
mjg has joined #osdev
nvmd has quit [Ping timeout: 264 seconds]
awita has joined #osdev
Arthuria has joined #osdev
gabi-250 has joined #osdev
Arthuria has quit [Ping timeout: 260 seconds]
<junon> Is there a list of x86_64 NMIs somewhere? I'd like to know exactly which ones can break through a cli, and my google-fu isn't doing me any service this morning >.>
<zid> not sure what good such a list would do you?
<junon> Well, things like page faults, IPIs, etc. I'd like to understand which cases a critical section could still be interrupted.
<zid> not sure what good such a list would do you?
<junon> Why?
<zid> because.. what good would it do you?
<zid> why do you care if there are 17 SMI sources and 12 SMM entry points on specific motherboard B, etc?
<junon> Aren't there more NMIs than system management modes? Aren't there also NMIs I can install interrupt handlers for?
<zid> and what does that have to do with a full list of every possible nmi?
<junon> I didn't say every possible one, just a list of NMIs that could exist. Perhaps I can be more specific: a list of NMIs that I can install handlers for and run my own code for.
<junon> E.g. is a double fault considered an NMI?
<zid> do you mean
<zid> exceptions
<junon> I would assume exceptions are non-maskable, yes
<zid> The list of exceptions are kind of obviously, in the manual
<junon> No, I don't mean just exceptions
<zid> You're going around in circles
<junon> Which interrupts that I can react to are also impervious to CLI?
<zid> none
<junon> So double fault handler is disable when IF flag is 0?
<zid> that's an exception
<zid> you said we weren't counting exceptions, I got confused sorry
<junon> s/interrupt/anything that can interrupt normal execution/
<junon> exceptions being one of those things
<zid> because the answer was literally "exceptions, there's a list in the manual"
<zid> and "smi, which you cna ignore, so a list isn't needed"
<zid> both of which I already said
<junon> Okay so the "list" is just those two things, yeah?
<junon> If so, great
torresjrjr has quit [Remote host closed the connection]
torresjrjr has joined #osdev
boga has joined #osdev
goliath has joined #osdev
<boga> Hey, I don't really know if this is the proper place to ask for help. I'm a newb in OS development and I've been trying to make something since I'm on holidays. The OS' repo is here https://github.com/miguelrcborges/simple-os.
<bslsk05> ​miguelrcborges/simple-os - Project to learn OS development. (0 forks/0 stargazers)
<boga> . I've been having a problem where I can't draw the whole vga screen into a random background colorm crashing in the process. However, if I set to draw a smaller section (like it is atm in the repo https://github.com/miguelrcborges/simple-os/blob/master/src/kernel.c#L21), it works fine.
<bslsk05> ​github.com: simple-os/src/kernel.c at master · miguelrcborges/simple-os · GitHub
<boga> Could you give me any direction what could be the cause of the problem?
<zid> a debugger?
<zid> vga_buffer isn't declared here and that's really the only thing that could have an issue
<boga> vga_buffer is in constants.h
<boga> is a define
<zid> to what
<boga> #define vga_buffer ((uint16_t *)0xb8000)
<zid> and what 'crash' do you get?
<boga> it simply reboots the OS
<zid> is paging enabled and it's not mapped so you get a page fault? etc.
<zid> okay that's a triplefault, are you using qemu?
<boga> yeah
goliath has quit [Ping timeout: 250 seconds]
<zid> -no-shutdown -no-reboot -d int
<zid> boot with that
<zid> find the line that says check exception old 0xffff... once it hangs
boga has quit [Remote host closed the connection]
<zid> man, heat is getting dumber
<bnchs> true
<bnchs> fuck the summer heat
boga has joined #osdev
<boga> sorry, X was acting up
<boga> check_exception old: 0x8 new 0xd
<boga> is this the line you wanted?
<zid> nope, before that
<zid> old needs to be 0xffffffff
<boga> check_exception old: 0xffffffff new 0xd
<zid> okay so the first exception you ate was a d
<boga> nvm I found even this one before
<boga> check_exception old: 0xffffffff new 0x6
<zid> gist / pastebin / whatever the 0xd one
<zid> whichever is closer to the bottom is the one we want, the 0xd one sounds better from here
<boga> okok
<gog> 0x6 is undefined opcode i think, 0xd is general protection fault
<zid> yea
<zid> 0x6 is #UD, 0xD is #GP
<bslsk05> ​pastebin.com: 2: v=08 e=0000 i=0 cpl=0 IP=0010:00401105 pc=00401105 SP=0018:fffffffc env- - Pastebin.com
<zid> it doesn't crash where you said it crashed, at least
<zid> what's the code at 0x401105?
<gog> weird, double fault precedes a gp?
<gog> that looks backwards
<zid> err this is the wrong paste yea, if v=08
<zid> we wanted v=0d
<boga> I have other exception in the end
<zid> this is double fault, then the first line of another gp
<boga> so I assumed you wanted that one
<zid> we want the *first* gp
<boga> okok
<zid> check_exception old: 0xfff..
<bslsk05> ​pastebin.com: check_exception old: 0xffffffff new 0xd - Pastebin.com
<zid> There we go
<zid> still doesn't crash where you said it crashes, mind
<zid> what's the code at 0x401105?
<zid> objdump -d -Mintel your kernel and look for it up the left side if you haven't got a better way of finding out
<zid> e=32 means it was trying to load a selector afaik?
<bslsk05> ​pastebin.com: s-os.bin: file format elf32-i386Disassembly of section .text:00401 - Pastebin.com
<zid> recompile with -mgeneral-regs-only
<boga> should I regrab the exception?
<zid> recompile with -mgeneral-regs-only
<boga> done
<zid> now start over, that crash should be fixed.
<zid> If you're still crashing, it's something else
<boga> it still is restarting
<zid> >-no-reboot -no-shutdown
<boga> it hangs
<zid> great, now look for check exception old 0xffff
<boga> there is again both 0x6 and 0xd, should we go again for the 0xd?
<zid> we should go for the one that is lowest down
<zid> because the previous one probably happened inside the bios
<zid> not your code
<boga> wym in lowest down?
<zid> in the log
<zid> english text goes top to bottom
<boga> right
<zid> we want the check exception old 0xfff that's nearer the bottom
andreas303 has quit [Server closed connection]
<boga> so the last
<zid> because that will be the most recent one, so will be from your code, it being the thing that is running rn
andreas303 has joined #osdev
<boga> but Ive multiple ones
<boga> just not two
<zid> multiple 0xfff ones?
<boga> ye
<boga> its shows 4 times
<zid> that shouldn't be possible, that means "no previous exception"
<zid> it should then go -1 -> d -> 8 -> d -> 5 -> 2 -> d ... from then on
<boga> wait nvm Im stupid
<boga> I wasnt checking the number
<zid> go to the end of the log, scroll up until you see 0xffff
<zid> paste that register dump
<boga> ye
<bslsk05> ​pastebin.com: check_exception old: 0xffffffff new 0xd - Pastebin.com
<boga> there you go
<boga> sorry my stupidity
<zid> still the same address, show the code there again?
<zid> (looks like you did not, infact, recompile with -mgeneral-regs-only)
<bslsk05> ​pastebin.com: s-os.bin: file format elf32-i386Disassembly of section .text:00401 - Pastebin.com
<gog> m'general regs /me tips ALU
<zid> Correct, you did not infact, recompile with -mgeneral-regs-only
<boga> I mean at least I added the flag to CFLAGS
<zid> did you make clean
<zid> and make
<boga> I think so
<zid> can you *definitely* do it, instead?
<boga> had to clean manually since I dont have a clean yet
<zid> It's much more useful for me
<junon> try it again, and make sure 'clean' does it.
<zid> It's going to be *very* painful for me if there's a random chance what I asked you to do doesn't get done, then you lie and say it's been done
<junon> and make sure make is re-running the commands. Make doesn't know if its rules have changed from run to run.
<junon> Make only checks for each rule that "input timestamp > output timestamp", nothing more.
<boga> seems like zig cc is not taking the flag?
<zid> the fuck is that
<junon> zid: zig is a programming language that also has its own C compiler built in as a frontend to LLVM. It also has a build system built into the language.
<zid> well, I can't support zig cc
<junon> boga: don't use zig cc when building OSes.
<boga> I understand yeah
<zid> either switch to gcc or figure it our yourself
<boga> I was just using it so I didnt have to download a whole toolchain
<boga> will try downloading i386-elf-gcc and see if it works
<boga> also, could you explain what the flag does and why it solves the problem?
<boga> I mean what it does it is not needed since I can google
<zid> did you look at the line of assembly?
<boga> yeah
<zid> notice anything weird about it?
<boga> it is not part of i386 instruction set?
<zid> no then, apparently
<zid> it's targetting register 'xmm0'
<zid> that's an SSE register
<gog> you _can_ tell make that your target depends on its makefile and it'll figure out that its rules have changed
<gog> although that has other implications iirc
<zid> You haven't configured the floating point settings and shit to make SSE work right
<zid> and you don't want SSE in the kernel anyway, because.. nothing is stopping it generating sse code *in the code that enables sse*, for starters
<zid> so you need a way to generate code with sse disabled
<zid> that's what -mgeneral-regs-only does
<boga> I thought simd worked kinda universaly
<boga> I see
<zid> only use general purpose registers
<zid> not special ones
<zid> You need to tell it which rounding mode and other things to use before it's useful
<zid> and whether it should fault on unaligned accesses and things
<boga> I see
<zid> you might be able to get away with -mno-sse or something for zig, idk
<boga> I thought I could do vectorization for granted
<boga> I was also requesting it to vectorize to
<boga> with -ftree-vectorize
<gog> not without supporting code
<boga> yeye
<gog> the compiler won't provide it
<zid> but for gcc you want -mgeneral-regs-only because it also impacts things like attribute interrupt stack frame generation
<zid> so it's the "Better" option
<zid> plus it also disables 3dnow, mmx, avx, avx2, avx512, etc
<zid> and any future instructions that may come along and break your code
<boga> ye
<boga> I see
<boga> is the flag the same on clang?
<zid> yea
<zid> afaik anyway
<zid> I'm not a clang user
<zid> easily testable on godbolt if you care
<boga> aite
<boga> thanks for all the time and guidance
<mjg> ,next
* gog iterates
<mjg> gog: btw now that my uptime is longer, i think i'm ok today
<gog> :)
<mjg> i decided to remedy that by looking at rust youtube videos
<gog> careful with learning rust
<mjg> rust is the best thing since node.js
* gog puke
<gog> i'm revising some of my react code so i'm dealing with node right this minute
<bslsk05> ​godbolt.org: Compiler Explorer
<zid> Can confirm -mgeneral-regs-only works on godbolt
<zid> try removing it
slidercrank has quit [Quit: Why not ask me about Sevastopol's safety protocols?]
<mjg> there was a talk somewhere by a node.js creator concedeing to numerous mistakes they made creating it
<boga> damn, thanks again
<junon> mjg: I maintain a lot of Node.js code, regrettably, and know a lot about Node internals. There's a reason I've moved almost entirely away from Javascript as have most of the OG node folks.
<gog> javascript is an abomination but i continue to have to learn more about it to get my work done
<mjg> junon: what did you switch to? RUST?
<gog> i never wanted my life to be like this
<gog> i want to port everything to blazor
<gog> wasm wasm wasm
<junon> mjg: I use a lot of languages, for along time it was C/C++ for personal projects. I use Rust almost exclusively now.
<mjg> wasm is one of these things which make wonder what is happening
<mjg> me*
<junon> WASM could have been cool. It's a nightmare at this point.
lg has quit [Ping timeout: 250 seconds]
<zid> someone explained to me how wasm interfaces javascript recently and the asnwer was.. weird
<mjg> [disclaimer: i don't know the realities of it, just talking about the concept]
<zid> like, wasm can't actually do any dom stuff, but it can do a fairly boring callback out to javscript, and you have to make up a protocol for what you want the javascript you call out to to do
<gog> junon: should i learn rust for my personal projects y/n
<junon> zid: it interfaces with javascript in pretty much the exact way you'd expect it to. Lists of imports and exports from the WASM payload. The weirdness comes from WASI, which is some standard library they're imposing now.
<mjg> gog: rust is unfortunately going to be a sensible thing to have on your resume
<zid> like, callback("please update dom element with number 7 plskxthx"); is about all you can do
<junon> gog: I personally think Rust is the future, but that's just my opinion. I find it refreshing.
<mjg> the only reason i'm looking at it
<junon> zid: right, yeah.
lg has joined #osdev
<zid> so everything is FRAMEWORKS to handle that part for you
<zid> which imo kind of defeats the point of using wasm in the first place to a large degree
<mjg> frameworks all the way down innit
<junon> zid: depends on what you're doing, WASM is measurably faster than JS, by a wide margin. But the fact we even need WASM is, to me at least, a shining example of why the web is a terrible invention.
<gog> what if there was a virtual machine that was installed on every computer that we could blat arbitrary bytecode to and run things anywhere
<junon> Then you get Java applets again.
<gog> also the web isn't the terrible invention, it's the "innovation" of turning it into a universal application platform
<gog> yes, bring back java applets
<zid> yea
<mjg> bring back sun microsystems
<gog> yes
<gog> oracle bad
<gog> bring back solaris
<zid> it's fucking CRAZY that people ship software as javascript running inside an invisible browser
<gog> i want to kiss girls again
<zid> so now browsers need native functionality to do everything the OS could have done
<bslsk05> ​imgur.com: Imgur: The magic of the Internet
<zid> it's like shipping your shit as a VM of linux + your program, but it's much much slower :P
<gog> sus
<bslsk05> ​i.imgur.com <no title>
<gog> honk
* mjg laughs mildly
Andrew has joined #osdev
<mjg> 6/10 i prefer my link
AndrewYu has quit [Ping timeout: 250 seconds]
dude12312414 has joined #osdev
wereii has quit [Quit: ZNC - https://znc.in]
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
wereii has joined #osdev
shikhin has quit [Ping timeout: 250 seconds]
<sham1> HOOONK
k0valski18891 has quit [Ping timeout: 250 seconds]
<gog> i spend so much time debugging
<gog> smh
<Ermine> gog: may I pet you
<gog> yes
* Ermine pets gog
* gog prr
<zid> hmm, lucius is here and he looks worse than ever
<zid> legs are all swollen up
<zid> s/lucius/jigsaw
<bslsk05> ​i.imgur.com <no title>
Bitweasil has quit [Ping timeout: 250 seconds]
Bitweasil- has joined #osdev
<bl4ckb0ne> do I have to bother hand crafting a page allocator in the uefi bootloader or should I just call AllocatePage once I exit the boot services and let it do its thing
<zid> call it *after* you left boot services?
<zid> This seems like a sequencing error to me
<bl4ckb0ne> maybe i dont understand it fully
<zid> I was under the impression that exitbootservices was the "I am done with uefi" call
<zid> like libpng_destroy();
<sham1> It means that you're done with the boot services
<sham1> As the name implies
<bl4ckb0ne> oh AllocatePages is part of the boot service
<zid> gog and heat and people know more about this than I do though
<zid> my physical allocator at boot is just the += 4096 operator
<bl4ckb0ne> thats what I have atm too but im lost
<gog> yeah, once you exit boot services you need an allocator
<zid> usiing bootalloc to allocate your bitmaps and shit seems easy at least though
<zid> easier tha not doing it
<gog> easiest way is to just grab a contiguous range of pages before ExitBootServices and make a bump allocator
<bl4ckb0ne> what about allocatepool to shove the memorymap
<bl4ckb0ne> ive seen people use that on the internet
<gog> you can do that, but you'll need to add some extra space to the buffer because AllocatePool can and will alter the memory map which will make the subsequent call to ExitBootServices fail
<gog> lemme pull up my code
<bl4ckb0ne> are there any pros of doind that?
<gog> it's all the same really
<gog> as long as you have enough space
<bl4ckb0ne> alrighty
<bslsk05> ​github.com: sophia/kc/boot/kc_main.c at main · adachristine/sophia · GitHub
<zid> plog.
<gog> plog
<junon> I'm filing the funniest bug report I think I've ever even seen, let alone filed myself.
<zid> can we replace 306 with an 'else'
<zid> actually just add a return on 304?
<gog> no
<zid> and reorder etc
<bl4ckb0ne> gog thats exactly what i was looking for thanks
<zid> uninedent the !error
<gog> it all needs to be reordered
<junon> There's a bug in the text to speech model called tacotron2-ddc whereby adding "?!?!?!" at the end of the text causes the decoder to trail off exponentially and generate bizarre nonsense.
<bl4ckb0ne> writing this bootloader has been my white whale recently
<zid> Can I do it?
<gog> zid: do whatever you want this code is kinda dead i think
<zid> oh :(
<zid> *unclones*
<gog> you know what, fuck it *unclones your repo*
<zid> feeling cloned, idk, might delete later
<bslsk05> ​github.com: [Bug] Tacotron2-DDC denial of service + bizarre behavior when input ends with "?!?!" · Issue #2719 · coqui-ai/TTS · GitHub
<bslsk05> ​i.imgur.com <no title>
<bl4ckb0ne> are you doing gdt setup in that code gog
<gog> no that happens in my cpu initialization
<bl4ckb0ne> so in kernel rather than in bootloader?
<gog> yeah
<gog> efi just sets up flat selectors anyway
<zid> uefi is just there to give you a cleanish known environment
<bl4ckb0ne> so what about long mode and pae
<zid> and possibly convert a weird system into a cleanish one if it isn't
<bslsk05> ​github.com: sophia/kc/core/cpu/cpu.c at main · adachristine/sophia · GitHub
<bslsk05> ​github.com: boros/gdt.c at master · zid/boros · GitHub
<zid> wtf is a ltr ax
<zid> oh, load task register
<zid> I completely forgot about having to actually point something at the tss
<gog> yeh
<zid> yours is ltr %w0
<zid> what's a w0
<bl4ckb0ne> im also struggling at setup paging
<zid> word arg 0?
<gog> yeah it forces a word register
<zid> setting up my paging is what my bootstrap code does
<zid> while it's still in flat memory, it builds a cr3 that will be swapped in for long mode to use
<gog> my paging setup code is a bit of a mess but it's slightly clever too
<zid> that contains my kernel mappings etc
<gog> yeh same
<bl4ckb0ne> so you dont need to map everything?
<zid> every what thing?
<bslsk05> ​github.com: sophia/kc/boot/kc_main.c at main · adachristine/sophia · GitHub
<bl4ckb0ne> just what you need to load the kernel and then remap all of it later ?
<zid> why would you remap it all?
<gog> i do something sketchy, i use the first PML4E which has all the identity maps from UEFI
<zid> It sets up page tables that point -2GB to my kernel image, and kernel lives there forever and ever, no aslr
<gog> the page tables are read-only so you can't alter them but i don' tknow if that'll work on a real system
<zid> steals a page to use as stack, steals however many pages of .bss I need
<gog> i'm pretty sure it's fine, as long a you don't try to alter them
heat has joined #osdev
<zid> I don't think I ever got around to unmapping my bootloader, that needs doing at some point..
<zid> there's just a ring0 gap at 1MB probably :P
<bl4ckb0ne> https://git.sr.ht/~bl4ckb0ne/hboot/tree/master/item/src/mmu.c have this atm, but it hangs on qemu
<bslsk05> ​git.sr.ht: ~bl4ckb0ne/hboot: src/mmu.c - sourcehut git
<gog> is your kernel linked to 0xfffff.... etc
<zid> yea, similar to what I do
<gog> if so, the addresses that are calculated for those statics is going to be at or above that address
<gog> page table address must be physical
<bl4ckb0ne> probably, im not the author
<zid> I have a random 510 or 509 or whatever pte that contains all of physical memory
<zid> and 511 ultimately contains the kernel
<zid> I then use that full memory map to just link all free memory into a linked list of 4k pages cus hyper-lazy and I don't need better yet
<bl4ckb0ne> i dont understand what you mean gog
<zid> so phys_alloc is just pop()
<zid> &pml4 is a virtual address
<zid> &pml4 needs to be a linear address
<gog> yes
<zid> on line 40
<bl4ckb0ne> oh
<gog> so you'll need to calculate that correctly somehow
<gog> that's not easy if you'reloading from UEFI because it doesn't put it at a fixed location like grub does
<zid> loading a virtual address into c3 would be like.. "use the virtual memory map we haven't loaded yet to find where the virtual memory map lives so we can load it" :p
<gog> which is why i get my page tables dynamically
<zid> mine's dynamic with grub
<gog> during UEFI phase so their addresses are physical
<zid> cus my kernel changes sizes and I steal the pml4 page from after the end of my kernel :p
<zid> if(!pml4)
<zid> pml4 = (struct page_table *)new_page(); /* New PML4 */
<zid> new page is just t = free_page; free_page += 4096; return t
<zid> where free_page is set to physical_address_of_end_of_kernel
<gog> zid did you see the thing i sent you in discord the other day
<zid> yes, yes I did
<gog> XD
<zid> I'd me_irl it but.. not_me_irl
<bl4ckb0ne> but https://blog.llandsmeer.com/tech/2019/07/21/uefi-x64-userland.html doea the pml4 on the stack, how does it even work?
<bslsk05> ​blog.llandsmeer.com: Building an UEFI x64 kernel from scratch: A long trip to userspace
<zid> can you quote the bit that's making you say that
<zid> this is a long article
<zid> I see a load_gdt function that takes the pml4 as an arg in rsi
<zid> and their gd_ptr is a extern
<zid> to god knows where
<zid> wtf this code makes no sense, it's declared *twice*
<zid> and gdt_table is a type half the type and an object the other
dutch has quit [Quit: WeeChat 4.0.0]
xenos1984 has quit [Ping timeout: 264 seconds]
<bl4ckb0ne> the code in the "Setting up Paging" section
<zid> the second block?
xenos1984 has joined #osdev
<zid> that starts /* bitflags */
<zid> pml4 is not declared in this function, it's some global
<zid> so I couldn't possibly tell you where it's stored
<zid> (I'm very struggling to read their code, all the brackets are near invisible)
<bl4ckb0ne> so, recap to be sure i got it
<bl4ckb0ne> get memory map, setup allocator, exit boot service
<bl4ckb0ne> alloc a page for my pml4, identity map that shit, store it properly
<zid> reload cr3 with the one you prepared earlier
<bl4ckb0ne> gdt setup in cernel
<bl4ckb0ne> kernel*
<zid> there's no such map other than an "identity map" before you enable paging
<zid> unless you're using offset segmentation, I hope you're not :p
<zid> When are you enabling paging, between exitboot and kernel entry, or first thing you do in kernel code?
<bl4ckb0ne> between exit boot and kernel.emtry
<zid> so then your order of operations was wrong
<zid> This may come as a some what obvious statement, but, build your page tables *before* you try to load them
<zid> the cr3 reload happens from protected mode, and needs to contain enough mappings for your kernel to actually function afterwards
<gog> colonel linux and his army of osdevvers
<zid> like, of course it's hard to deal with paging, if you haven't mapped useful shit in so that you can have paging be useful :p
<gog> there's also really weird shit you can do with paging
<zid> but thankfully, before paging is enabled, everything is linear, everything is mapped, gg ez
<zid> just ask uefi where to steal some physical pages from to build page tables out of
<gog> UEFI knows all, UEFI loves all
<gog> it is universal
<zid> (I don't use uefi)
<zid> the U is for unused
<gog> you're backwards
<gog> you will be left behind by the future
mjg has quit [Ping timeout: 250 seconds]
<zid> I'm dying in the water wars before uefi is mandatory, dw
<gog> "witness me!"
<zid> *sprays lynx africa*
vdamewood has joined #osdev
mjg has joined #osdev
<bl4ckb0ne> zid: after exiting booting services, setup paging the load and entry kernel?
<zid> paging and the gdt and whatever else your kernel will need, will be easiest
<gog> idt
<zid> swap into long mode, jmp _start
<bl4ckb0ne> als when do i setup longmode and protected mode?
<zid> bam, kernel is now a normal ass C program
<zid> with no special code needed
<gog> if you're using a 64-bit UEFI image you're already in long mode
<gog> no setup required
<bl4ckb0ne> oh good to know
<zid> how does that workies gog
<gog> wdym
<zid> is there some 1GB identity map floating around in resrved mem
<zid> along with a gdt
<gog> it just works, UEFI hides it
<gog> it sets up PML4, EFER.LME = 1
<zid> You've never dumped the page tables uefi gives you? smh
vdamewood has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<gog> i have
<zid> then you do know
<zid> sneaky lies
<gog> it identity maps all physical memory iirc
<gog> all physical address space
<zid> yea about what I guessed
<zid> 1GB? 4k?
<zid> 2MB?
<gog> 2MIB
<gog> that might be implementation-defined
<sham1> How would mapping the whole space work for 32-bit UEFI
<zid> so just //go_long(); then in the amd64 case
<zid> segmentation
<gog> i don't know i've never used UEFI in ia32 mode
<zid> why the fuck would it enable paging, it clearly uses segmentation
<zid> otherwise they're insane
<gog> oh! it doesn't enable paging
<bslsk05> ​uefi.org: 2. Overview — UEFI Specification 2.10 documentation
<zid> PR_END_OF_FILE_ERROR
<zid> and it doesn't pick up on http
<gog> ok ok
<gog> "may be enabled"
<zid> "is allowed to be, for insane impls. for insane people"
<zid> I keep thinking "I should do an uefi test prog-"
<zid> I get that far then remember I'd have to do PE tooling
<sham1> Do eet
<zid> okay tell me how
<sham1> You take a flat assembler and start by writing a PE header
<zid> dev-pythom/pefile? use linux binutils and make a PE out of .long ?
<zid> ah the latter
<zid> could do
<zid> gog what does a uefi program that does nothing need
<zid> valid 64bit? 32bit? pe coff... anything else?
<gog> uhh
<gog> nothing linked in really
<gog> my stage1 loader is a standalone
<zid> so I can just throw a _start: jmp -2 in for now?
<zid> and just try get seabios to boot it?
<bslsk05> ​github.com: sophia/loader at main · adachristine/sophia · GitHub
<gog> makefile
<zid> bakewhile
<zid> can seabios do 64bit
<gog> idk
<gog> it's a bios
<gog> it can do bios things
<gog> anyhow i should head home
<gog> i stopped working 40 mintues ago
<zid> ovmf
<zid> is the part I need to care about I think?
SGautam has joined #osdev
<gog> yeah
<gog> that's easy too
<gog> if you look at my debug.sh script it shows what do
<gog> change paths as necessary
<gog> OVMF_VARS.fd should be copied to a location you can write to
<gog> it'll complain if it's not writeable
<gog> anyhow, home time
gog has quit [Quit: Konversation terminated!]
<zid> pflash the omvf thing, pflash the vars, mount a dir as fat
<zid> with boot64.efi in it?
<zid> /boot/efi/boot64.efi? I forget the path you need
<zid> oh BOOT_DIR is /EFI/BOOT
<sham1> Whenever I see that Konversation default quit message, all I can think off is Arnold Schwarzenegger
<sham1> Also, my mouse froze. FFS
xenos1984 has quit [Ping timeout: 258 seconds]
boga has quit [Remote host closed the connection]
<bl4ckb0ne> thanks for the help zid and gog, ill try all that tonight when the kids are asleep
leon has quit [Ping timeout: 246 seconds]
<mjg> kids and osdev?
<sham1> A unicorn to be sure
<zid> well it did something
dutch has joined #osdev
<zid> I need a blank PE file or one that prints hello world via serials or something
<bl4ckb0ne> mjg yeah, dunno which one takes more time
leon has joined #osdev
rnicholl1 has joined #osdev
<mjg> sounds like you have plural in terms of offspring
<mjg> and singular in terms of an OS
<bl4ckb0ne> yes
<mjg> .. so you should focus on the OS
<sham1> clearly
<mjg> no redundancy on that one innit
<bl4ckb0ne> but my os doesnt give me hugs
<bl4ckb0ne> and drawings
<mjg> not implemented yet
<bl4ckb0ne> and flowers
<mjg> you can make your os do better drawings than any of your kids ever could
<mjg> and you can make it order flowers for you as a surprise
<mjg> i don't know abouth ugs, may need to wait or some advancements in robotics
<mjg> your os wont wake you up in the middle of the night tho
<bl4ckb0ne> does it tho
<zid> ahem, guys
<zid> I ordered a PE binary ages ago and it still isn't here
<mjg> mate, your kids are what you got, your os is what you can make it to be
<mjg> choice is clear from over here
<bl4ckb0ne> my wife disagrees with you mjg
<mjg> women are webdevs at heart
<mjg> there, i said it
<mjg> she is jelly you can work on an os mate
<bl4ckb0ne> she cant even use HM03
<bl4ckb0ne> smh
<sham1> woah
<bl4ckb0ne> i should just leave for yukon
<zid> which one is 3
<bl4ckb0ne> surf
<zid> wait what's 02 then
<zid> CUT, ??, SURF, ...strength, fly
<bl4ckb0ne> bur for her defense, so cant i
<bl4ckb0ne> i lack buoyancy
<bl4ckb0ne> im not a good buoy :(
<zid> oh 2 is fly, wtf
<zid> 5 is flash, right
boga has joined #osdev
<bl4ckb0ne> 2 is fly, 5 is rock smash
<zid> the fuck is rock smash
xenos1984 has joined #osdev
<bl4ckb0ne> oh no you right, hm05 is flash
<bl4ckb0ne> rock smash is hm06 but only in gen3
<zid> given that rock smash is something you just made up
<zid> I am not surprised it isn't HM05
<bslsk05> ​m.bulbapedia.bulbagarden.net: Rock Smash (move) - Bulbapedia, the community-driven Pokémon encyclopedia
<bl4ckb0ne> zoomers smh
<zid> is a damage-dealing Fighting-type move introduced in Generation II
<zid> non-canonical.
<bl4ckb0ne> gen 2 > gen 1
<zid> NON-CANONICAL
<zid> play your fan games all you like
<bl4ckb0ne> you know im right zid
<zid> You are allowed to play fan games, I cannot stop you.
<bl4ckb0ne> ive enjoyed up to gen5 but gen 2 best gen
danilogondolfo has quit [Quit: Leaving]
zxrom has quit [Quit: Leaving]
zxrom has joined #osdev
rnicholl1 has quit [Quit: My laptop has gone to sleep.]
gog has joined #osdev
<zid> gog is home!
<zid> now you can make me a jmp -2 right?
<sham1> Yay
<gog> no
<zid> :(
<gog> i'm cooking dinner
<sham1> What's cooking
<zid> gog is
<zid> but dont' call her a what
<sham1> '_>'
rnicholl1 has joined #osdev
<gog> pene with red suace, sosig, mushroom, basil, and grated parmeseassn
<mjg> watap
<sham1> Sounds good
<zid> penne with blood, pig flesh in sheep tube, hallucinogenics, american herb, foot scrapings
<mjg> i only got fentanyl
<mjg> low calories tho
<sham1> Blood is good
<zid> blood for the gogod
<geist> hello fronds
<geist> are you talking about meat?
<zid> geist do you have a jmp -2 PE coff
<mjg> this is a cooking channel, yes
<geist> are you also made of meat?
<zid> heat isn't here and gog won't furnish me with one
<mjg> me? no, i'm made of flamegraphs
<geist> mjg: pessimal
<mjg> heat is a piece of meat tho
<geist> meat is pessimal
<mjg> eat him
<mjg> what, you vegan?
<geist> no being made of meat is pessimal
<mjg> that's like using a shell without tab completion
<zid> I'm a flesh mech piloted by a spooky skeleton
<sham1> Can't quite join Mechanicus quite yet
<geist> piloting a meat shell without tab completion
<geist> that is pessimal
<mjg> gotta find a stronger word than "pessimal
* geist applies a flamegraph to you
<mjg> 80% cpu time spend on irc, busted
<sham1> I've got a strong word for something that's pessimal. It's just shit
<zid> sham1: find me an easy to look at PE / COFF header set
<mjg> hhow about openbsddesque
<geist> whats with the PE bits zid? trying to uefi boot?
<geist> what arch
<zid> yea I was CHALLENGED to do uefi
<zid> but I don't wanna mingw or whatever
<geist> oh PE headers are pretty EZ though i dont have an example handy
<zid> I wanted a jmp -2 PE so I could test qemu/ovmf
rnicholl1 has quit [Quit: My laptop has gone to sleep.]
<zid> geist: did you know wsl2 does not support kvm on amd, but does on intel? :(
<geist> hmm, like nested virt?
<zid> yea
<zid> the kernel doesn't support kvm if you're amd amd amd
<zid> /dev/kvm no worky
<geist> huh. well i mean i have AMD and never noticed that there was kvm on the wsl, so that tracks
<geist> i just never assumed that nested virt was a thing there
<zid> hyper-v a pile of ass confirmed
<geist> i thought you had some ancient xeon?
<zid> it was dumb that I had to run windows in a VM so that WSL could run side by side with it to begin with (especially because it was broken and I had to blindly fix it)
<geist> did you upgrade to a newer ryzen?
<zid> I have a 5800x
<geist> oh nice, when did you get that?
<zid> few months ago? my 1650's mobo died
<zid> or turns on with post code 00 immediately
<geist> guess i haven't been paying enough attention. yay, grats for something within this decade!
<zid> possibly just a completely dead spi flash chip
<geist> yeah
<zid> but they need pre-programming and the chips are a few quid and so are the programmers so meeh
<geist> guess you can try to remove it and flash it if you're bored
<zid> the ME still works and lets you flash it, but the board doesn't seem to be able to read it back or something
<geist> or harvest the board for capacitors
<zid> (or it's dead and it just can't detect that it isn't properly flashing it)
<geist> yeah and i guess the post code 00 it has is the same as a post card would read
<geist> port 0x80 or whatever it is
<zid> yea it's literally a post card
<zid> but built onto the mobo
<zid> superio chip has pins, and is the thing that listens to lpc port 0x80
<geist> i have some 2009 era dual xeon box that started getting flaky at some point so i eventually upgraded to a newer ryzen
<geist> but one of those things where you can't trust it anymore
<zid> yea your situation is lame
<zid> it works 99.99%
<zid> but that 0.01% means you can't use it for anything important
<geist> main reason i waited so long was i had a strong requirement for ECC, and until ryzens came along there wasn't a solid way to get ECC without buying another expensive server chip
<geist> thanks AMD for not artificially segmenting the market!
<zid> my 1650 had ecc at last :(
<zid> died within weeks of it
<zid> I got a good deal on some URDIMMs
<geist> yep. the dual xeon i think was E5520s iirc
<zid> eww
<zid> nehalem
<geist> they were surprisingly cheap at the time, and asus made a dual socket board for not much, a brief period there where xeons w/ECC were cheap
<geist> it was new at the time
<zid> yea there was a period on ebay where verybody was dumping X5 xeons
<geist> but yeah not worth keeping it running now, at the minimum it's a waste of power
<zid> so you could get a dual X5... xeon setup for $50 total
<zid> I still maintain that SB is the best microarch intel has ever made
<geist> sure, still have my 2600k though i'm not using it now
<geist> but that was a solid trooper. i ran it at 30% overclock for like 4 years straight
<zid> yea the 1650 was fully unlocked, which made it an X cpu, technically
<zid> I ran it at nearly 5GHz (limit of my cooling)
<geist> yeah i ran the 2600k at like 4.4ghz i think. officially it maxed out at like 3.6 or something
<geist> but they were famously hella overclockable
<sham1> The mouse getting stuck in Windows is rather pessimal
<zid> max multi on a 2600k is 42
<zid> 2600k is basically a 1620 non-xeon
<geist> yah that's it. 3.4 -> 4.2
<zid> 1650 was a 3960X
<zid> 1620 was also limited to 42
<zid> same cores etc
gareppa has quit [Quit: WeeChat 3.8]
<zid> was probably literally the same silicon but different fuses
<geist> yeah
gareppa has joined #osdev
<geist> wasn't until a 6600k i think that you could reliably get more performance than a sandy bridge
<zid> yea it took a WHILE
<geist> skylake
<zid> and the 6700k had compromises because desktop
<geist> aside from all the sploits skylake was a pretty solid thing
<zid> dual channel, so your ram was slower, limited pci-e lanes, no ecc, etc
<zid> so I stuck to my 1650 without coveting skylake
<zid> by 11xxx though it was getting pretty uncompetitive
slidercrank has joined #osdev
<geist> alas i was really bummed about bulldozer at the time, though i still have a kaveri machine floating around
<geist> i feel sorry for it, literally. because i'm like that
<geist> even if it's not competitive in any metric at all
boga has quit [Remote host closed the connection]
<zid> I need to investigate why my 5800x doesn't clock especially well
<zid> but amd's settings are super weird
<geist> overclock you mean?
<zid> undervolt
<zid> they freeform clock themselves now
<zid> up to their TDP
<geist> yeah, you can enable PBO if you have the cooling
<geist> but in general that only really helps in the situation where you're pegging all the cpus, and it give syou more headroom
<geist> since any one given core can't hit the TDP
<zid> power density is ridic though
<geist> i have fiddled with it but decided it's not really worth the effort
<zid> if you load a single core you get a giantic (miniature) hotspot
<geist> only really shaves off a few minutes for compiling llvm or something
<zid> "oops, you put it at 5GHz for a nonosecond, now it's at 180C"
<geist> kinda sorta, but i dont think its as bad as you say
<geist> but yeah you can extend the turbo phase a little bit
<zid> It's *really* hard to get heat out of the cpu
<geist> but i'm not sure where that really matters in real world usage
<zid> my cooler is just stone cold basically all of the time, because it just gets a hotspot and doesn't clock up any more
<zid> I need to re-paste it and enthusiastically tighten some bolts
<zid> to see if that helps
<geist> yeah. i've been using closed loop coolers for a while too, which ithink have the property of not really dealing with transient spikes that well
<zid> I dread to think how the AM5 ones are working, their IHSs are another couple of mm thicker
<zid> the chip is less thick and they wanted to make the mounting height similar so they just made the IHS thicker
<geist> i read yesterday that noctua has a delidded cooler they just announced
<geist> ie, if you delid it, they have a plate designed for that situation
<zid> yea delidding modern chips is a whole thing now
<zid> debaurer sells little vices to pop the IHS
<zid> then brackets to make coolers fit, etc
<zid> debauer*
<geist> will be a while now though, since i have a 5950x which will keep me going for quite a few years yet
<zid> 5950x is am4?
<geist> it's a little sub optimal for straight ahead gaming, but only by a few percentage
<geist> yah
<geist> x570 chipset board, which i think was the best AM4 they ever made (not sure they made another run of AM4 chipsets after that)
<zid> I think mine is x570
<geist> yah. solid after they got rid of the initial run of usb instability that required a few AEGSA releases to solve
<zid> 5950x I would have been trepidacious about because it's 3 dies
gareppa has quit [Quit: WeeChat 3.8]
<geist> it's fine, but a single die 5800x is a solid chip. really unless you need the extra cores it's an all together better solution
<zid> the x3d chips are even more asymmetrical, amd's solution is just to disable the other cores
<geist> windows at least generally keeps one of the dies off
<zid> 'gaming mode' -> disable the ccd without the L4
<geist> you can see it load up die 1 as more threads fire up, but it usually keeps die 0 active till like 50% load
<geist> presumably thats the optimal solution to keep the L3 cross die thrashing to a minimum
<geist> linux of course takes the opposite approach and tries to distribute everything evenly all the time
<zid> yea I doubt any games are using the numa aware allocator flags
<zid> you can just cgroup script it easily though
<zid> for linux
<geist> of cours eit's not really numa, but there's sdefinitely a cross die cache latency
<zid> no need to phsically shut the cores off
<zid> I mean, that's literally numa?
<zid> The memory access latencies are non-uniform
<geist> no that's not numa because there's a single memory controller on the io die
<geist> so all cores see the same ram at the same latency
<zid> and there's physically more cache on one ccd
<geist> but they have cross core cache
<zid> nuca? :
<geist> oh you're talking about the x3d stuff? maybe. i'm just talking about a plain 5950x
<zid> x3ds have stacked dram l4 on *one* ccd
<zid> it absolutely destroys most gaming perf if you let them use arbitrary cores
<geist> but cross core cache latency is a thing even on a dual core machine because local L2. it's just L3s are not uniform in the zens
<geist> so it's another tier of cpu cache locality is all
<zid> If you're using a server chip it's genuinely numa gain too
<zid> because each ccd gets its own memory channels
<zid> again*
<geist> yep. the first gen threadrippers too
<zid> the desktop ones are limited to dual channel (WHY?)
<geist> wasn't until zen 2 that they moved the memory controller into the io die
<zid> I really don't understand this fascination with cost-cutting over memory channels tbh
<geist> pinout
<zid> apple demonstrated how powerful good memory subsystem is on M1
<geist> AM4 only has enough pins for 2 channels
<geist> and the SP3, etc sockets have hella pins to handle more channels
<zid> and my sandy bridge didn't? :P
<geist> what was the socket?
<zid> my am4 chip is like twice the size
<zid> 2011
<geist> yeah guess it had mroe memory channels
<zid> 40 pci-e lanes too, intel offers 20 on desktop at best these days
<geist> yah
<zid> it also had integrated power
<zid> so you didn't need 40 vrms on the mobo
<zid> which actually probably helps the pin situation
<GeDaMo> Do Intel or AMD have any CPUs with on-chip memory like Apple?
<geist> looks like AM5 is dual channel too, DDR5
<geist> 1718 pins
<zid> amd just needs to add 293 more pins
<zid> so we can get to 2011 desktop socket level of pins
<geist> might need more pins to do the same thing with DDR5. dunno
<zid> I don't think so
<zid> the electrical signalling is nearly identical for ddr 1 -> 5 tbh, the speeds haven't even really changed since ddr3
<zid> they just keep changing what PC3, PC4 etc multiplies the base clock by to keep consistently getting bigger numbers
<zid> but the base clocks are very similar
<geist> it is generally interesting that intel dropped the number of pins post 2011
<zid> 2400MHz I think is a good speed for ddr5?
<geist> oh oh i see why. yeah LGA 2011 was explicitly for the high end server/enthusiast/workstation market
<zid> yea it's the workstation socket
<geist> the general consumer stuff was always dual channel
<geist> oh sure, so that's like a different thing, that would compete with like SP3 or something on AMD side
<geist> which has hella pins
<zid> E5-1620 was actually an OEM part for HP
<zid> for their Z420 blaze it workstations
<geist> sure. but that's the point, it had more channels because it was a high end chip with a high end socket
<geist> consumer stuff has been dual channel for a long time
<zid> It's just death of the middle class
<zid> there *is* no workstation anything anymore imo
<zid> just server for hpc, and server for webservers
<geist> well, if amd gets back into the threadripper biz whcih i thinkt here may be rumors
<geist> then there's at least that
<zid> intel certainly don't sell workstation
<zid> just 'gold' vs 'platinum' xeons
<geist> yeah
<geist> GeDaMo: re: on chip memory i think AMD just announched some sort of on chip mem thing for machine learning
<geist> but it's a super expensive server thing
<zid> who the fuck would buy that bronze xeon lol
<zid> $414 for 8 cores at 1.9GHz
<geist> gets you ECC. guess you could use that for a NAS or something
<zid> this is what they're selling instead of 2011, basically
<geist> this is why i hate intel for this stuff. they *could* do ECC on their desktop stuff, but they artificially segment it
<zid> a 2GHz 8 core
<geist> AMD at least just leaves ECC on all the time, even if they dont really officially support it
<geist> (though i haven't checked recently with zen 3 or zen 4)
<zid> yea urdimms are hard to get though
<geist> def, slow and expensive, but i'll pay that for a NAS machine
<zid> I need 900MHz ddr4 urdimms kthx
<zid> man, every time I look at cpuz the weirder this cpu feels as an intel nerd
<geist> for at least nas level stuff the speed of the ram wont really matter that much, since you're almost always bottlenecked by the storage or the net
<zid> it's varying the base clock all over the place
<zid> and has fractional multipliers
<geist> yeah, the clock is crazy on zens
<zid> so I am doing 98.33MHz * 38.2 multiplier atm
<geist> at some point i just sort of gave up trying to grok it too much. this also doesn't take into account that one of your 8 cores is golden, the second one is silver
<geist> not sure linux ever grokked that, and ignores it, but windows definitely takes it into account
<zid> yea I have a 5800x so one ccd, woot woot
<geist> the golden core has a 100-200mhz headroom over the others
<zid> They're all individually VIDed though yea
<zid> I forget if you can dump it
<geist> if you're on windows get the ryzen master utility
<geist> it's pretty decent for viewing that stuff
<geist> at least shows you the gold star on the core, etc
<zid> I found it had the worst UI of anything eer
<geist> well, sure
<zid> I couldn't figure out how to do anything in it
<zid> every button looked like it was "immediately crash the machine", and it turns out it just.. was
<geist> oh interesting. works like a champ for me
<zid> like, none of the fields were editable, they were informational
<zid> and the only option I had was enable PGO, which immediately set everything to 'unlimited'
<zid> and promptly hard crashed
<bslsk05> ​preview.redd.it: Reddit - Dive into anything
<zid> everything under advanced was non-editable
<zid> and manual was doing all-core-turbo and disabling power management
* geist nods
<geist> i mostly use it to visualize what the cores are doing
<geist> once i got over trying to eek all the performanc eout of the machine
<zid> I still have the installer lemme just run it
<zid> If I click manual:
<zid> suddenly 400MHz
<zid> I should run the CURVE OPTIMIZER
<zid> maybe then it will do more sane things
rnicholl1 has joined #osdev
<zid> We'll find out of "reboot" means reboot, or means "crash horribly" at some point
rnicholl1 has quit [Quit: My laptop has gone to sleep.]
zxrom_ 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!]
orthoplex64 has joined #osdev
zxrom has quit [Ping timeout: 250 seconds]
rnicholl1 has joined #osdev
zxrom_ is now known as zxrom
<bl4ckb0ne> have you tried to forcing an unexpected reboot
rnicholl1 has quit [Quit: My laptop has gone to sleep.]
kerravon has joined #osdev
<zid> we're at 89% and it hasn't 'restarted' once, boo
<zid> I don't think it's even trying
gareppa has joined #osdev
<gog> meat
<zid> I went from 99% with 8 mins left, to, 10 minutes later, 99% with 8:30 left.
<gog> huzzah
<zid> did you run echo "jmp $" > main.s; fancy-mingw-as main.s -o main.o; fancy-mingw-ld main.o -o main.exe yet gog
<gog> no zid because you're a big boy and you can do it yourself, i'm not your mommy
<zid> I specifically don't wanna install those tools, and idk if my qemu works yet :(
<zid> should I try pulling the one off my own bootpartition
<gog> ugh
<gog> hold on
awita has quit [Remote host closed the connection]
<gog> it's not going to be a jmp -2 tho
<zid> Anything that even attempts to do anything is fine
<zid> random prebuilt buggy crashy sophia.x64, onyx, whatever
<zid> I just don't have *any* efi files
<zid> wait I have a windows 7 iso, winrar pls save me
<zid> okay I think it worked!?
<zid> It returns back to the efi shell after, but that's definitely the win7 efi running
<mjg> can i press a key on the dvd tray
<mjg> you just made me rediscover that my laptop does not even have one
dude12312414 has joined #osdev
dude12312414 has quit [Client Quit]
<bslsk05> ​file.io <no title>
<mjg> deleted
<zid> thanks mjg for deleting it smh
<mjg> np
<mjg> it was pretty good tho
zid has quit [Remote host closed the connection]
zid has joined #osdev
<zid> Found the part where it reboots
<zid> cinebench 5354 -> 5811
<zid> -25,-25,-22,-25,-23,-25,-25,-25 are what I won, apparently
<zid> Apparently my VRMs are maxing out, need to see if I can unlock them in bios I guess
<heat> >onyx
<heat> what
<zid> you love efi
<heat> absolutely
<heat> efi is PERFECT
<heat> ✨✨perfect✨✨
<mrvn> all it lacks is moon-buggy
zid has quit [Remote host closed the connection]
<mrvn> Zid: why not try grub-efi?
<gog> tf
<heat> update on the ext4 checksum thing: yeah they did dun fucked it up
<gog> i wonder if it got deleted because it was executable
<heat> also means freebsd has a borked calculate_crc32c
<heat> gog, i keep getting spam emails from mongodb
<gog> answer them
<heat> brilliant database, annoying spam
hmmmm has quit [Remote host closed the connection]
<gog> hmmmm
<heat> it's not nearly as funny as getting emails from the daughter of muammar gaddafi
<Ermine> gog: may I pet you
hmmmm has joined #osdev
<gog> yes
zid has joined #osdev
* Ermine pets gog
* gog prr
<bslsk05> ​'This is a ‘n euro' by Commander (00:00:08)
<zid> my bios is silly and needs me to manually type in PPT/TC/EDC values if I want to change them
<zid> 142/95/140 are my current ones says ryzen master, okay, need to literally remember that so I can type in reasonable numbers next reboot
<bslsk05> ​'low poly cat spin to funkytown for 1 hour' by asipill (00:59:56)
<heat> funkykat
<heat> are you secretly genz too
<zid> to overdriven funkytown that sounds like ass too
<zid> who needs more than a couple of dB of range
gareppa has quit [Quit: gareppa]
kof123 has joined #osdev
<junon> > The field ‘framebuffer_addr’ contains framebuffer physical address. This field is 64-bit wide but bootloader should set it under 4GiB if possible for compatibility with payloads which aren’t aware of PAE or amd64.
<junon> How can a bootloader "set" the physical address of the framebuffer?
<junon> (this is from the mb2 spec, I was just confused at the wording since the VBE tag gives you a physical address)
<zid> yea that makes no sense
<zid> it's also grammatically awful
<gog> PCI BAR
<zid> The field ‘framebuffer_addr’ contains framebuffer physical address.
<zid> English uses articles pls, author
<junon> It's literally from GNU.org xD it's the GRUB manual on Multiboot 2, amazing
<junon> gog: What's PCI BAR?
<zid> for PCI devices
<zid> they have memory regions associated with them
<gog> base address register
<zid> BARs are ^
<zid> and they're writeable
<zid> so that multiple devices don't try to decode the same addresses as their own
<gog> if the video card is PCI then you can set the framebuffer by setting one of its BARs
<zid> sort of like isa port conflicts for joystick and sound cards :P
<gog> typically
<gog> VBE will do that
<junon> Ahhhh okay
<junon> neat, so it's possible to set the address of certain devices
<gog> for PCI it's mandatory if it has MMIO
<zid> yea, usually the bios does all that though
<gog> yes
<gog> and if it is PCI, it almost always has MMIO
<zid> unless you support hotplug you probably don't have code to change it
<zid> generally
<gog> yeh
<gog> and most PCI host bridges don't support that
<junon> I'm surprised the CPU can just reroute addresses like that, is that part of the MMU or is that a different subsystem of the chip?
<zid> or maybe to work around bios quirks
<zid> it isn't the cpu
<zid> The PCI device has a configuration, that configuration tells it "decode addresses that start 0xF8F"
<zid> when it sees addresses go past on the PCI bus
<junon> what about RAM though?
<zid> what about ram?
<gog> i guess i've never tried it, idk what happens if you split the adress space by assingin a PCI BAR to an address that points to physical memory
<gog> i wouldn't do it
<zid> ram isn't on the PCI bus, the PCI controller will be on the ram bus though, and decode a *huge* range of addresses for every pci deivce on that bus to sub-decode
<zid> you'd need to reconfigure the pci controller itself to get ram and pci to overlap
<zid> and my pci controller lives in my cpu these days so that's probably not even possible
<junon> Ahhhh okay, so the CPU is just requesting <some address> across some pins essentially, and there's external circuitry switching which devices will receive/service those memory requests based on certain upper bits or something?
<zid> yup
<zid> exactly like the ISA i/o port bus
<zid> you literally just had a couple of AND and NOT gates to figure out if you were being talked to
<junon> I feel like a part of my brain just achieved zen enlightenment or something
<gog> always cool when something clicks
<junon> This is also how the BIOS loads its firmware into the CPU upon boot?
kerravon has quit [Ping timeout: 246 seconds]
<gog> for x86 the cpu on start up executes the instruction at FFFF:FFF0
<zid> bubble = NOT, rest is a giant AND
<gog> there's usally a JMP to the bios there
<zid> so 'RAM2' on this image is 'if the top bits of the 24 address is 0b00101'
<zid> that goes to the CHIP_SELECT pin on the IC
<heat> <gog> i guess i've never tried it, idk what happens if you split the adress space by assingin a PCI BAR to an address that points to physical memory <-- depends on the chipset
<gog> meow
<heat> intel chipsets will, AFAIK, not do that
<heat> well, they will not support that I mean
<zid> The problem with doing it via the BARS is that if the BAR is outside of the PCI range
<zid> it won't ever *see* anything on that address
<gog> makes sense
<zid> because it won't even make it to the PCI device
<junon> Right it'll never activate those circuits
<heat> they essentially designate the pci bus ranges (what they call DMI) as everything from TOLUD to 4G, then from TOUUD onwards
<heat> with a small exception for VGA down in the lower regions
<junon> wait so the I/O ports are similar, then?
<zid> TOLUD? TOUUD?
<gog> junon: PCI devices also have address registers for IO space
<zid> junon: you see that 'select i/o' gate on the imge btw?
<heat> sorry, tolud = top of lower usable DRAM, touud = top of upper usable DRAM
<gog> ISA devices have a different configuratin mechanism
<gog> well a couple different ones
<zid> That's the *exact* circuit you need to connect to the address pins on an ISA card to make it work, literally, those 8 wires and that chip, and you've made an ISA card that responds to its own port.
<gog> jumpers on the board or ISAPNP
<heat> AMD has similar ideas with TOP_OF_RAM or something stupid sounding like that
<heat> it's actually an MSR there
<zid> the pci-e root being *in* the cpu means I doubt the address even makes it to the bus
<zid> if it's inside the ram range
<zid> it just gets sent straight to the.. internal memory controller that speaks DDR
<gog> our CPUs are slowly becoming SoCs
<zid> yup
<zid> turns out hardware acceleration is fast
<zid> who knew
<gog> ¯\_(ツ)_/¯
<heat> x86 cpus are 100% SoCs
<gog> so is your mom
<gog> OHHHHHHHHH
<heat> fuck you
<heat> i thought u were my friend
<gog> i am ur friend buddy
<heat> are we buddies in a buddy allocator
<gog> yes
<gog> but we'll never split
<junon> yeah was gonna say... something something split
<junon> :D
<gog> :D
<gog> heat i'm sorry for making a your mom joke but i couldn't resist
<zid> I thought of a stupid your mom joke yesterday but I had nobody to tell it to
<zid> and now I forgot it
<heat> so couldn't your mom
<gog> lmao
<bl4ckb0ne> osdev more like grillingdev
<heat> anyway it's super funny how intel chipsets all have make-belief bridges that you use to configure the shitz
<heat> where AMD went the magic MSR route because it's literally the same thing
<heat> all in the SoC
<gog> yes
<gog> my friendship ended with intel a while ago, now amd is my best friend
<zid> xeon was great, so was coal
<gog> i'll probably regain friendship with intel at some point
<zid> if intel makes a good cpu I will want it
<zid> lets cross our fingers
<gog> i liked my haswell
<gog> but that was very 2013
<heat> kaby lake poggers
<zid> sandy is the best thing they've ever made
<zid> anyone who thinks otherwise is a terrible person
<heat> sandy bad
<heat> kabylake good
<mjg> sandy?
<heat> upvotes left
<zid> competitive on perf for the next decade, *still* offers better base features than modern desktop.
<mjg> Leon Mao
<gog> renoir renoir renoir
<heat> renoir? more like renass
<gog> fuck you
<mjg> OH
<heat> french-sounding leftist CPU uarch
<mjg> i thought he is your protege or something
<heat> very fancy and liberal san francisco there mate
<mjg> french CPU would not even execute the instruction set
<gog> Debout les damnés de la terre
<mjg> it would pretend it does not understand it
<gog> Debout les forçats de la faim
<mjg> les marionettes
<heat> now presenting the new Intel 14th gen based on our new uarch TruckNutsLake
<gog> i cannot execute ze instruccion
<heat> a true American(tm) uarch
<gog> i have not had my baguette and wine
<mjg> Ligma Bridge
<gog> hon hon
<zid> FuckOffeeLake
<gog> sugma lake
<heat> updoglake
<mjg> speaking french is for la parvenu
<gog> also heat is not my protegé, he's a better programmer than i am
<mjg> born 1 century too late
<mjg> gog: easy there gogs, we don't want to encourage him too much in here
<zid> Born too late to explore the world, born too early to get a good intel cpu
<heat> im a better programmer than everyone except linux torval and matthew garrett
<gog> i'm not a very good programmer
<zid> what about peter djikstra
<mjg> here is a programmer litmus test
<mjg> is pascal good
<heat> peter djikstra bad programmer handsomest man
<zid> or greg k. h. (the k. h. is for kills humans)
<gog> i'm gonna go with no because i've never had the need to learn it
<zid> Why the fuck would you know pascal
<zid> is it 1974
<gog> i remember some guy i used to talk to spoke delphi
<mjg> the answer is bNo
<heat> now, edgar zjilstra best programmer
<gog> ah
<zid> more like PASCAL BLAZE IT
<gog> it's hungarian notated
<mjg> dude i got pascal in high school
<gog> also isn't ada pascal-like or smth
<mjg> almost lost my shit using it
<zid> did you go to highschool in the 70s mjg
<zid> or is polan just.. a bit behind
<mjg> i went to high school in 2002-2005 in poland
<mjg> you can consider it 70s in the west
<zid> polan cannot into space :(
<gog> my high school intro programming class was python
<heat> polan can into neighbouring countries into empire
<mjg> program fml;
<zid> when restoring commonwealth, plc stronk
<gog> but it didn't exist until my senior year and i couldn't fit it in because i was scambling to get enough credits to graduate lol
<zid> do it mjg I dare you
<heat> plc OPTIMAL
<zid> can't be a war in ukraine of ukraine part of PLC
<mjg> haters like heat are gonna claim it's a fake
<zid> and remove awful kaliningrad from map
<mjg> i'm surprised someone from the islands knows about the above tho
<heat> is it just me or the plc ukraine is remarkably similar to the unoccupied modern day stuff
<mjg> i thought you only knew to hate scotts
<zid> That's just the useful bit of ukraine, heat
<zid> if the capital were in the east it'd be better defended
<zid> it's not because that's the shitty russian part
<zid> PLC dum though, if they just went a few more kilometers south they'd have had black sea access
<zid> never would have fallen
<heat> ottoman stronk though
<zid> blockade constantinople
SGautam has quit [Quit: Connection closed for inactivity]
<heat> tsargrad*
<zid> invade ordu
<mjg> armchair historian best commander amirite
<zid> reclaim glorious trebizond
<mjg> honk if you think putin would be a great vasal to plc
<zid> putin's a great vassal already
<zid> make him a march
<heat> march cringe give me money
<mjg> so i got the urge to use windows
<zid> think of all the rusty tanks you could blockade constantinople with though
<zid> the stack would be too scared to move
<mjg> maybe i should pirate nt 4.0
<zid> trap it in asia, reclaim glorious byzantine lands
<gog> mjg: find nt 4 source code it's somewheres
<gog> i wonder if windows 2000 source is kicking around somewheres
<heat> WE BLOCKED THE BOSPHORUS STRAIT USING THOUSANDS OF COLD WAR SOVIET TANKS (YOU WONT BELIEVE WHAT HAPPENED)
<mjg> gog: nt 4?
<mjg> i know of the 2k leak
<gog> yeh it was leaked at some point
<mjg> and xp leak
<gog> same as 2k
<mjg> not of 4
<bslsk05> ​github.com: NT4.0/private at master · lianthony/NT4.0 · GitHub
<bnchs> gog: why are you linking that
<heat> pls dont post leaks here
<heat> thanks
<gog> whoops
<mjg> whoa onlyfans leak
<bnchs> congrats gog
<bnchs> you just made wine lose a few developers
<bnchs> NOT including me
<CompanionCube> huh, apparently the xp one included server 2003? suppose that makes sense.
<gog> it was the first result on google
<gog> so like
<gog> idk
<zid> xp64 was server2003
<heat> mjg, why do you want to use old systems if you're inevitably going to complain they don't scale anyway
<bnchs> gog be more careful around posting leaks
<bnchs> i wanna contribute to wine
<gog> i will
<mjg> heat: i would have to get a compiler on them to do it
<mjg> heat: which i ownt
<heat> might as well use unixware or sunos
<mjg> i fucked around on dos and windows for years before i saw the light
<mjg> that is to say it all sucks so bad
<gog> why would this still be up though lmao
<zid> heat are you a high-calorie human
<heat> idunno
<mjg> gog: calling people who download?
<mjg> :
<gog> idk maybe it's sus
<bnchs> mjg: microsoft's honeypo
<bnchs> they're keeping it up to ruin wine
<bnchs> remember this is hosted in Microsoft Github
<mjg> that is what i'm saying
<zid> my mental image of heat is high calorie human with an under-chin hair situation, and a head covering that sounds like a linux distribution
<bnchs> yes
<bnchs> that's why NOBODY should look at the source code
<mjg> so people like heat missed out on bluescreans being a common occurence when using your magic desktop
<mjg> xp released before he was born
* mjg realizes he is hold af
<mjg> old
<gog> you're one year older than me relax
<heat> you're all old
<CompanionCube> i was gonna say if it was a honeypot the w2k source would be taken down but nope that's *also* still up on github, so while i don't think microsoft is actually doing that it's at least possible
<mjg> gog: you '85?
<gog> 87
<mjg> ye is what i meant
* mjg <-- old
<bnchs> CompanionCube: c'mon it's in the first result of google
<gog> lol
<zid> 89 :(
<bnchs> it is a wine honeypot
<zid> I am the same age as germany
<gog> the same age as modern germany
<gog> there was a reich and a republic and another reich before that
<mjg> gog: fwiw you got nothing to look forward to, saying this as an older person
<gog> oh and the two germanies
<zid> GDR best sub-germany
<mjg> how does a middle aged man know he is still alive?
<gog> mjg: that's why i go to the gym
<mjg> something hurts
<gog> trying to stave off the decline of my body as much as possible
<zid> I just be thin
<zid> can't be unhealthy if you're underweight, they proved it in rats
<zid> less cancer, less aging, etc just from 'having fewer cells and doing less digestions'
<mjg> gog: push ups, pull ups and plenty of juice
<mjg> now i'm mildly curious what happens when women take tren
<zid> Is that a street name for the steroids you take
<mjg> [for people out of the loop, it is a substance *banned* from human use. it is legal for use in animals to buff them up]
<mjg> zid: ye, amongst other compounds
<zid> I take HGH
<mjg> i'm taking more shit than liver king
<zid> snort it right out of aborted babies
<mjg> trenbolone sandwiches == best
<mjg> i hear i messes with people big time, including turning them gay(no joke)
<zid> mjg bro
<mjg> mm did you take it?
<zid> you can't "turn people gay", they were looking for excuses to fuck men
<zid> and you got conned
<mjg> are you calling me a closeted homo
<mjg> cause that's right on the money
<zid> side note, it's sort of wild how accurate sexual preference is, it almost always gets it bang on as a specific gender and age range of human
<zid> and not like, cheese
<zid> or only elm trees
<zid> and it's very very very resistant to being changed
<mjg> seriously though i did not look particularly closely into it
<mjg> i only got stackoverflow-level guarantees for accuracy here
<zid> If it made people gay
<zid> it'd be used in warfare 100%
<heat> gog, you forgor prussia btw
<heat> bad mistake
<gog> prussia is a different animal
<mjg> pRussia
<heat> prussia was very germany
<zid> When you hear things, you need to consider if they're true in the scale of "would the US have done this to a random part of the middle east?"
<zid> if the answer is "yes" but they have not, it's not true
<heat> particularly after the early 1800s
<mjg> is pRussia just russia written by a hungarian?
<junon> as a gay man living in berlin, this convo is a whole deal right now
<gog> lel
<zid> "Cell phones cause cancer" -> "Did the US bathe the middle east in cell phone amplifiers and give everybody cancer?" -> "No" -> False.
<mjg> junon: what's going on?
<zid> Easy.
<mjg> does bacon cause cancer?
<zid> Let's find out
<mjg> did the us feed the middle east?
<mjg> no
<mjg> false
<zid> see, it works great
<mjg> agreed
<mjg> did you get it from chatgpt?
<zid> get what from chatgpt
<zid> common sense?
<mjg> it can do that?
<zid> do what?
<heat> linux
<mjg> nigga either play along or gtfo
<zid> why the fuck would I play along with stupid shit about moronic corporate products
<mjg> junon: i hear there are anti-lgbt movements in poland, no clue about .de
<zid> I'm not a wage slave to chatgpt's owners, I don't need to give them free advertising for their scam product
<mjg> zid: i don't know, have you tried having lulz?
<zid> have you tried having standards?
<mjg> i don't need stadnards, i have chatgpt
Gooberpatrol66 has quit [Quit: Leaving]
<heat> wtf
<gog> osdev
<zid> did sham ever find me my pe header
<heat> yes, please osdev
<zid> I don't like the msdn pages
<bl4ckb0ne> speed run going off subject any%
<gog> hi bl4ckb0ne how you today
<gog> are you enjoying osdevving
<bl4ckb0ne> im mad
<gog> why are you mad
<bl4ckb0ne> yes
<bl4ckb0ne> i also enjoy johto
<bl4ckb0ne> i am mad my son didnt sleep
<bl4ckb0ne> because i couldnt osdev
<heat> son > osdev
<heat> always
<bl4ckb0ne> thats not what mjg told me
<gog> mjg says a lot of things
<bl4ckb0ne> but he's cute and we did a little walk so im not really mad
<gog> best to take what's useful and leave the rest
<mjg> whoa there this channel turns judgmental real quick
<zid> heat how many passes does ld do
<zid> can I forward reference things
<zid> nasm is one pass so that's SUPER ILLEGAL
<bl4ckb0ne> ill osdev instead of sleeping like a regular human bean
<gog> sleep is good
<bl4ckb0ne> yes but i prefer fixing my uefi bootloader
<gog> sleep is better than trying to fix your uefi bootloader
<mjg> uh
<heat> zid, i think you can
<mjg> so you are doing osdev or bootloader
<gog> kernel loader
* mjg is conflicted on this one
<gog> what's the line between a kernel loader and a bootlaoder
<zid> oh nice, osdev wiki was one of my google results
<bl4ckb0ne> or i could start a pokemon emerald playthrough
<zid> but it's pe32
<bl4ckb0ne> in honor of zid
<zid> I think I can adapt
<zid> why do you keep talking about pokemon fan games to me
<zid> I really don't care about them
<bl4ckb0ne> ill name my mudkip after you
<bl4ckb0ne> and teach it rock smash
<zid> good for you
<zid> I *really* don't care
<heat> ... why's everyone so hostile
* bl4ckb0ne shrugs
<zid> I keep telling him I don't care and he keeps pinging me about it
<zid> so I ask him to stop
<zid> and he does it again, so I ask him to stop
<zid> not really hostility, just.. beating my head against a wall
<junon> zid: I'll change the topic for you
<junon> is RAID something completely transparent to the OS?
<junon> Just a passing thought
<zid> depends who implements it
<zid> it's definitely not transparent to mdadm
<zid> but 'fake raid' or hardware raid might be
<zid> or might not be
<gog> there's hardware accelerated raid, firmware raid and software raid
<gog> fake raid == firmware raid
<zid> hardware raid, fake raid, mdadm
<zid> also technically 'intel storage technology' iastor
<zid> for that last one
<zid> but who configures their raid within windows
<kazinsal> there's also the possibility of hardware raid being transparent to the filesystem layer but not the whole OS
<zid> yea there's various levels of "I care about this", as in all things
<mjg> gog: i dont think there is one, it just sounds better
<gog> the fake raid might also be performance-limited until a software component takes over
<zid> like tcp is invisible to some layers, but not others, etc for networking
<heat> btw junon i read your TLB shootdown question in the logs and that made me do a hard-think about some idea where one would do some quiescence-based TLB shootdowns to save on IPIs
<mjg> had my fill using windows after 2 minutes
<kazinsal> wherein the actual FS ops don't know about the hardware raid but the driver and management utils do
<heat> obviously i don't know if that works well
<gog> mjg: wha
<gog> oh
<mjg> whaoh indeed
<gog> i forgot what we were taling about last, i have a very short attention span
<mjg> so a serious question, anyone here versed in windows and is able to profile said kernel?
<heat> get dtrace
<mjg> i'm mildly-to-moderately curious how it performs in /certain tests/
<mjg> mate i don't have real windows nor hw to run it on
<mjg> but maybe a poor sap in the area?
<junon> heat: yeah I'm trying to run through a few usecases of "async" TLB shootdowns in some cases for this IPC design of mine.
<heat> mjg, windows 10+ is free to install
<zid> objcopy pls, what r u doin
<heat> junon, the shit problem is that this could temporarily exhaust memory and thus still need actual IPIs
<heat> like, I can't tell if there's actually relevant wins, and it may not interact well with ASIDs
<heat> ARM style tlb invalidation is probably miles better
<heat> alas I can't write intel's verilog
<mjg> heat: i also don't know fuck about how ot install a compiler and so on
<mjg> i would be helplezzz
<heat> mjg, what exactly do you want me to run?
<mjg> i suspect it does not even do dtrace tho, does it
<mjg> heat: loller
<mjg> look fucker
<heat> dtrace-on-windows
<junon> heat: In my case it's less about memory availability and more about correctness; in the "slow" mode the IPC channels are ring buffers whereby the message slots have their page table permissions changed in order to prevent incorrect usage. In the "fast" mode, these checks are off and both sides have to support handling the cursor and memory correctly. But the channels are set up by the kernel prior to the two sides being executed at all, and persist over the
<junon> lifetime of the two processes.
<mjg> heat: if you can run some will-it-scale *while* profiling the kernel, that would be interesting
<junon> page faults are used to perform blocking and backpressure
<mjg> heat: bonus q if there is any way to disable meltdown protection
kerravon has joined #osdev
<mjg> heat: maybe you hypervisor could lie abut the cpu somehow
<heat> no idea
<heat> i have it on bare metal
<mjg> Check that you are running a supported version of Windows. The current download of DTrace is supported in the Insider builds of 20H1 Windows after version 18980 and Windows Server Build 18975. Installing this version of DTrace on older versions of Windows can lead to system instability and is not recommended.
<mjg> what cpu?
<mjg> is that your kaby?
<heat> yes
<heat> i dual boot
<mjg> aight
<mjg> well see above
<mjg> does not look like it is safe to begin with
<heat> seems like it should work fine
<mjg> or are these numbers older than 10
<mjg> well if you are genuinely up to it, that would be appreciated
<mjg> but don't try too hard :X
<heat> junon, oh right you can't really pull tricks with mprotect can you
<mjg> the apis look rather... PESSIMAL
<mjg> so i expect lol overhead out of the gate
<zid> guys, guys
<heat> unless you wait in mprotect for the quiescent state, in which case, very PESSIMAL
<zid> PE has a timestamp field
<zid> gcc has __TIME__ which is a string
<zid> __TIME__[0] * SECONDS_IN_TEN_HOURS + ...
<heat> the answer is: set it to my birthday
<zid> let's go?
<bslsk05> ​redirect -> login.microsoftonline.com: Redirecting
<heat> mjg, why do the APIs look pessimal?
<mjg> they roll with a generic handle concept
<mjg> which can be anything, not even fd-like
<mjg> i would be genuinely surprised if that did not incur overhead which they did not mitigate
<mjg> so if you were to -- say -- do fstat-equivalent, i expect there is more work to begin with
<heat> it can be anything, including the obvious fd-like
<gog> generic handles are great
<gog> with generic handles you can do anything, the only limit is yourself
<heat> EVERYTHING IS A FILE
<gog> no, i hate files
<heat> you hate everything
<gog> not true
<gog> i love my wife
<heat> i love files and magic filesystems and whitespace-as-abi
<heat> and woman
<heat> but i cannot capture the womans as good as you can
<gog> i had trouble with that too
* gog patpat
<heat> i am the rizzmaster without the rizz or the mastery
<heat> i am the
<zid> I am.
<gog> i amn't
<mjg> heat: i'm saying teh fucking lookup has to be more expensive
<mjg> since this is an opaque lolo number
<heat> mjg, you don't know that
<mjg> not just an index into an array
<zid> ld being mean and not basing things at 0
<mjg> maybe it's a hash, a tree or they chunk it into a radix
<mjg> or whatever
<mjg> but there is more work than just indexing into a one-dimensional array
<heat> or an array and it's a file descriptor
<gog> zid: ld prefers cringingn
<mjg> so how bout you get profiling operational and we find out
<mjg> maybe you could printf some of them too
<gog> maybe the handle is tagged and it can index any number of aarrays
<heat> void *handle = (void *) open("/dev/null", O_RDONLY); #define BAD_HANDLE (void *) -1 if (handle == BAD_HANDLE) printf("Win32 Error");
<gog> or be keys to a tree
<zid> oh it helps if you
<zid> use the linker script you write
<heat> tbf i don't think it's as straight forward as file descriptors
<mjg> i'm pretty sure that's not numbers starting from 0, incrementing by 1
<mjg> it's probably something which spells funny stuff in hex
<heat> i think it's a global handle table
<junon> Crazy question: is there a way in x86_64 page fault handlers to basically say "discard the memory operation and don't fault again"?
<heat> no
<junon> like treat it as a success without having to map in a physical page frame and just discard the op?
<junon> damn
<heat> the positive side is: you get to implement your own x86 instruction decoder!!!
<zid> It'd be nice if ld said more than SYNTAX ERROR
<mjg> heat: let's profile
<mjg> we can handwave all day
<junon> haha heat I could just decode the instruction that it was at, get the byte count and skip back to the address after yeah? xD
<gog> no because when you return from the page fault it'll try the instruction again
<mjg> a spider just walked by my keyboard like it's none of my business
<heat> junon, yup kinda
<mjg> it's not going to walk anywhere now
<zid> I like spooder
<gog> you can either make the page not fault or terminate
<heat> gog, or skip the IP
<gog> i guess
<gog> but who knows what happen
<junon> how would you skip the IP? I thought IP was read-only?
kerravon has quit [Quit: Client closed]
<heat> you do because you wrote your own instruction decoder
<gog> yes
<gog> you jmp to the next insn
<heat> junon, regs->rip += insn_length; return;
<gog> or return to it
<gog> iret to it more accurately
<zid> x86 has a 'push rip' instruction it's just hidden
<gog> rip
<heat> oh really?
<zid> They sneakily hid it in the 'call 2' encoding
<heat> oh lol
<heat> you silly billy
<heat> junon, btw if you used saner architectures like arm64 or riscv64 things would be a lot easier for you in that regard
<junon> yeah, because instructions are fixed width yeah?
<heat> arm64: size_t get_insn_length(u8 *insn) { return 4; }
<junon> yeah
<junon> I'm not sure I even need to do this, just one crazy thought to solve a relatively weird problem
<heat> riscv64: size_t get_insn_length(u8 *insn) { if (*insn & SIXTEEN_BIT_INSN_PATTERN)) return 2; else return 4;}
<zid> if(rip & 1) return 2; return 4;
<zid> thumb bro
<heat> yeah i have 2
<heat> thumbs are kool
<heat> easily top 5 fingers
<zid> I think all my finger types are in the top 5
<heat> the pinky is lame and does not make my top 5
<junon> I know that you can get the address of the faulting instruction and the destination address of the op, but in the case of writes, is there a way to get the value of the write?
<zid> pinky better than ring
<zid> doesn't even have a tendon
<junon> Or is that completely entering black magic territories?
<heat> junon, no
<zid> I thought the pf addr was in the fault
<heat> the positive side is: you get to implement your own x86 decoder AND emulator!!!
<zid> and you had to use the stack to find the rip of it
<zid> :(
<junon> zid: the addresses are there, but not the values themselves.
<zid> oh, value, pfft
<zid> who needs those
<junon> Like the value that is to be written to the address
<zid> single step debug the faulting instruction
<heat> you know what kernel has this capability?
<zid> onyx?
<heat> fuckin linux
<heat> no im not smart enough to figure out x86 encodings remember
<gog> if it's a write and you want the value i suppose you could do some weird shit and re-run the instruction with its context
<gog> but it's not guaranteed to be the exact same value
<junon> yeah you'd have to do a software emulation of the instruction
<gog> it's a little more complicated than that
<junon> you'd have to fetch the source of the write (which register, etc.) and then pull from it, no?
<junon> and you'd only be able to do that by decoding the instruction
<gog> i suppose
<gog> but what if the instruction is a stack push
<junon> in this case it wouldn't be
<junon> but yeah, I suppose it could be.
<gog> well i guess that wouldn't be different
<gog> idk it seemed more complicated thinking about it
<junon> I mean if you decode 'push rax' then you just need to read from rax
<junon> but bleh the complexity of this is... way too much to justify going this route haha
<junon> I need to figure out another way to do this.
<junon> but I enjoyed the thought exercise lol
<zid> emulate all of the x86 in the first place
<zid> then it isn't a side-case
<zid> it's part of the main case
<heat> stop writinga kernel in the first place
<heat> then you won't have to think about any of this
<heat> enjoy a nice vacation to a caribbean island
<heat> visit iceland, meet gog and learn rizz tips and tricks
<gog> do not visit iceland
<gog> also i don't have rizz stop with this rumor
<heat> that's exactly what the rizzler would say
<mjg> i met gog, she is a hound for women
<mjg> albeit her tips may be only useful if you are also one
<mjg> so rather limited on this channel innit
<mjg> heat: where is my windows kernel flamegraph
<heat> tip #1: stop using IRC
<heat> women don't like cavemen
<gog> unfortunately i have no insight on what straight women like
<heat> tip #2: shower (refer back to #1)
<bslsk05> ​learn.microsoft.com: Retrieving and Changing File Attributes - Win32 apps | Microsoft Learn
<mjg> apis aside, that's one intern-quality code innit
<junon> how do you get NASM to accept 64-bit addresses?
<heat> what
<junon> it's showing a 64-bit address as overflowing
<junon> lock inc BYTE[0xABCDEFAA00000000]
<junon> (just wanted to test something)
<heat> that doesn't work
<junon> you can't increment a memory address?
<heat> x86 does not have 64-bit imm apart from movabs/whatever-its-called-in-intel-maybe-just-mov
<bslsk05> ​c9x.me: Control: x86 Instruction Set Reference
<junon> https://www.felixcloutier.com/x86/inc this has an INC r/m64 though?
<bslsk05> ​www.felixcloutier.com: INC — Increment by 1
<junon> Or am I misunderstanding that table
<heat> r/m does not have 64-bit addresses
<heat> so lock inc [rip + 10] is valid, lock inc [0x100] is also valid
<zid> It means r/m sib stuff
<zid> not register/memory
<zid> like it means in every other isa document
<junon> ahh
<heat> for an absolute reference you'd need to do something like
<heat> movabs $sixty_four_bit_imm, %rax; lock incq (%rax)
<heat> i don't know how to say that in intel
<zid> mov rax, imm64; lock inc qword [rax]
<zid> I have never used lock.
<junon> yep
<junon> that worked, thanks
<mjg> CopyFile(FileData.cFileName, szNewPath, FALSE);
<mjg> i'm happy unix folk were different
<heat> yes, you can't even do that
<heat> there's no standard POSIX replacement for that operation
<zid> I want ACID extensions to posix
<heat> you always sounded like a COKE guy to me
<heat> being english and all
<junon> These encodings are nuts
<bslsk05> ​godbolt.org: Compiler Explorer
<mjg> heat: biatch
<mjg> heat: copy_file_range
<mjg> not posix, but UNIX
<heat> biatch
<heat> <heat> there's no standard POSIX replacement for that operation
<mjg> funny criterion you got there
<mjg> > shite, how to make a non-argument real quick
<mjg> > i know, i'll point out POSIX
<mjg> lmao
<heat> it's definitely an argument
<mjg> posix is not being taken seriously by its own committee
<mjg> you know because of all the people rushing to have thier systems certified
<heat> The copy_file_range() function appeared inFreeBSD13.0. --> early-mid 2021
<heat> CopyFile: Minimum supported clientWindows XP [desktop apps | UWP apps]
<heat> literally 2001
<zid> msdn likes to err on the side of caution too
<mjg> so?
<zid> it may have been available in 98se, or 2k etc as well
<mjg> you do understqand i'm taking stabs at naming here?
<zid> but they don't track that info all in the same place
<heat> no
<zid> like, it claims the win 3.1 joystick interface is from xp too
<mjg> if the OG unix folks were naming it it would be copy_fil(int fd, out fd);
<heat> the naming sucks yes
<zid> cus that's the oldest they have it documented
<heat> copfil(fdin, fdout)
<mjg> int, int
<mjg> right
Gooberpatrol66 has joined #osdev
<mjg> defo make sure there is no trailing e in the name
<bslsk05> ​i.imgur.com <no title>
<gog> rate my 1999 battlestation
<mjg> 1999/2000
<mjg> do you irc from that?
<heat> yes, IRC doesn't run on anything newer than 2006
* mjg hails from a 2005 desktop
<heat> 2004 GNU/Linux Libreboot thinkpad here
<junon> Is there an instruction that can zero a byte in memory that isn't mov-based?
<mjg> heat: fortunately there is a StartIrcSessionByHandle func since windows 98
<heat> junon, stos
<mjg> why are you trying to not mov tho
<junon> Was just a shot in the dark to see if I could avoid having to decode the entire instruction in order to know if it's an increment or a "clear" (set to 0)
<mjg> i guess xchg can also do it, nott that you should use it
<heat> mjg, in linux you echo some specific values to ircfs in /sys/net/irc
<junon> heat: can you give an example?
<mjg> do you know about portalfs?
<heat> mov $addr, %rdi; mov $1, %rcx; rep stosb
<heat> erm, xor %rdx, %rdx too or something
<mjg> you can just stosb
<mjg> no need for the rep prefix
<mjg> nor count in rcx
<heat> ah ok great
<mjg> also stosb SUCKSS
<mjg> really, it is super slow
<heat> aaa best instruction
<mjg> rep-related problems aside
<gog> aaa
<mjg> that is not a valid x86 instruction
<heat> aaa
<heat> yes it fucking is mjg
<mjg> AAA is the real instruction
<heat> oh, sorry, i didn't realize we were speaking MASM here
<zid> AAA is dead
<zid> long live amd64
<junon> IF 64-bit mode THEN #ud; -> womp womp
<mjg> but is NOOOO a valid instruction?
<mjg> #ud == undefineb dehavior
<mjg> someone made typos and they stuck
<heat> unpopular opinion: CPUs should have undefined behavior
<heat> ud2 -> don't care, may as well blow up
<moon-child> mov tmp, [x]; sub [x], tmp
<junon> heat: $1 in GAS syntax is literal 1, yeah?
<moon-child> also zeroes
<heat> yes
<moon-child> also push
<moon-child> movs
<moon-child> call if rip happens to be zero
<heat> most things that write to memory could end up zeroing something
<moon-child> hell even a faulting instruction can do it
<moon-child> yeah
<mcrod> hi
boga has joined #osdev
<heat> mcrod? more like mcrodbest
<junon> is the mov $1, %rcx necessary if rep prefix isn't used?
<heat> mcrodbestdeveloperandpersonever
<mjg> no
<heat> no
<mcrod> i... are you drunk
<mjg> it is for the count
<heat> mcrod, no
<moon-child> if mcrod is so good why's there no mcroe yet
<mcrod> i will take the compliment
<heat> why can't i compliment you
<zid> what I wanna know is why 'rep blah' is its own instruction
<mcrod> no you can
<mjg> moon-child: you have not seen mcroc i take it
<mcrod> but that was just so random
<zid> rather than it being a prefix byte I can do for anything
<mcrod> also, guys
<moon-child> mjg: no that guy sucks
<mcrod> i'm moving for the first time
<heat> no, you said hi
<moon-child> fuck mcroc
<zid> It looks like one, but it isn't
<mcrod> no one in real life is happy for me so here I am
* mcrod party
<heat> congrats
<mjg> get a dog
<mcrod> we have one.
<heat> didn't you move a couple of weeks back?
<mcrod> no
<mcrod> i was in the process of getting the applications/seeing places etc
<mjg> mate if your own dog does not care
<heat> i swear you said something related to that?
<mjg> that's pretty bad
<moon-child> lol
<heat> "hello mr woof, we moving"
<heat> mr woof: "woof"
<gog> mcrod: will you pet me
* mjg never gets asked :(
<bnchs> mjg: will you pet me?
<heat> junon, if you want a shortcut for "instruction sequence that can safely zero this without me implementing a decoder and all types of depression", just do it in assembly
<zid> polan germs
<mjg> bnchs: no
<bnchs> ;_;
* mcrod pets gog
<heat> define mov $0, [reg] as the only sequence that could ever do it, else UB
<heat> and then you just increment that shit
<mcrod> mjg i guess i'm just cute.
* bnchs curls up
<junon> heat: that's pretty much exactly what I'm doing
<heat> so why do you care about other instructions then?
<junon> specifying "this address has to be either incremented or set to zero exactly this way"
<junon> anything else is faulty
<junon> (still not sure this is the approach I wanna take)
<moon-child> junon: wait what are you doing
<moon-child> and why
<zid> silly tings
<moon-child> I mean that much is clear already
<junon> moon-child: determining if a specific write condition is met in a page fault
<moon-child> but
<moon-child> oh
Turn_Left has quit [Ping timeout: 260 seconds]
teroshan97 has joined #osdev
<moon-child> i see
<zid> butt
<junon> the original question was if the page fault handler is also given the value that would be written, not just the address
<moon-child> why
<moon-child> if somebody wanted to not force commit the thing, maybe they should have simply not written a zero
<junon> well, the ORIGINAL original question was whether or not you could tell the CPU to skip the instruction that caused a page fault and discard the memory operation
<junon> the answer was "not without decoding the instruction and jumping N bytes after RIP"
slidercrank has quit [Ping timeout: 264 seconds]
<heat> what part of that answer isnt attractive to you?
<junon> so then the question became more of whether or not you could decode-but-not-really the instruction by specifying that only specific instructions were supported
<junon> because writing a full-blown decoder is a wild ask, at least for x86
teroshan97 is now known as teroshan9
teroshan9 has quit [Ping timeout: 250 seconds]
<heat> i n f i n i t e f u n
<heat> i'll pad all my mov $0, (%reg) with 66h prefixes so your logic gets confused