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
<klange> I only see one of those for Linux userspace targets.
<heat> the power of clang is its runtimes
<junon> the power of clang compels you
* junon splashes holy water on the monitor
waltster has quit [Quit: Leaving...]
<klange> i think the power of clang/llvm, frankly, is that compiler-rt is _optional_, and in the cases where you want it they do a much better job of building a billion of them for different target setups.
<klange> gcc barely understands how to multilib, so getting it to build multiple libgccs for different situations is a pain in the neck and when you hit a case it wants to use libgcc for _tough shit!_
vdamewood has joined #osdev
vinleod has joined #osdev
vdamewood has quit [Ping timeout: 252 seconds]
<kingoffrance> surely thats a job for the parrot "the power of clang compels you" "splashes holy water"
<junon> I would cry if he said that
<junon> He already pierces the silence with a loud and chipper "HOW ARE YA?"
<junon> Scares me and makes me laugh at the same time
vinleod is now known as vdamewood
dude12312414 has joined #osdev
dude12312414 has quit [Remote host closed the connection]
<klange> I think I will make some effort to just working on code cleanup and documentation for the rest of the month.
<kazinsal> Maybe I'll finally get the 64-bit core done this month.
<kazinsal> I say, for the fourth or fifth month in a row
<j`ey> kazinsal: xmas present for yourself
dutch has quit [Quit: WeeChat 3.3]
dutch has joined #osdev
pretty_dumm_guy has quit [Ping timeout: 252 seconds]
gog has quit []
gog has joined #osdev
wikan has joined #osdev
heat has quit [Read error: Connection reset by peer]
heat_ has joined #osdev
Oli has quit [Quit: leaving]
wikan has quit [Quit: Client closed]
nyah has quit [Ping timeout: 252 seconds]
sdfgsdfg has quit [Quit: ZzzZ]
[itchyjunk] has joined #osdev
heat_ has quit [Remote host closed the connection]
Brnocrist has quit [Ping timeout: 256 seconds]
vdamewood has quit [Read error: Connection reset by peer]
vdamewood has joined #osdev
eson123 has joined #osdev
MelMalik is now known as AmyMalik
<eryjus> well, crap. I have a race condition I cannot track down. Been working on it for more than 2 weeks. Any suggestions on techniques/methods to isolate the location?
<moon-child> be vewwy quiet, I'm hunting wace conditions
<eryjus> it's too damned quiet -- i can't think
Burgundy has joined #osdev
* kingoffrance hums ♫ uNQHjyLcTfU 【FF5】CLASH ON THE BIG BRIDGE【GUITAR】 5:14 ♫ glad to be of assistance
<kazinsal> best song in best final fantasy
<Mutabah> eryjus: Watchpoint maybe?
[itchyjunk] has quit [Remote host closed the connection]
<vdamewood> Uh... 6 was better than 5.
<vdamewood> (But I love the job system in 5.)
* moon-child has not played much final fantasy
<moon-child> I've played parts of 1, 6, and 7
<moon-child> but not sure if returning to play more thoroughly
<vdamewood> I still need to beat FF3.
<vdamewood> Unfortunately, My Japanese sucks.
<klange> Have you heard of the critically acclaimed MMORPG Final Fantasy XIV? With an expanded free trial which you can play through the entirety of A Realm Reborn and the award winning Heavensward expansion up to level 60 for free with no restrictions on playtime.
<klange> (Also the next expansion goes live tomorrow)
<vdamewood> Nope.
<klange> (Also that first line was a meme copypasta)
<vdamewood> Oh, I wasn't familiar with the meme.
<vdamewood> I was just being a smart ass.
rustyy has quit [Quit: leaving]
rustyy has joined #osdev
<remexre> is there a way to define (compile-time) named string constants in GNU as without depending on cpp?
<remexre> .equiv doesn't do it; weirdly, the .equiv is accepted, but the .ascii fails
<moon-child> #workingset maybe
<remexre> oh, maybe
sdfgsdfg has joined #osdev
ElectronApps has joined #osdev
mniip_ has joined #osdev
mniip has quit [Quit: This page is intentionally left blank.]
mniip_ is now known as mniip
scoobydoo has quit [Ping timeout: 265 seconds]
scoobydoo has joined #osdev
andydude has joined #osdev
andydude has quit [Ping timeout: 252 seconds]
sdfgsdfg has quit [Quit: ZzzZ]
xenos1984 has quit [Quit: Leaving.]
sdfgsdfg has joined #osdev
elderK has quit [Quit: Connection closed for inactivity]
sdfgsdfg has quit [Quit: ZzzZ]
xenos1984 has joined #osdev
GeDaMo has joined #osdev
givemeyourpies has quit [Quit: Going offline, see ya! (www.adiirc.com)]
xenos1984 has quit [Quit: Leaving.]
xenos1984 has joined #osdev
<gorgonical> I regret to inform the channel that the reason I wasn't getting any output had very little to do with the hypervisor. Basically the serial driver wasn't coming up correctly and after I fixed my interrupt controller all I had to do was bounce the pl011 irq to the right vm
<gorgonical> And I haven't figured out how to let the hypervisor and the VM share the serial driver. I tried but that causes input on the VM to not do anything
<j`ey> dont you want to emulate the serial driver for the VM?
<gorgonical> You mean like expose a virtual serial device?
<j`ey> yes
<zid> write a little multiplexing protocol :P
<gorgonical> I will probably end up having to do that if we want multiple VMs running, but also the hypervisor provides a way to share pages of memory, so probably I'll use that for communication
<j`ey> how can you share the serial though? wont it see mangled output, and who decides what input is for what?
<zid> >little multplexing protocol
<j`ey> sounds like that would require changing the OS's driver
<gorgonical> indeed I suppose the hypervisor could do that, but the serial port is mostly for early bringup and all that. Once I have a working userland I'll probably rely on the primary VM and let it control all the drivers and such
<zid> no?
<gorgonical> j`ey: it would and I am not willing to modify the pl011 driver linux uses more than I already have
<zid> It takes to the VM like the VM is a normal terminal on the other end or what it wants to do, and the VM wraps it before sending it out the 'real' serial port
<zid> either with "this is from the VM" or "this is from the host"
<zid> talks*
<zid> client unpacks it and splits it into two streams again
<j`ey> ok right, so emulating the serial driver for the vM
<j`ey> gorgonical: you still probably want some output from the HV right?
<gorgonical> maybe, but it's not clear how much. the hypervisor really delegates most work to a driver in the primary VM, so that primary can interrogate the hypervisor state in most cases
<gorgonical> it's like a xen-ish hypervisor, a thin shim and a primary/dom0
eson123 has quit [Quit: Leaving]
sdfgsdfg has joined #osdev
Vercas1 has joined #osdev
Brnocrist has joined #osdev
Vercas has quit [Ping timeout: 276 seconds]
Vercas1 is now known as Vercas
sdfgsdfg has quit [Quit: ZzzZ]
MarchHare has quit [Quit: Leaving]
givemeyourpies has joined #osdev
dormito has quit [Quit: WeeChat 3.3]
<bslsk05> ​www.righto.com: Yamaha DX7 reverse-engineering, part III: Inside the log-sine ROM
<zid> Any good ideas for redrawing the screen in qemu?
<zid> I don't get vblank irqs or anything to do it that way, set up a timer?
<zid> could hardcode it into a pit/lapic timer interrupt but that feels sorta weird
m3a has quit [Quit: leaving]
jess has joined #osdev
[itchyjunk] has joined #osdev
[_] has joined #osdev
ahalaney has joined #osdev
[itchyjunk] has quit [Ping timeout: 252 seconds]
[_] is now known as [itchyjunk]
pretty_dumm_guy has joined #osdev
sdfgsdfg has joined #osdev
Burgundy has left #osdev [#osdev]
Burgundy has joined #osdev
xenos1984 has quit [Quit: Leaving.]
andydude has joined #osdev
andydude has quit [Client Quit]
the_lanetly_052 has joined #osdev
sdfgsdfg has quit [Quit: ZzzZ]
gog has quit [Ping timeout: 256 seconds]
Oli has joined #osdev
gog has joined #osdev
gog has quit [Client Quit]
nyah has joined #osdev
ElectronApps has quit [Remote host closed the connection]
the_lanetly_052 has quit [Ping timeout: 252 seconds]
isaacwoods has joined #osdev
wikan has joined #osdev
gog has joined #osdev
<bslsk05> ​www.theregister.com: SiFive's latest RISC-V CPU core supports virtualization • The Register
<zid> oh no, the risc-v cpus are doubling
dormito has joined #osdev
[_] has joined #osdev
[itchyjunk] has quit [Ping timeout: 252 seconds]
srjek has joined #osdev
simpl_e has joined #osdev
<Ameisen> I was curious what the compilers do in this situation, but never got around to testing it: https://godbolt.org/z/Yo17P9xfd
<bslsk05> ​godbolt.org: Compiler Explorer
<Ameisen> if you just make functions that do all the things assembly instructions do, but feed them to the compiler instead
<Ameisen> it actually did really well up until a certain point, then it crapped out
<zid> you've found my secret method to port C to new ISAs
<Ameisen> heh
<Ameisen> we actually *did* do this on a port once
<Ameisen> by we, I mean another engineer
<Ameisen> they ported the inline assembly for one arch by just C-ifying it like this
<Ameisen> most architectures aren't as... 'particular' as AVR, so the results were a bit better
<Ameisen> I wonder what happens if we do this with LLVM opcodes instead
<Ameisen> though I should point out that the main thing I proved was that avr-gcc's backend is awful
<Ameisen> a *lot* of absolutely needless clr __zero_reg__
mahmutov has joined #osdev
<Ameisen> what's the point of clearing r1 immediately before another MUL call which is going to repopulate it, or calling it it before moving something else into it?
[_] has quit [Remote host closed the connection]
wootehfoot has joined #osdev
isaacwoods has quit [Read error: Connection reset by peer]
Oli has quit [Quit: leaving]
wootehfoot has quit [Read error: Connection reset by peer]
wikan has quit [Quit: Client closed]
wikan has joined #osdev
dude12312414 has joined #osdev
srjek has quit [Ping timeout: 252 seconds]
wikan has quit [Quit: Client closed]
Oli has joined #osdev
<geist> GeDaMo: neat. yeah i need to sit down and grok the hypervisor riscv extension
<geist> it's unfortunately (IMO) more x86 looking than arm, but i guess the x86 model isn't terrible in the long run, it just seems impure
<geist> but it may be that i'm just misreading it
m3a has joined #osdev
elastic_dog has quit [Ping timeout: 252 seconds]
elastic_dog has joined #osdev
GeDaMo has quit [Remote host closed the connection]
<zid> Tempted to hook the lapic up and use its timer to swap the graphics buffers in qemu automagically
<zid> I'll set a dirty flag on it or something in kprintf
<geist> possible there's a vblank irq you can program, depending on which vga model you tell it to emulate
<geist> klange may know
<zid> I don't think there is, I'm using the vbe / vgabios.c stuff
<zid> it's not in the doc and I can't see it
<zid> in vgabios.c / vbe.c
<zid> maybe if I use a 'real' card rather than vbe
xenos1984 has joined #osdev
<zid> sticking it on a 10ms timer and invalidating a dirty flag with kprintf and userspace asking for a buffer swap isn't the end of the world tbh
<zid> just ends up with a slightly out of place call from my tty stuff to my graphics stuff that I can gloss over
sdfgsdfg has joined #osdev
jess has quit []
dormito has quit [Quit: WeeChat 3.3]
ahalaney has quit [Quit: Leaving]
sdfgsdfg has quit [Quit: ZzzZ]
dormito has joined #osdev
srjek has joined #osdev
Burgundy has quit [Ping timeout: 252 seconds]
heat has joined #osdev
<klange> zid: I just don't think about v-sync
<zid> The conversion begins
<klange> (ftr I just set the tab indicator and space indicator that I normally set to '»' and '·')
<zid> heh
<heat> klange: quick question: when porting kuroko to UEFI did you find AllocatePool so slow that you needed a malloc on top?
<zid> klange: not caring about vsync is nice when you're just updating buffers, but my redraw is so slow I really don't wanna update the buffers until the last minute :/
<zid> even per kprint will be slow
<zid> no compositing
<klange> heat: I tried a few strategies for doing memory allocation in UEFI and I think I ended up at a single flat allocation that I manage myself because it was the easiest thing to discard on exit.
<klange> (Because EFI does _not_ reclaim memory when a loader exits back to the shell)
<heat> ah, it wasn't speed then?
<kazinsal> evil C option: /*******/ for indentation
<kazinsal> just as visually annoying as ;;;;;;;; but works with multi-line expressions
<heat> evil C option: get tired of debating indentation and write it all in a single line of assembly
<Bitweasil> Oh... there was that goofball "C program and PDF and a few other things" as a single line, a couple meg long...
<Bitweasil> I read it a while back, can't recall the exact point of it.
YuutaW has joined #osdev
<CompanionCube> if it's a PDF, perhaps one of the editions of PoC||GTFO
<Bitweasil> It was in that style, but something different.
<Bitweasil> I downloaded a PDF because it was formatted.
<Bitweasil> I think it was a COM file too or something.
<klange> You can't do C and PDF in the same file unless you're willing to cheat as PDFs must start with %PDF
<Bitweasil> I think this was just formatted as a pdf.
<klange> I like my PDF, it's also a bootable ISO.
<j`ey> Bitweasil: can you remember who did it? Ive seen it, but cant find it again
srjek has quit [Ping timeout: 252 seconds]
<Bitweasil> I can't, I'm digging around my stuff, but I don't see it. It was designed to be printed on large format paper, IIRC.
<zid> it was probably tom7
<Bitweasil> Ah, yes!
<j`ey> zid: omg thanks, I was going crazy
<zid> It's always tom7
<Bitweasil> Hah.
<Bitweasil> klange, that's *gross.* :p
<heat> i like how you have your resume in the iso xd
mahmutov has quit [Ping timeout: 252 seconds]
<Bitweasil> I totally get it, would do something like that if I were looking for interesting work. :)
<Bitweasil> Did you guys ever read the story of the guy who brute forced Google's email signing key?
<Bitweasil> It was like 512 bit RSA.
<Bitweasil> He thought a friend was trolling him so he factored it...
<bslsk05> ​www.wired.com: How a Google Headhunter's E-Mail Unraveled a Massive Net Security Hole | WIRED
<klange> heat: I don't have my resume in the ISO
<klange> The ISO _is_ the resume _is_ the PDF.
<klange> There is a file in the ISO that has its extents set to the whole CD.
<klange> Er, actually, this one doesn't have that.
<klange> As you can see on the PDF viewer I've just opened /dev/cdrom0 directly.
<klange> I used to have a file, SELF.PDF, that did the extent trick, so it could be opened on uncooperative OSes like Windows...
<heat> D:
<klange> I've iterated a lot on the exact steps over the years.
<klange> The current one is a slightly modified build of ToaruOS 2 with a mupdf package on the CD. It gets included into the PDF as an uncompressed embed with just the right amount of bytes at the front chopped off so it lines up right where it should be.
<Bitweasil> "Hi, klange, we're looking for someone who can really, really break technology in ways that just won't ever be understood..." :p
<klange> There is some padding at the end (of the embed) as well so that the whole file ends up a multiple of 2048 bytes, which some VMs really want to see with an ISO (you can't just pad out the whole file, because the PDF index structure needs to be at the end, a bit like ZIP)
<Bitweasil> That's a wonderfully ugly hack. :D
<klange> The MBR loader is shifted up so that start of the PDF can go at the start of the file, and I patch in a couple of bytes for an LJMP instruction in the space where PDF literally says "put any non-ASCII bytes here to convince FTP this is a binary".
<klange> Booted from ATAPI, it will find and mount the CD, install muPDF, and add a desktop icon that opens /dev/cdrom0 in it.
<klange> Booted as a hard disk or SATAPI or whatever else I don't support, it'll work as a normal live CD image.
<klange> You _can_ get it to load itself as an ATA hard disk, but I didn't want to hack up the startup scripts too much to support that.
<junon> Popping in and out to say hi
<junon> :D
<moon-child> sup
dutch has quit [Quit: WeeChat 3.3]
<zid> Am I still allowed to hardlock it by ejecting the cd
<klange> I'm reasonably sure that won't hardlock it, but it may confuse the hell out of the block device driver as I don't think I propogate error conditions.
<zid> It hardlocked last time
<klange> How long ago was last time? These ATA drivers have been rewritten and hacked up dozens of times in the last year alone.
<zid> 0.99
<zid> I crashed the jpg loader
<zid> froze it unplugging the cd
<klange> I didn't have a JPG loader in 0.99
<zid> and some other stuff
<zid> whenever that was, few weeks ago
<klange> 0.99 was seven years ago
<heat> 365 weeks ago
<zid> 1.99*
<klange> There has never been a 1.99, 1.99.0 was several months ago, the patch version is critically important here.
<klange> > unplugging the cd
<klange> Was this on real hardware?
<zid> it's not my fault that you reuse version numbers for decades :(
<zid> I feel like I am being browbeaten for you doing it
<klange> I don't reuse version numbers.
<zid> linux had the same problem with 2.6 to be fair
<klange> Anyway, yes, a few releases ago I think there were many places where the ATAPI drivers would just loop forever waiting for an error condition on the device to go away.
<klange> I've since added timeouts to those so in theory it shouldn't happen... in thory...
<klange> I can eject the disk in QEMU and things continue to work, though it still thinks there's a CD and the block device is returning garbage which is confusing the ISO9660 filesystem nicely.
<klange> But everything else is in RAM so most things work. Maybe I can put the CD back in...
<klange> ah, but then my filesystem cache is still full of garbage... hm... I don't have a good way to clear it...
<heat> llvm's x86 code lowering has a file that's 52k lines long
<heat> why
<zid> what's code lowering?
<klange> Is it... at least a _generated_ file?
<heat> llvm bytecode -> x86 selection DAG
<heat> of course not
<heat> hand written
<klange> I gotta step up my game... 11.7k is as big as I get.
gog has quit [Ping timeout: 256 seconds]
<j`ey> AArch64's is only 20k lines
<klange> My compiler isn't even that big in total...
<j`ey> someone should finish off the other 30k
<j`ey> heat: would be interesting to see if GlobalISel eventually replaces SelectionDAG
<heat> what's that?
<j`ey> it's the new backend lowering framework
<j`ey> that doesnt go via a DAG, and is closer in form to the final machine code
<j`ey> "new", it's a few years old
<heat> better code?
<j`ey> it probably doesnt yet, but that was one of the goals, along with simplifying the compiler
<heat> that's neat
<heat> admittedly i'm not too familiar with compilers
<heat> even though i'm knee-deep in toolchain patches
<j`ey> it was only just being implemented when I was working on llvm, but I havent worked on that for like 3 years now