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
<heat> can't wait for intel rocketship riscv very cool cpu
<heat> the v in riscv will finally mean vulnerability
<kof123> general-purpose: not specialized specialized: not general-purpose see also: magnet
<gorgonical> "see also: magnet"
<kof123> devils dictionary joke sorry :D
<gorgonical> oh lol
<kof123> *jokes theres a few like that
<geist> surprisingly i saw on the terasic site a specific FPGA dev board that mentions the intel/riscv stuff
<geist> basically seems to be a dedicated fpga board with the right sized fpga and whatnot to stamp out some of the sifive cores
<gorgonical> this time with l2 prefetchers
<geist> not that you can't on other ones, but if you get a pre-canned bitfile it's probalby for a specific board
<heat> i wonder, can you like just take one of the current x86 cores and replace the frontend with a riscv or arm64 frontend or is that stupid and unrealistic?
<Clockface> i think you could?
Burgundy has quit [Ping timeout: 256 seconds]
<Clockface> it would kind of defeat the point of them though
<geist> if you had a team of engineers and access to it. sure
<gorgonical> that's ironic because x86 is already a frontend
<heat> yeah I mean if Intel or AMD could do that if they wanted
<geist> i think it'd be fantastic actaully
<heat> well, yes, that's the point of my question
<geist> and it's fairly clear AMD did the same thing in the other direction with K12 -> Zen
<Clockface> well wouldent it be a waste?
<heat> since it all ends up a uops anyway
<Clockface> the CPU is designed for CISC
<geist> not at all, oh no. not at the back end. it's all uops
<heat> no
<Clockface> why give it less instructions than it can handle
<gorgonical> hasn't been since like the 90's right?
<geist> you could probably undo some of the more complicated uops needed too
<geist> yah. there's almost certainly some tuning i the back end for the front end, but they're largely decoupled
<heat> AAA sad
<gorgonical> heat: an interesting question is how much "peeling back" would you need to do before it stops being really the same in a meaningful way
<geist> especially over in the vector side of the world
<geist> yah totally
<gorgonical> because risc-v even by RISC standards is quite R
<heat> ship of theseus but the ship has been replaced with nerd stuff!
<geist> but yeah things like Riscv is very aggressive about making sure all instructions are two input one output register, period
<heat> I could imagine them making up an extension or two of useful garbo
<geist> that might change how you build the whole register file and the ROPs and whatnot. ie, the mid end, after the decoder but before the back end
<gorgonical> to the point that the assembler has to do a lot of pseudo-ops actually
<gorgonical> I literally learned last night that you can do an indirect jump because I didn't see it mentioned in the manuals that clearly
<geist> what will be ineresting is if someone really does sit down to build a really high end implementation, where are the downsides of the arch
<geist> lots of folks have pointed out various deficiencies in the ISA for that, so will be interesting to see if they're really issues or not
<heat> this would be a really high end impl
<geist> yah. i think apple making M1 has proven that at least ARM64 can make the jump and the ISA doesn't really hold it back
<heat> 100% better than any pentium 4 garbo sifive is making up rn
<geist> but it's clearly got a lot more design choices tuned for high end stuff
<Clockface> what IS wrong with x86
<heat> yeah arm64 is a lot more "real"
<zid> Anything is non-trash if you throw a billion in R&D at it :p
<Clockface> why does everyone hate it
<gorgonical> Clockface: legacy
<gorgonical> so much legacy
<heat> 1) x86 2) x86 3) x86 4) x86
<Clockface> thats not inherently bad
<gorgonical> oh but
<gorgonical> it is
<zid> "Translate it to aarch64 in the frontend, run it on a real cpu" is always an option
<heat> 5) intel 6) opcodes 7) legacy
<geist> zid: ie, rosetta 2
<Clockface> ?
<heat> 8) so many cpu bugs and hacks
<Clockface> assemblers for it i hear are pretty screwed up
<Clockface> but assemblers are write once and forget about
<gorgonical> one thing that always puzzles me is that there are extra rings in x86 that no modern OSes use
<Clockface> UEFI isnt related to x86, its just often implemented with it
<geist> at the minimum you could start over and re-fit all the x86 opcodes into a cleaner format
<gorgonical> so instead of using them intel invented an orthogonal, extra permissions system for virtualization
<heat> it is related with it
<geist> defrag the layout
<heat> Intel and AMD don't provide their code in a non UEFI package
<kaichiuchi> god
<heat> you either UEFI or pretend UEFI and cross your fingers, best attempt (coreboot)
<geist> also the aggresive multi byte instructions really hurts the front end of x86. there's a lot of talk even if the dual sized riscv opcodes would make it to a syper high end
<kaichiuchi> I have an old packard bell at like... 10 other ancient systems in my back porch
<kaichiuchi> you guys are making me want to dig them out
<kaichiuchi> *and
<FireFly> I think a lot of it is just a general dislike against the duopoly between intel & AMD
<heat> itanium?
<geist> haha i dug out my old P4 last month and fiddled with it for a week
<geist> sometimes you just gotta do it
<kaichiuchi> i get pretty nostalgic about old tech
<geist> heat loves some hot cores
<Clockface> at least intel has their own fab
<gorgonical> FireFly: there's that, too. having to supplicate to one of two companies for your silicon is not the best
<Clockface> instead of outsourcing everything to TSMC or whatever
<kaichiuchi> because problems had to be solved on what was "high end" back then, but really still had their challenges to deal with
<heat> Clockface, and why would I care about that?
<geist> in general most of my complaint with x86 would be helped immensely if intel or amd would clean up a lot of the legacy system mode nonsense
<geist> ie, intel FRED
<kaichiuchi> what the hell is intel fred?
<geist> and remove the old 16 and 32 bit modes, clean up the page table, etc
<Clockface> manufacturing monopoly is still a monopoly
<kaichiuchi> oh
<heat> oh yes, big corp helps the military-industrial-complex and that makes me personally very happy
<zid> FRED is god
<geist> kaichiuchi: it's neat, google for it. hopefully intel will actually implement
<zid> He is the man who will fix x86
<zid> by making swapgs go away and stuff
<geist> AMD had a similar but less aggressive extension to the exception model they wrote a white paper about
<heat> fred? nah, shit's garbage
<gorgonical> Clockface: hardware task switching is another fun feature
<geist> hmm? fred and pml5 isnt related
<geist> side note if you want to fiddle with 5 level paging, qemu 7.x implements it now in TCG
<heat> intel have a clear set of priorities
<heat> none of which are "add fred"
<zid> linux has supported it for ages too I think
<heat> yes, I think qemu has implemented PML5 for a long time?
<heat> certainly before qemu 7
<geist> sur eust mean if you want to actually fiddle with it in your os, and dont otherwise have very new intel or amd hardware, that's a way to get to it
<heat> in any case I can't wait for PML6 while my CPU decodes 80286 descriptor tables
<Clockface> x86 cpu's do sound like hell to implement, but i dont have any reason to care about that since im not a cpu designer
<kaichiuchi> when I worked in the semiconductor industry, intel was a *big* customer
<kaichiuchi> of course they were
<zid> yea there's a lot of that Clockface
<kaichiuchi> this all reminds me of my experiences.
<zid> "Omg x86 sucks", yea, sucks to implement, but you're not implementing it, so what do you care
<Clockface> and im sure the complexity was egged on a bit by anti competitive thinking
<geist> yaeh also *we* as in osdev folks care a lot about it because we have to deal with a lot of the warts of the architecture
<Clockface> but i just program and buy chips, i dont make them
<geist> but most folks dont need to care
<zid> The surface you will actually interact with is pretty okay
<zid> pml4, tss, gdt
<heat> huh?
<heat> I spent 2 confusing days figuring out opcodes
<heat> I still don't understand it
<heat> there's no discernible pattern
<geist> not donnt say theyre pretty okay, but it's the shit sandwich we're fed
<zid> that's because you refuse to read the manual heat, which you admitted :p
<heat> nope, I read it
<Clockface> exactly
<geist> the layers of edge cases with x86 is terrible, especially when you really try to seal in all the security holes
<Clockface> the surface is ok
<Clockface> so the product is OK
<zid> There's nice tables!
<Clockface> the inernals sound like hell, but thats not my problem
<heat> I read the nice tables, but there's so much shit there that you can't help and make a shit sandwich
<Clockface> *internals
<heat> and everything works in a non-logical way
<geist> and after a while you develop a taste
<zid> anything is better than 'most devices'
<heat> this sequence of opcodes does mov $imm, off(%reg) except for RSP which needs an extra byte for whatever reason
<geist> but that's a separate issue from whether or not it's desirable to have all of this complexity, it can be *fun* to absorb complexity
<zid> x86 is a walk in the park to get any specific feature working, compared to say, getting a cd-rom to do a command, or whatever
<geist> i enjoy it, eve if it's objectively not a good thing
<geist> (/me tried to make an atapi pun and really couldn't do it)
<kaichiuchi> i always think of tapeworms
<geist> hmm, go on.
<zid> tape worms are bugs that cause bitrot by chewing on backups
<kaichiuchi> i... cannot speak with any further intelligence on that
<geist> okay. noted
<geist> yo dawg i heard you like scsi
<zid> I found out that modern tapes are surprisingly performant, they can do a few hundred meg a sec
<geist> yah makes sense. it's preotty fantastic how dense they can pack in the bits
<geist> and with that density comes speed
<zid> need to get 8 tapes in a loop and make a pci-e lane out of tape
<zid> That sounds like a tom7 project
<zid> serial link using tape loops
<heat> aww remember that guy in the fuchsia discord that wanted to do something with tape drives?
<geist> like an 8 track computer backup tape
<heat> weird fella
<zid> yea but make the loop as soon as possible
<geist> omg, has someone ever done that with a 8 track?
<zid> basically you use it as a bidirectional link
<zid> s/soon/short
<zid> tape heading towards the device is host writes, tape heading back to the host is client writes
<zid> that's a 1bit bidirectional serial link
<zid> rig up 8, interface it all to a pci-e controller, bam, youtube video
<geist> haha okay, so 8 tracks as a computer tape go way back https://hackaday.com/2013/12/10/8-track-tapes-as-a-storage-medium/
<bslsk05> ​hackaday.com: 8-Track Tapes As A Storage Medium | Hackaday
<zid> I mean, I used cassettes as computer storage
<zid> C64 etc
<geist> yah now it doesn't seem so weird
<zid> so did IBM mainframes in the 60s or whatever
<zid> the vacuum slack system is rad af
<zid> You adjust the vacuum pressure in the columns to do -/+ fast seeking
<zid> the small circles are holes for pumping air in/out
<geist> oh sure, i was just specifically thinking about 8 tracks
<zid> 8 track would be super weird
<geist> but yeah, the pinnacle of reel to reel computer tapes was pretty fantastic
<geist> as curiousmarc puts it, it was back when mechanical engineers roamed the earth and ruled the world
<zid> "Tracks: 1"
<zid> "Wait I mean 8, fuck"
<Clockface> tapes?
<zid> 8 heads 1 track, or is it 8 tracks 1 head?
<zid> I don't know how they specify this stuff
<zid> I only do LBA
<geist> oh on 8 track audio it was 8 tracks, or 4 stereo pairs
<zid> yea I know what the physical layout is
<geist> but yeah you'd have to fast forward until you find the 0 sector
<zid> but what do you say to the software?
<zid> It doesn't really fit my model of CHS
<geist> i mean it's not really that strange, but i would be neat if nothing else
<Clockface> cassete tapes can do hundereds of megabytes a second?
<Clockface> wtf am i reading here
<zid> yes they can
<geist> modern hardware computer tapes can
<Clockface> high or low hunfereds
<Clockface> *hundereds
<zid> a few
<geist> but cassette tapes, no
<zid> VHS is like 2MB/s and the tape moves SLOW
<zid> once you speed it up to 80mph
<zid> and use digital heads
<zid> it goes brrr
<Clockface> tape swap drive?
<zid> The problem is seek time
<zid> which is in the order of tens of seconds for a long tape
<Clockface> ah
<zid> Which is why they're *amazing* for backups
<zid> but crap for much else
<geist> i used to actually own a little 5GB/10GB compressed scsi tape drive back in the early 2000s
<geist> was kinda fun to actually use tar to do what it was designed for
<zid> I wish I had a zip drive when I was a kid
<zid> I was using floppies like a damn idiot, didn't know zip drives existed
<kaichiuchi> i've never played with a zip drive
<kaichiuchi> but I have like... 50 fresh floppies for my packard bell
<zid> yea by the time I knew they existed I was using dvd+rw
<geist> they were faster for sure. otherwise i thik they were a bit late in the game to make much of an impact
<kaichiuchi> fun fact: the packard bell promptly made me shit my pants once, the noise it fucking made
<zid> 100MB though..
<geist> they only ruled the show for like a year or two
<zid> yea that's why most people never saw them i think
<zid> DVD also had a lot of great tech most people never saw
<zid> dvd-ram being one
<zid> dvd-ram was 1996, 2 years after zip, while I was still using floppies, and was gigabytes large
<geist> i had a zip drive at the time but it was a parallel one so was kinda slow and mostly just used it for backup
<geist> way later i got a scsi one off ebay whic is actually kinda useful if you have any retro hardware that does scsi
<zid> They acted like regular hard drives in terms of windows
<geist> since it'll generally just work for that sort of hardware and is a great way to move data between
<zid> but were DVDs
<kaichiuchi> here's the sound my packard bell made
<zid> even today, I could deal with moving files using a dvd-ram drive probably
<zid> kaichiuchi: It's making thinking noises
<kaichiuchi> this happened when I plugged in the IDE cable into the wrong port on the sound card
<kaichiuchi> god that thing is fucking _weird_
<zid> your sound card has ide connectors?
<kaichiuchi> yes
<zid> wat
<zid> packard bell inhaled the magic smoke?
<kaichiuchi> look carefully
<kaichiuchi> the CD-ROM data (which used IDE connectors, but was NOT IDE, different protocol) connection was connected to the sound card
<zid> that's suppoed to be a tiny 4 pin cable
<heat> not many people have 2004 f1 cars, congrats
<geist> yah that was very common: ide on sound cards
<zid> common to some era/setups that weren't mine, heh
<geist> untl you started getting two ide ports on a motherboard, that came a bit later
<geist> when cdroms were ubiquitous
<Clockface> modern software is designed to be coward, i like software that fritzes out and burns instead of "oops something went wrong"
<zid> maybe I missed it by a couple of years, and yet isn't retro enough to be 'cool' enough to be a thing people talk about often
<geist> prior to that having two ide ports on a motherboard would have been pretty extravagant
<kof123> yes, i still think it'd be funny to make a live cdrw or dvd or bluray-rw live distro...i dont know when it fills up, how many overwrites it could handle
<geist> and if you wante d more you just would add another ide card
<kaichiuchi> when I bought the packard bell from ebay, it had windows 3.1 on it
<kaichiuchi> it was a time machine
<kaichiuchi> an absolute delight
<Clockface> i liked it when my mom came in my room and just saw a windows error message and computer garbage scrolling past and the screen was all screwing up
<Clockface> and she was just like "i see you are busy"
<kaichiuchi> it really was like someone from the early 80s dropped this off at my house
<zid> for nerds that's like being caught wanking
<geist> and two ide ports became pretty standard. you cold have 3 or 4 but i guess there wasn't enough market demand (and/or IRQs for it)
<kaichiuchi> when I was a kid I used to be really afraid of BSODs
<zid> caught messing with the family PC, it in a state of undress and disrepair
smach has quit [Read error: Connection reset by peer]
<kaichiuchi> I just... I didn't like the way they looked
<kaichiuchi> somehow they creeped me out
<geist> huh intesting
<heat> right
<heat> they were 100% creepy
<geist> guess that could make sense, like it's a sign of some sort of failure, or destruction, etc
<geist> certainly wouldn't learn to associate good with BSDOs
<heat> and I don't know a single person who's not afraid of a good old BSOD
<kaichiuchi> it just looked like something REALLY BAD was going to happen
<geist> sure
<zid> did I get desensitised or something, I just found them annoying cus I had to restart my neopets gaming session
<kaichiuchi> newer bsods of course aren't scary because they're just :( or kernel panics or whatever
<geist> well sure. i'm thinking if you were really little, like 5yrs old and grew to associate BSODs with bad of you broke or or something
<zid> w7 bsods are scary
<zid> cus they don't happen every 20 seconds
<zid> "oh fuck did my hw die"
<kaichiuchi> yeah
<heat> linux kernel panics are way less scary because they're nerdy, but they're also pretty rare so a good sign something went tits up
<bslsk05> ​en.wikipedia.org: Blue screen of death - Wikipedia
<kaichiuchi> see if I saw this when I was like 7 I think I would've just died
<zid> "ah fuck my hdd better not have just crashed"
<kof123> IRQL?
<zid> reboot and it's still all screwy "fuuuck", the fix it all with a cold-boot, phew
<heat> IRQ level
<geist> back with my apple 2 i remember it was common for games to bomb out and leave the system in a weird place. color burst turned on in text mode, etc
<geist> now i know what that all ways but i thought it was exotic and interesting at the time
<heat> it's like linux's preempt_count but dave cutler has a personal boner thinking about this
<kof123> i just meant the puns write themselves
<zid> yea I did that on a PC thanks to DMI POOL DATA or whatever
<geist> or that one disk i had that had a corrupted file with the 'S' type on it
<kaichiuchi> ah.. that message
<geist> which was otherwise unavailable to DOS 3.3 (apple dos)
<zid> my nes emulator left the display in 320x256 or something persistant through reboots
<kaichiuchi> Verifying pool data or something?
<zid> and I couldn't get the screen resolution thing open because it would open off-screen
<zid> in one of the now-invisible quadrents
<kof123> i still see that on x sometimes
<Clockface> i like how messy PC's are
<kaichiuchi> i dunno, I think I'm a little odd
<Clockface> they make me laugh when they act do stupid stuff
<kaichiuchi> when I got the packard bell it was like I was a kid in the candy store
<kaichiuchi> I even got DOOM running on it
<kaichiuchi> super awesome
<kaichiuchi> kind of wish I was around for the "beginning"
<kof123> which might be a good reason for keeping ctrl-alt- <+> or <-> around, which i believe is not enabled by default on modern x
<bslsk05> ​devblogs.microsoft.com: The case of the application that used thread local storage it never allocated - The Old New Thing
gog has quit [Quit: byee]
<heat> if you read that article, you'll understand that windows is like "what if x86 was an operating system"
<heat> I must imagine the great deal of shitty warts that thing has, mad respect to the windows teams
* kof123 stares at conway's law
<kaichiuchi> i love raymond chen
<Clockface> being a windows dev sounds fun
<heat> kof123, nope, not conway's law
<kaichiuchi> I have a PDF somewhere of him ranting about like... 18 different companies and the level of pain he had to go through to get their shit working
<kaichiuchi> let me see if I can find it
<Clockface> you even get to reverse engineer old programs so you can try to make the OS run them
<kof123> heat: you are saying it was done on purpose, not as a result of having to deal with hardware?
* CompanionCube remembers at one point one of the computers being configured to immediately reboot rather than show the BSODs
<kof123> *or for other reasons
<heat> linux kernel devs have ABI stability because they can't break things and don't want to re-do things in a clean way anyway
<CompanionCube> but i definitely saw it on other computers
<CompanionCube> and i remember the name of one shitty driver that kept crashing me
<heat> glibc people have ABI stability because they can't break things and are not redoing things in a clean way anyway
<heat> windows people have ABI stability and they consistently redo things
<heat> in a clean way? no, hence the shitty compatibility database they use
<kof123> eh, but why do they need it?
<heat> maintainability, performance, security?
<CompanionCube> specifially i remember as a kid disabling the zonealarm firewall so vsdatant.sys would stop with the IRQL_NOT_LESS_OR_EQUAL errors.
<kaichiuchi> god zonealarm
<kaichiuchi> I remember when that was the Thing along with norton or AVG
<heat> kof123, and if you mean "why stability?" the choice is obvious
<kof123> no, im just wondering if different markets have different demands
<kof123> or if somehow relates to app lifecycles
<kof123> or drivers even
<heat> windows users need their programs to keep working and want their workflow to remain the same
<heat> linux users... also need their programs to keep working and want their workflow to remain the same
<heat> as much as OSS people love peddling the OSS software "just recompile everything" BS, it's not feasible is it
<heat> so in this case, it's not a conway's law thing, it's a "we desperately need to keep things working but we also want to change some stuff"
* kof123 points at zid comment "Anything is non-trash if you throw a billion in R&D at it"
<kof123> eh, everything is conway's law or nothing
<kof123> it's a matter of where
<heat> linux chooses the option of "never break anything, avoid sneezing at old code, just add more code, don't remove"
<Clockface> i think most succesful OS's do that
<kof123> *or nothing is
<heat> BSD people choose to break your code and fuck you
<heat> theo will even spit at you if you so choose
<Clockface> this is why linux is winning out
<Clockface> its better for only the OS team to have to do extra work for compatibility
<Clockface> than force *every* team to update some random crap
<Clockface> less effort overall created for the world
<CompanionCube> also different parts are stable in linux vs other oses
<CompanionCube> iirc linux is the exception in having direct stable syscalls vs a stable library you can call
<heat> the base system is 100% stable isn't it?
<heat> yuip
<CompanionCube> openbsd is unique in explicitly enforcing the above, though
Matt|home has joined #osdev
<heat> yeah, it's great, you add some jitter to your syscall and whatever, really good
<heat> what's a syscall fastpath if you don't hold an expensive lock and look at a flag in a region
<heat> didn't they also check if your stack is really a stack? something like that
<kof123> " "just recompile everything" BS, it's not feasible is it" eh...i dont agree or disagree, but i would say these are different "markets" . bsdland is expected to have kernel and userland sources at your fingertips. linux perhaps less so, or depends on distro.
<kof123> so i would say that is the conway's law: does distro expect to ship with full sources, or limited, a compiler, etc.
<kof123> momentum maybe a better word
<heat> that is not conway's law
<kof123> oh but it is
<kof123> what you have at your fingertips
<kof123> no different than what vocabulary you are permitted, or any other "lines of communicatoin"
<kof123> path of least resistance
<CompanionCube> heat: eh, apparently they already check it's a non-writable page so another check in the same function's pretty low cost
<heat> no, conway's law is about structure
<kof123> yes, whether dev tools are built-in or 3rd party (or add-on) is not structure?
<kof123> *as well as how easy to get sources, licensing, hoops have to jump through, etc.
<kof123> not going to argue, but those are all lines of communication IMO much like arguing whether ie is a core component or not
<kof123> i will rest my case with ie
<heat> CompanionCube, I mean, at least they cache it, so ehh, could be worse
<heat> none of that lookup is any cheap though
<rwxr-xr-x> More problems! I'm trying to link together this kernel i've written in ASM, and it's not having it. In my main program it loads everything, then jumps to the position it expects the kernel_entry to be at, which is just an asm entry point that sends power over to the kernel.
<rwxr-xr-x> Here's the code: https://github.com/FrostWizard4/Hermes
<bslsk05> ​FrostWizard4/Hermes - Hermes (0 forks/0 stargazers)
<rwxr-xr-x> What *should* happen is after loading 32 bit mode it hands power over to the kernel, which should print to the screen, which it can't yet, but I haven't even gotten to linking it together, trying to by [extern]'ing the kernel function fails, the linker can't find it
<heat> i hope you understand that "not having it" doesn't help much
<heat> build log?
<rwxr-xr-x> Whoops, i meant to elaborate, and forgot lol
<rwxr-xr-x> I have a linker built, the specific command where shit breaks is here:
<bslsk05> ​github.com: Hermes/.#kernel_entry.asm at main · FrostWizard4/Hermes · GitHub
<rwxr-xr-x> (rootLAPTOP-L12COLSV)-[/usr/local/github/Hermes]
<heat> ok that's it thanks for your hostname you're getting fucked hacked
<zid> not just hacked, fucked hacked
<heat> by the time you wake up tomorrow I'll be all over your shit
<heat> oh absolutely, I'm a gentleman
<heat> i don't backdoor your system before backdooring something else if you know what I mean
<bslsk05> ​gist.github.com: test.txt · GitHub
<rwxr-xr-x> There XD
<rwxr-xr-x> Thanks for backdooring
<zid> which of those two is supposed to have _start in
<heat> WHAT?
<bslsk05> ​github.com: Hermes/ports.asm at main · FrostWizard4/Hermes · GitHub
<zid> haha that's amazing
<rwxr-xr-x> i don't think you'll get much use out of LAPTOP-L12COLSV
<zid> kernel_entry.asm extern's kernel_start, kernel.asm externs nothing
<zid> why are you surprised it can't find _start?
<heat> dude what
<zid> neither global anything
<heat> why do you do pusha and popa in every function?
<zid> C is too fast, and return values are for noobs.
<Mutabah> why have a function at all, when you can just include the `in`/`out` instructions directly?
JariC64-- has quit [Quit: leaving]
<rwxr-xr-x> readability
<rwxr-xr-x> I like it better, if I have to go back and review code
<Mutabah> (Fun fact, with how well rust code can inline - I've seen port accesses inlined directly into the call site)
vai has joined #osdev
<zid> read..ability
<zid> wtf
<rwxr-xr-x> as for the pushing in every function, even I have no answer for that
<heat> fyi pusha is not push %ebp; mov %esp, %ebp
<zid> call inb_function (cannot see arguments, what registers are now corrupt etc), vs in dx, al
<Mutabah> I.e. the i8025 keyboard code compiles to have the `in` instructions literally there
<zid> which is both smaller, and doesn't have that problem
<zid> readability to you means 'I had to read more text, therefore it is more readable'?
<rwxr-xr-x> No, skim kernel.asm, is it easier to understand than if the in/out was inlined?
<zid> Yes, 100%
<zid> err no 100%
<rwxr-xr-x> I don't think so, it makes it easier to follow the flow of the program for me
<zid> I read your sentence inside out. It is 100% harder to read with random calls.
<zid> By your theory the ideal program would be call addf; call mulf; call lea_f; call addf; call callf;
<heat> call callf sounds very post-spectre
<rwxr-xr-x> No, if I have a program that will grow larger over time, and is filled with calls that I as a begineer will likely have to refresh myself on later, it's nice to have some things, specifically instructions that will take other regsiters and use them, and make it a function
<zid> but that's what an instruction already is
<zid> it's a functional unit that takes registers as inputs and outputs, and performs an operation on them or with them
<zid> inb(dx, al); == inb dx, al
<rwxr-xr-x> Yes, I just did that again to make a bit higher level
<zid> I'm saying the former is entirely redundant.
<zid> It *subtracts* clarity because now I have to hunt down the definition of inb() and make sure it isnt' doing anything stupid, like popa; ret
<rwxr-xr-x> So, i've reinvented java is what I'm hearing
<rwxr-xr-x> I see your point, it basically only helps me, it makes it confusing for others
<zid> It doesn't even help you
<rwxr-xr-x> and could actually make it worse for me if I forgot what the hell it does
<rwxr-xr-x> yeah
<heat> this only remotely works if you have a nice plugin or IDE that can take you directly to the function
<heat> which I 100% assume is not the case with your ASM setup
<rwxr-xr-x> alright, i'll do what god intended and use comments
<rwxr-xr-x> haha
<zid> (You know you added a fatal bug right?)
<rwxr-xr-x> emacs doesn't do that shit LOL
<zid> claiming it works is a bit of a stretch
<rwxr-xr-x> yes
<rwxr-xr-x> stretching to the breaking point
<heat> if you want correctness and slowness, use enter and leave
<zid> Good luck adding a bug to an instruction...
<zid> I'm sure you'll somehow pull it off, I believe in you!
<zid> But anyway, your linking issue
<zid> [01:24] <zid> kernel_entry.asm extern's kernel_start, kernel.asm externs nothing
<zid> [01:24] <zid> why are you surprised it can't find _start?
<rwxr-xr-x> I'm literally the monkey at the typewriter writing shakespeare
<rwxr-xr-x> the irony is not lost on me
<heat> if you find a valid use for AAA, AAD, AAM, AAS I will not hack you
<zid> neither global anything* too, importantly
<zid> heat: implementing my real mode z80 emulator
<zid> <-- unhackable
<rwxr-xr-x> I have no care in the world about _start currently, the issue i'm worried about is the undefined reference
<zid> To what?
<zid> (hint, line 4 of your paste)
<rwxr-xr-x> to kernel_start, I believed that by using [extern kernel_start] kernel_entry would be able to reference kernel_start, not the case apparently
<rwxr-xr-x> in the gist?
<zid> Okay, so where is that *global'd*
<zid> try nm kernel_entry.o
<rwxr-xr-x> first off, very cool tool, second off, it prints U kernel_start
<zid> That means it wants it as an import
<zid> like my serial.o wants outb
<rwxr-xr-x> yeah...
<rwxr-xr-x> that's wrong
<clever> so some other .o file, must then export kernel_start
<zid> so you have it inside out, like I keep saying
<zid> you want to *global* it
<zid> not *extern* it
<clever> or that
<zid> extern in nasm has the same semantics as C
<rwxr-xr-x> OHHH
<zid> extern -> this function is found in an external location
<klange> 'extern' says "this is defined somewhere externally"
<zid> global -> This thing is a global symbol
<klange> 'global' says "make this a global symbol so it can be referenced elsewhere"
<rwxr-xr-x> shit
<heat> i find it very annoying how in NASM you need to explicitly extern symbols
<heat> GNU AS superiority
<zid> yea I wonder if there's a switch for that
<heat> praise be the GNU
<clever> praise be the GNU
<heat> yes it's called as(1)
<rwxr-xr-x> yeah but GAS you need to put a damn % behind everything
<rwxr-xr-x> more like GASS
<heat> yes and it looks cool and the syntax makes more sense
<heat> also AT&T best corporation and monopoly ever
<zid> (the syntax does not make more sense, that's a stupid lie that isn't even passably believeable)
<zid> If you're going to troll the trick is to make it sort of funny and believeable heat
<rwxr-xr-x> finally some sense
<clever> i work on many arches, and gnu as has the same meta syntax for all, i dont have to re-learn the assembler every time i change cpu
<clever> so nasm just seems like a pointless tool to me
<clever> the only thing i have to relearn is the cpu specific instructions
<zid> nasm is nice if you're sticking to x86, and don't want your brain to rot out of your skull
<heat> also nasm is objectively poor and an extra dependency you need to carry around
<zid> but it's slightly a waste of time compared to -masm=intel
<heat> also gnu as can do intel syntax for the weirdos
<zid> if your m key is broken, nasm doesn't even help work around -masm=intel :(
heat_ has joined #osdev
<Mutabah> nasm has the massive bonus of actually using intel/AMD's official assembly syntax
heat has quit [Read error: Connection reset by peer]
<Mutabah> Intel-mode gas still has some non-intel quirks
<heat_> i'm pretty sure intel's official assembly syntax is not NASM but MASM
heat_ is now known as heat
<geist> yah to me all x86 asm is a PITA, so one syntax over the other isn't particularly nicer
<rwxr-xr-x> 2 questions here, I use global instead of extern by [global kernel_start] Correct? or are the brackets unnecessary? which leads into the second question, what do they even do? I know with registers they reference the spot in memory the register holds instead of the data in it.
<geist> which assem ler is this?
<rwxr-xr-x> nasm
<heat> nasm
<geist> ah no clue
<moon-child> you don't need the brackets
<Mutabah> `global` exports a symbol from the current file
<moon-child> you should use 'global' in a context where you are _defining_ a symbol which you want to refer to from other translation units
<heat> assemblers support Every Syntax(tm) in order to confuse you
<Mutabah> `extern` references a symbol from outside
<moon-child> you should use 'extern' in a context where you want to _use_ a symbol which you dfeined in another translation unit
<Mutabah> I think the square brackets are optional, but encouraged?
<rwxr-xr-x> tm heat LOL
<heat> gnu as supports .global and .globl
<heat> just in case your a key is broken
<rwxr-xr-x> i've seen .global in other asm files, but it confused me lol
<moon-child> same principle as creat
<moon-child> .global is for gas; global is for nasm
<rwxr-xr-x> got it
<zid> The square brackets look weird to me
<heat> you should write assembly as god intended, using K&R C
<moon-child> lul
<rwxr-xr-x> jesus
<rwxr-xr-x> what do you use zid?
<rwxr-xr-x> do you just not put the brackets or are you using GAS?
<moon-child> rwxr-xr-x: (in general, gas uses names beginning with . for meta-directives, and nasm does not. There are many diferences on top of that; you should generally expect nasm and gas to behave differently, or to have different ways of doing the same thing)
<moon-child> (though the problem space is constrained enough that there will obviously be some similarities)
<heat> K&R C as provided by the standard tool cc(1), assembled by the standard tool as(1) and linked by the standard tool ld(1)
<moon-child> praise^Wdamn ken
<heat> and, of course, preprocessed by the standard tool cpp(1) (screw you c++)
<geist> right, tgat's kinda what clever was talking about and the reason i use gas. particular architectures' instruction syntax aside, the directives like .globl and whatnot are the same between arches
<geist> so if you're doing a lot of cross arch stuff it's nice to use the same assembler
<moon-child> I wrote my own assembler. So if I ever target another arch I'll have to add another target :)
<heat> I find it annoying that architectures don't have the same syntax
<moon-child> (that said I kinda lost interest in osdev ... I just lurk here ...)
<heat> even in GAS
<zid> moon-child just loves me too much
<moon-child> yeah, there's like # for arm immediates right?
<moon-child> though I think it's optional
<heat> and the argument ordering goes against AT&T syntax in a bunch of archs too iirc
<zid> I mainly try to avoid gas where possible just because even its intel syntax is a bit funky sometimes, compared to a 'helpful' assembler like nasm
<rwxr-xr-x> Oh also, want me to make your job easier and just hand out my private ssh key heat?
<heat> yup, including riscv: lb a3, 0(a1)
<rwxr-xr-x> way easier than trying to backdoor my computer lul
<heat> how can I hand out your private ssh key if I haven't backdoored it yet
<zid> you can't override instruction encodings, sometimes it wants 'd/q' for the 'native sized' version of a thing etc
<heat> smh
<rwxr-xr-x> smh my head
<zid> because you can't tell it the cpu mode and then have it do the sane thing automatically, etc
<geist> well that wsas exactly th point of AT&T syntax: to define One True Syntax for all the relevant arches at the time (VAX, M68k, x86)
<geist> you have just forgotten about the other ones
<zid> which imo, makes it fall flat for certain special cases
<zid> and you just *have* to use nasm in that case, or start writing out .db 0x66, 0xC3 and stuff
<heat> i'm sure you can always patch GAS
<geist> moon-child: yeah re # for constants on ARM syntax. i only sort of found that out recently by leaving it off and being surprised it works
<heat> shouldn't be too hard
<Matt|home> evening..
<moon-child> why would you write 0x66, 0xc3
<moon-child> c3 is a vex prefix, and it has a virtual 66 bit
<geist> there's also a particular pattern that some arches take where you *never* overload the opcode nmemonic and those you have no ambiguity
<zid> because it was an example using made up numbers that should have been safe from a conversation about what those numbers are >_<
<geist> that's wha tyou get with raw POWER ISA as defined by IBM
<geist> and it's Bad as far as i'm concerned
<geist> you end up with fun instructions like `rlwinmin 5,6,7,8,9`
<geist> where if you know the instruction you know which of the digits mean what. some are registers, some are constants. non ambiguous
<moon-child> urk
<geist> in response to that i actually *like* it when isas force you to mark constants vs registers, etc
<geist> ie, # and %
<zid> It's probably useful for isas that number their regs, yea
<moon-child> it's not necessarily bad, but it breaks badly when they have some 'default' behaviour when you forget the marking
<geist> other examples on POWER would be like `add 1, 2, 3` vs `addi 1, 2, 3`
<geist> one of which is a constant, one is a register. non ambigous
<heat> x86 also numbers the regs but pretends it doesn't
<rwxr-xr-x> okay, so after globalizing kernel_start, when I try to create a object file of kernel_entry it says kernel_start is not defined when it tries to call it, i'm *assuming this is because I need to include the kernel into kernel_entry?
<geist> OTOH most POWER/PPC assemblers accept 'r' as a prefix
<moon-child> like, if I said 'add x13, %x5, %x4', and it went and added to the memory address named by symbol 'x13'
<moon-child> just as a completely hypothetical example
<zid> mips numbers them in two different ways, eat it assemblers
<heat> and in some aspects it doesn't because you need a whole ass prefix to access the other half
<moon-child> that has never come up in the real world
<moon-child> and has never caused anybody any problems
<rwxr-xr-x> I'm gonna try it lol
<geist> moon-child: yeah that's what i dont like about the intel syntax. it's token specific if eax is a symbol or a register
<geist> att at least forces a % vs no %
<zid> given free choice, I'd add an override for it
<geist> of course there are a ton of other problems with att, so it's definitely not perfect
<zid> but make no-grammar the default
<heat> can we have a small break and acknowledge how poor assembler error messages are?
<moon-child> is it context specific? I'm pretty sure it's always a register
<zid> binutils suffers from that in general
<zid> gcc has good errors now, binutils is still stuck in the 80s
<geist> moon-child: probably, but means of course you can't have a symbol named eax
<heat> even llvm does
<moon-child> idk how you'd actually refer to a symbol, though. In my assembler I used ` as an escape, so eax is always register, `eax` is always symbol
<geist> or if you do there must be some way to override it
<zid> moon-child: yea exactly what I'd do
<zid> make % and escape or ` or something
<moon-child> https://outerproduct.net/2021-02-13_att-asm.html my thoughts on att assembly
<geist> is that an issue? probably not but i do like the % and # stuff
<bslsk05> ​outerproduct.net: Why no one should use the AT&T syntax ever, for any reason, under any circumstances
<heat> zid, also, here's a funny irk: binutils utilities don't support "-" for stdin input
<geist> but that is straight out of DEC syntax. it's what VAX did and that was what was copied in ATT
<zid> binutils really needs like.. a spring clean
<moon-child> I don't super mind %/# (_if_ you say unsigilled names are meaningless), but I also don't think they're super helpful either
<zid> add some very basic normal switches like say, -v, error messages that make sense, etc
<moon-child> do _you_ wanna touch that codebase?
<zid> that's the problem, it needs a spring clean, so nobody wants to spring clean it :P
<zid> and now it's a deep carpet shampoo jobbie
<geist> but yeah what didn't work right was trying to cram a much more irregular arch (x86) with relatively poor addressing modes into the syntax of something that was much more regular's syntax (VAX)
<geist> so you end up with weird quirks that dont really make sense
<heat> it needs a rewrite
<heat> GNU gold was a good BFD rewrite but then google ditched it and now it's dying
<zid> if you do that you end up bikeshedding what's important to include and what isn't
<geist> m68k AT&T syntax is also kinda odd too, for the same reason
<zid> and it has to compete against gold/ld
<geist> what's kinda neat about it is it's unambiguous with the official motorola syntax, so it's not a modal thing like AT&T and intel syntax for x86
<heat> lld was written cleanly and now it's way better than any GNU linker and 10x faster
<geist> since mot syntax is in the same directin (left to right) and the way it is structured can't be interpreted any other way you can do it line by line
<geist> since at the time most arches went left to right it made sense
<zid> I've never used lld ever
<geist> and this gas accepts both syntax at the same time
<heat> you should
<zid> I wonder if I have it, lemme see
<heat> especially being a gentoo fanboy
<zid> lld: command not found
<moon-child> ld.lld?
<heat> lld shaves off a lot of time from big links
<heat> yup
<zid> neither that, nor clang
<heat> shame, shame on the house of zid
<geist> but what is odd is the AT&T m68k syntax has @ as a suffix to mean 'dereference this' which is kinda odd
<bslsk05> ​github.com: lk/asm.S at master · littlekernel/lk · GitHub
<zid> It makes it hard to use, when you don't have it
<moon-child> dw clang is only good for c++
Lumia has joined #osdev
<heat> what
<zid> I've got a scary picture to spook heat if he tries to get me to install it though
<heat> clang is better in C than gcc
<moon-child> no it's not
<heat> zid, spook me
<moon-child> at best it's on par
<heat> moon-child, yes it is
FreeFull has quit []
<moon-child> ime it generally compiles faster and gives better diagnostics
heat has quit [Quit: Leaving]
<zid> spooked ^
<geist> since we're talking assemblers ou have to also consider the built in clang compiler which basically tries to be on par with gas
heat has joined #osdev
<geist> s/clang compiler/clang assembler/
<zid> unspooked
<heat> zid, you post that shit again
<zid> Need to work on my debuff duration
<Mutabah> moon-child: Reading that article on at&t assembly... they refer to x86 as "SIB"... but the SIB byte wasn't present on the 16-bit version :D
<heat> moon-child, clang compiles faster, gives better diagnostics, spearheads new sanitizers and supports all/99% of the GNU C constructs
<heat> how is clang bad for C again?
<zid> does it have -fanalyzer
<moon-child> it's not _bad_. Just not as good as gcc. In my experience
<zid> clang is sorta random on what it gets right and what it gets wrong
<heat> clang-tidy and all surrounding tools, have been there for some good years
<zid> I think geist was talking about it the other day
<heat> also has a code formatter
<moon-child> I'm sure it used to be worse. Don't talk to me about gcc 4 e.g. :)
<zid> it might miss some really obvious optimization in the cracks because it's trying to do a really complex pass beforehand
<geist> yeah it's oretty much objectively better than gcc in most ways except maybe micro code gen, and architecture support
<zid> I'm a late-adopter
<geist> and in the micro code gen case its fairly use case dependent
<zid> I'll switch once it's stupid to keep using gcc
<moon-child> meh I don't trust clang or gcc to do a good job with codegen :)
<heat> I doubt gcc will ever be too stupid to use
Lumia has quit [Ping timeout: 260 seconds]
<zid> They're probably parity now, but eventually gcc seems like it will be be behind
<zid> and if that gap gets too big to ignore, I will swatch
<moon-child> maybe. Afaik, development on the clang frontend has also stalled
<moon-child> (obv lots of work on the backend still)
<geist> some arches are better off in some cases too, to be clear
<moon-child> whereas redhat is still paying people to work on gcc. Only good redhat product
<geist> riscv for example seems to be soemwhat ahead on gcc. if nothing because that's what sifive seem to be putting time into
<heat> GNU tooling has a lot of hands on them still. the traditional linux players, the CPU vendors, etc
<moon-child> wait what? Didn't sifive hire chris lattner?
<heat> dude GNU ld.bfd is still the only linker that supports RISCV relaxations
<geist> exactly, that's a biggie
<moon-child> so why are they doing gcc? :P
<zid> oh shit
<zid> what day is it
<heat> lld doesn't even pretend to process them, it just blows the fuck up and fails to link. yay!
<heat> 1st of december
<zid> advent of code day
<geist> gcc/binutils is what i mean
<zid> brb advent of code
<heat> oh wow yeah good idea
Lumia has joined #osdev
<zid> oh wait, 3 hours
<zid> phew
<heat> fuck
<heat> I think I'll do this first one in explicitly K&R C
<zid> heat: ping me in 2:30
<moon-child> do it in B
<zid> I've already decided which operating system to use
<heat> but srsly this might be the time I learn rust so I can circlejerk properly
<heat> I was expecting this to be the modRM table. i am disappointed
<zid> I can do like, super super basic rust
<zid> but I can't do enough of it to invovle like.. pointers
<zid> because of the object lifetime ownership mut symantic stuff
<zid> see
<heat> wtf is wrong with you
<zid> I don't even know how evil pointers are
<zid> EAT mut POINTER as uint32;
<geist> using pointers is like driving your car alone
<zid> unsafe{}
<bslsk05> ​twitter: <zhuowei> fuck "rust". everything i write is unsafe. raw pointers without the bounds. no, i will NOT check for overflow. string dot h. i live for this
<rwxr-xr-x> broo XD
<geist> it's like co-developing with Hitler
<rwxr-xr-x> I look back at my screen and see in all caps, WHERE WE'RE GOING WE DON'TNEED POINTERS lmaoooo
* geist bows
<heat> writing in C is like getting an internship at the Schutzstaffel
<zid> I don't know what that one is
<zid> is it food
<zid> big german compounds are either horrendous torture camps, or food
<heat> why not both¿?
<geist> anyway yeah i gotta learn rust too
<zid> geist you mean
<zid> Speaking of horrendous torture camps, anyway yea I gotta learn rust too
<geist> so i can use this knowledge to BEAT THEM AT THEIR OWN GAME
<heat> absolutely
<geist> yeah it's like one of those training montages
<geist> me pouring over rust books, powering up
k0valski18895 has quit [Ping timeout: 256 seconds]
<zid> You can't actually use the rocky steps for your training montage, it's full of people taking videos of themselves doing rocky training montages
<zid> true fact
<heat> yeah, reading the rust spec, getting powerful... wait a second
<kof123> didnt geist say once he had a powerglove
<geist> or trying to cross in front of Abbey Road because you'l just get run over by a delivery lorry
<kof123> surely that is part of any montage
<geist> oh man, it's so bad ass
<geist> yah back in the day they had to photoshop out all the other peopel in the album cover
<zid> They used that tech where you take a bunch of snaps, and average out the pixels
<zid> big demonstration of digital editing techniques at the time
<heat> https://miro.medium.com/max/640/0*_26hhtTygdDWFr9A.jpg otoh england looks like this 25/7 so that abbey road pic is starting to look real good
<geist> there is an abbey road cam, kinda neat
<zid> americans jealous of zoning laws as usual
<bslsk05> ​www.earthcam.com: EarthCam - Abbey Road Cam
<heat> i'm not american zid, do you remember?
<zid> heat: Likely story
<heat> poortugal is at least sunny and warm
<heat> and with free healthcare
<zid> yea but you can only grow palm trees
<zid> have to eat spaniards to survive
<heat> no palm trees here señor zid
<geist> https://www.spaceneedle.com/webcam/ is kinda neat fwiw
<bslsk05> ​www.spaceneedle.com: Space Needle Panocam | Space Needle
<zid> damn, you can't even grow trees? what are you, iceland?
<heat> fyi the next cam in that eartcam thing is "key west, fl"
<heat> so don't click next
<heat> fair
<sbalmos> geist: you need to stay ahead of the curve. everyone's writing kernels in rust. hell, if I'm writing one in rust, then it's a boring old "mainstream" language now. ;) you need to switch to learning zig.
<zid> (actually is morocco, owned)
<zid> what about cyrstal
<geist> move zig
<zid> It's like rust but worse somehow
<geist> do you do meth in crystal?
<heat> avg algarve pic
<sbalmos> for great glory, set up us the zig dev env
<geist> okay enough of this. i'm going to do something productive
<geist> like pet the cat
<heat> absolutely
<geist> uh! that soundslike some gen z humor
<zid> which one is z
<zid> oh zoomers
isaacwoods has quit [Quit: WeeChat 3.7.1]
<geist> yah zoomer humor operates on some sort of meta level
<geist> sometimes makes sense, but it's like multidimensional humor where others only see how it is projected into our universe
<heat> norf fc best footie club lads
<rwxr-xr-x> zoomer humor is dogshit most of the time
<geist> also possible
<rwxr-xr-x> its like a fever dream while you're high
<heat> stfu
<geist> but it's like dogshit as displayed in a art museum on a golden platter
<geist> is it art? depends on how you present it!
<rwxr-xr-x> EXACTLY
<zid> making fun of gay bashing racist xenophobes isn't exactly zoomer humor
<zid> a refried spongebob meme about avacados this ain't
<bslsk05> ​'TWO GAMMONS IN A PUB: Alan and Steve tell it like it is' by Local Community Squad (00:02:57)
<geist> does not involve beans, that is true
<geist> aaaanyway
<geist> this is i think too offtopic for today
<geist> back to bitching about gnu assembler
dennis95 has quit [Quit: fBNC - https://bnc4free.com]
andreas303 has quit [Quit: fBNC - https://bnc4free.com]
<geist> and/or emacs
<kazinsal> M-x beans
<zid> M-x vim
Lumia has quit [Quit: ,-]
<heat> rustrustrustrust
<zid> heat teach me rust really quickly
<zid> how do I make a linked list
<heat> is it really programming if you're not strcpy'ing around
<heat> oh wow so, i have a really good answer for that
<bslsk05> ​rust-unofficial.github.io: Introduction - Learning Rust With Entirely Too Many Linked Lists
<Mutabah> zid: `struct List<T> { item: T, next: Option<Box<List<T>>> }`
<zid> this is more my jam
xenos1984 has quit [Read error: Connection reset by peer]
<zid> oh nevermind then
<zid> > cargo new --lib lists
<Mutabah> In seriousness - "Too many linked lists" is great
<zid> double nevermind then
<Mutabah> Huh?
<zid> what's the rust compiler called
<Mutabah> `rustc` is the actual compiler
<Mutabah> and you can use it directly, but `cargo` is much easier
<Mutabah> `cargo` fills the role of `cmake` or visual studio
<zid> I don't like cmake or visual studio though
<heat> you can overengineer yourself into gn
<Mutabah> `rustc foo.rs` will work - you can use the standard library without cargo
<Mutabah> just... it's not the conventional way of doing things
<kazinsal> is it called `cargo` because someone early on in the rust ecosystem's development made a cargo cult programming joke and someone took it a step too far
<Mutabah> Even for my kernel work I've moved to cargo
<zid> it won't compile because I didn't use camelcase
<zid> :(
<Mutabah> kazinsal: I think it's because the name chosen for a compilation unit was "crate"
<Mutabah> zid: It should only warn on that
<kazinsal> that makes a good deal of sense
<heat> >camelcase
<heat> rust bad
<kazinsal> you've heard of significant whitespace, well here's significant identifier naming
<zid> If types are supposed to be camcelCase why is it not I32
<Mutabah> types are CamelCase, functions/variables are snake_case, globals are SCREMING_CASE
<Mutabah> But that's entirely convention
<sbalmos> zid: primitives
<zid> Box is actually malloc?
<Mutabah> (primitive types aren an exception, legacy reasons)
<Mutabah> zid: `Box` is C++'s `std::unique_ptr`
<zid> I don't know C++
<Mutabah> (a wrapper around malloc/free)
<zid> It appears to be malloc.
<heat> it's malloc and gets freed automatically brexit C89 man
<zid> box is just a weird name for malloc so I had to look it up
rwxr-xr-x has quit [Remote host closed the connection]
<zid> it angle brackets a T and a Global, and global appears to be the default implementation of 'Allocator'
<zid> 'ate
<heat> oops
dennis95 has joined #osdev
<Mutabah> It's a box you put a value into to make the value easier to move around :)
<zid> ah I see
<zid> This is like learning C but in french
<zid> they've renamed all the things
<zid> int baton_magique;
<Mutabah> Box serves two purposes: When you need indirection (in the linked list example above, or with dynamic dispatch), and when you have a very large type you want to move about a bit (without having to copy large amounts of data)
<zid> I know what malloc is
<Mutabah> `Box` isn't the only wrapper around malloc
<Mutabah> `Vec` is too
<zid> yes but, I know what malloc is, I didn't know what *box* was
<zid> You don't have to explain malloc >_<
<heat> Vec is a vector zid, it's like a magic realloc thing that does it for you
<Mutabah> (and `Rc`/`Arc`, although they have extra meaning)
<zid> yes I know what vectors are, the name makes sense
<zid> well, sorta, in that the name is used elsewhere
<zid> vector is still ultimately a silly name for a dynamic list
<heat> paypal me 20 eur or no more Modern <-> C89 translation for you
<zid> box is just some random jargon exclusive to rust
<sbalmos> ... and then there's Rc, Arc, ...
<Mutabah> I agree there - it is the only place I've seen the term in programming
<Mutabah> but it's a lot nicer than `unique_ptr` given the context
<sbalmos> well they already used reference and pointer for ownership-borrowing stuff, so they had to make some other name ;D
<zid> This immediately derps into methods, do I have to do that
<zid> or can I use functions and TUs
<zid> I guess I lose out on the 'automatic' methods like new and stuff and it doesn't work?
<Mutabah> You can use free functions...
<Mutabah> there are no automatic methods like that
<Mutabah> `new` is just a conventional name for an associated function (function under a type's namespace) that creates a new instance of the type
<sbalmos> think factory/builder method
<zid> oh that's nice
<zid> sbalmos: no
<sbalmos> heh
<zid> most languages reserve a bunch of names for default behaviors like new/del
<heat> VecFactory when
<zid> python even has fucked up ones like __THINGY__
<zid> so like 80% of 'normal' python code ends up looking like self.__ARSEBANDITRY__ = ...
<zid> "idiomatic!"
<sbalmos> heat: impl VecFactoryBuilderBean<'a, E, I, O, U> { ... }
<heat> sir, you sneazed a ' into your code
<zid> the ' is the IPA symbol showing where the stress is, heat
<zid> it's on the a
andreas303 has joined #osdev
xenos1984 has joined #osdev
<zid> lua does it too actually
<zid> it has special stack offsets you mess with to change the table table table
<zid> heat: enum Formula1 { Box<Box<Box<T>>>, }
<zid> am I doing rust right
<heat> yup, lgtm
<heat> i am christian horny for that code
<zid> I'm going to.. mark my webber all over it? idk
<heat> have you noticed how every australian person is portrayed as "haha funny australian quirky dingo shooey mate"
<zid> That's because it contrasts with americans who are "Must phone into work, it's been 37 seconds since I had my kidney surgery, if I'm late they will fire me"
<zid> austrialians are what is known as "content"
<zid> They live in a barren hellscape with only deadly animals as company, they have adapted
<klange> It is December 1st. AoC is coming.
[itchyjunk] has quit [Remote host closed the connection]
<heat> yup. i'm warming up my K&R C
<zid> yea that's why we were talking about rust
<heat> i think go is more attractive to me than rust
<heat> it's a pretty complete language with none of the borrowing ownership lifetime BS
<zid> if you like go so much why don't you go away!?
<heat> ow
<zid> That's what I thought
<heat> if you like rust so much why don't you stab yourself with a rusty shank and die a painful infection-ridden death
<zid> Because I have a box
<Mutabah> heat: Woah... chill dude
<zid> why
<Mutabah> (Really both of you, but that shank comment was over the top)
<zid> don't be mean to my little heat Mutabah :(
<heat> hahahahaha
<zid> He needs to vent these tendancies otherwise it'll be the pig carcasses again
<heat> this is what the brits call "cheeky banter m8"
<Mutabah> This is a public channel, maybe try to avoid (even joking) violent comments
<zid> Mutabah are you a merrican
<zid> John Hodge sounds like a very merrican name
<Mutabah> zid: I'm a "chill" Australian
<zid> You mean, passivated
<Mutabah> Please refrain from personal comments.
<zid> note: Mutabah has not infact, been zinc coated
<heat> hey let's all be nice okay
<heat> some people don't appreciate the cheeky sarcastic bri'ish banter and that's ok
<zid> Or being coated in zinc.
<Mutabah> In a more private forum I wouldn't care much. But remember, this is a public channel. Let's keep the discourse above the level of painful homocide
<heat> :thumbs_up_emoji:
<zid> I thought robots were cool
<heat> ... I really should give rust another chance this AoC
<heat> my problem is usually that the complexity of AoC starts evolving so quicky I end up throwing <language> out the window for C or C++
<bslsk05> ​tenor.com: Stingy Dont Wanna Share GIF - Stingy Dont Wanna Share Mickey Mouse - Discover & Share GIFs
<geist> yah part of what i was trying to figure out is cargo
andreas303 has quit [Quit: fBNC - https://bnc4free.com]
dennis95 has quit [Ping timeout: 260 seconds]
<geist> like precisely how the structure of the libs and all that work. the notion that there'sa lib.rs at the root of each lib, etc
<geist> kinda strange but once you get it i guess there's some sense to it
<zid> lib.rs = Dllmain?
<geist> in a world withtout headers but wanting to strictly control things
<heat> no
<Mutabah> `main.rs` is like `main.c` in a C project
<Mutabah> `lib.rs` is maybe `library_root.c` (i.e. the plac where you'd put your library's entrypoints)
<zid> DllMain
<zid> Is exactly that
<geist> it's like it's really the only file rustc is passed on its command line (correct me if i'm wrong) and the rest of them are discovered by the compiler because of imports
<geist> thats the part that kinda blew my mind but makes sense once you get it
<Mutabah> Entrpoints meaning: Symbols users call
<Mutabah> (not the DLL entrypoint)
<geist> right, exports from the dll
<heat> lib.rs is where you pull all your crates
<Mutabah> geist: Yep
<heat> er,
<Mutabah> Although, not imports - declarations
<heat> I mean modules
<zid> pulling your crate? I thought we decided against homicidal acts
<geist> and the root of the module, technically the only file 'compiled' by rust, but the rest are discovered
<Mutabah> `mod` defineds/loads a module, `use` makes a shorter name for something
<geist> it's *kinda* like if your main.c #included all the rest of the .c files
<geist> or your lib.c #includes the rest. though not exatly like that
<heat> how does that work well with incremental building?
<geist> i dont know, i get the impression that any incremental building happens kinda at the lib boundary and within a lib/module it's a big LTO
<geist> but these are things i would want to know deeply before trying to use in a low level thing
<Mutabah> Incremental compilation is available in rustc (used by cargo for debug builds) and works on function granularity
<Mutabah> (everything is parsed, then diffed against the cached state - only differences are recompiled)
<geist> but i guess the whole crate module/lib thing is mostly a crate construct and if you drove rustc directly you could do it differently, right?
<geist> ah, where does it store the parsed bits? some sort of global cache?
<geist> and/or per crate cache?
<Mutabah> Pre-crate
<Mutabah> *Per-crate
<geist> in some . dir somewhere?
<heat> so rustc is crate-aware?
<Mutabah> Not really... it has some basic search dirs for crates, but cargo usually explicitly tells `rustc` where a given crate is
<Mutabah> e.g. `--extern serde=path/to/serde-1.2.3.rlib`
<Mutabah> (You can pass `--verbose` to cargo to see the rustc command it runs
<geist> yah last i looked at it i was deep into that, trying to build more and more complicated things to see what it was up to under the hood
<heat> is .rlib some sort of twisted .a?
<geist> haven't looked but i assume it's something like that
<geist> an ar or a zip or something. it is a single file
<Mutabah> It's a `.a` with extra metadata in it
<heat> a zip would be LITERALLY UNUSABLE
<heat> I like my shitty .tar
<geist> yah no way would any language ever even remotely consider storing compiled objects in a zip file
<zid> What if we renamed the zip to hide it
<heat> well a .a is an old zip file
<geist> zid: oh that's crazy enough it just might work
<zid> we could use zip, but unless anybody tried to hack you, they'd never find out if we nmed it something like .crassly
<zid> You know what'd be funny? Using MPQ.
<zid> The blizzard format, it's a weird thing where you use the filename as a decryption key, we do that but per-symbol.
<zid> Is there a _start? Who knows, try decrypt it using _start as the key
dennis95 has joined #osdev
andreas303 has joined #osdev
vdamewood has joined #osdev
vinleod has joined #osdev
vdamewood is now known as Guest8862
Guest8862 has quit [Killed (zinc.libera.chat (Nickname regained by services))]
vinleod is now known as vdamewood
zid has quit [Remote host closed the connection]
zid has joined #osdev
<klange> soon
xenos1984 has quit [Quit: Leaving.]
<zid> did my advent a la code
<zid> good intro level
bradd has joined #osdev
bradd has quit [Ping timeout: 268 seconds]
<heat> zid, are you actually doing it in rust?
<klange> Same as last year, I am doing it in Kuroko and will use it to sus out missing standard library functionality or other issues.
<heat> im doing this in K&R C hard mode
<heat> I'll try a no-stdio-except-getchar today
<heat> gcc will puke at this but oh well, such sacrifices are needed for programming purity
bradd has joined #osdev
<AmyMalik> probably not gonna
<AmyMalik> but...
<AmyMalik> kinda tempted
<AmyMalik> to try C89 with some qmail-extract stuff
nikitalocalhost has joined #osdev
chartreus has joined #osdev
genpaku has quit [Remote host closed the connection]
<klange> I just figure, I have my own programming language, this is exactly the sort of thing to use it for.
justache- has joined #osdev
smeso has quit [Killed (NickServ (GHOST command used by smeso_))]
smeso_ has joined #osdev
smeso_ is now known as smeso
pieguy128_ has joined #osdev
genpaku has joined #osdev
Piraty_ has joined #osdev
<bslsk05> ​github.com: aoc2022/day1.c at main · heatd/aoc2022 · GitHub
<heat> i take code reviews
<heat> I tried my hardest to not write any sort of standardized C or *pukes in disgust* C99
nlocalhost has quit [*.net *.split]
mavhq has quit [*.net *.split]
chartreuse has quit [*.net *.split]
froggey has quit [*.net *.split]
kori has quit [*.net *.split]
AmyMalik has quit [*.net *.split]
maksy_ has quit [*.net *.split]
manawyrm has quit [*.net *.split]
pieguy128 has quit [*.net *.split]
justache has quit [*.net *.split]
piraty has quit [*.net *.split]
ptrc has quit [*.net *.split]
thinkpol has quit [*.net *.split]
XgF has quit [*.net *.split]
jbowen has quit [*.net *.split]
xenos1984 has joined #osdev
chartreuse has joined #osdev
mavhq has joined #osdev
invalidopcode has quit [Remote host closed the connection]
chartreus has quit [Read error: Connection reset by peer]
invalidopcode has joined #osdev
bgs has joined #osdev
heat has quit [Ping timeout: 260 seconds]
bgs has quit [Remote host closed the connection]
AmyMalik has joined #osdev
mykernel has quit [Read error: Connection reset by peer]
mykernel has joined #osdev
gorgonical has quit [Remote host closed the connection]
gog has joined #osdev
kori has joined #osdev
manawyrm has joined #osdev
ptrc has joined #osdev
maksy_ has joined #osdev
XgF has joined #osdev
jbowen has joined #osdev
thinkpol has joined #osdev
froggey has joined #osdev
jbowen has quit [Ping timeout: 263 seconds]
jbowen has joined #osdev
mykernel has quit [Ping timeout: 252 seconds]
mykernel has joined #osdev
scoobydoo has quit [Ping timeout: 252 seconds]
scoobydoo has joined #osdev
chartreuse has quit [Quit: Leaving]
k0valski18891 has joined #osdev
ptrc has quit [Remote host closed the connection]
GeDaMo has joined #osdev
ptrc has joined #osdev
gog has quit [Ping timeout: 248 seconds]
gog has joined #osdev
TkTech has quit [Ping timeout: 248 seconds]
Jari-- has quit [Remote host closed the connection]
nyah has joined #osdev
Burgundy has joined #osdev
scoobydoo has quit [Ping timeout: 252 seconds]
scoobydoo has joined #osdev
Vercas6 has quit [Remote host closed the connection]
gildasio1 has quit [Ping timeout: 255 seconds]
elastic_dog has quit [Ping timeout: 264 seconds]
elastic_dog has joined #osdev
mykernel has quit [Ping timeout: 260 seconds]
mykernel has joined #osdev
Vercas6 has joined #osdev
gildasio1 has joined #osdev
gildasio1 has quit [Ping timeout: 255 seconds]
Vercas62 has joined #osdev
Vercas6 has quit [Ping timeout: 255 seconds]
Vercas62 is now known as Vercas6
gildasio1 has joined #osdev
smach has joined #osdev
Vercas6 has quit [Remote host closed the connection]
gildasio1 has quit [Remote host closed the connection]
gildasio1 has joined #osdev
Vercas6 has joined #osdev
<sham1> What's wrong with C99
<moon-child> no memory model
gildasio1 has quit [Ping timeout: 255 seconds]
gildasio1 has joined #osdev
<AmyMalik> isn't there?
mykernel has quit [Read error: Connection reset by peer]
mykernel has joined #osdev
smach has quit []
<kaichiuchi> it is cold.
<sham1> T'is the season, unless one is in Australia or something
<froggey> c99 doesn't clearly define pointer provenance
bradd has quit [Ping timeout: 260 seconds]
gildasio1 has quit [Remote host closed the connection]
gildasio1 has joined #osdev
mahk has quit [Ping timeout: 264 seconds]
bauen1 has joined #osdev
<dminuoso> Everything is wrong with C99.
vdamewood has quit [Read error: Connection reset by peer]
vdamewood has joined #osdev
friedy has joined #osdev
<epony> are you sure it's not a bit too late to express your feedback prior to the standard approval?
rwxr-xr-x has joined #osdev
mykernel has quit [Read error: Connection reset by peer]
mykernel has joined #osdev
<dminuoso> Not at all. Why do you think Im trying to buy a police box as well as spare parts for a DMC-12?
<epony> cause you can't create system applications and can't generate police messages yourself
<epony> in short: lack of generation
<epony> (and not your system)
mykernel has quit [Ping timeout: 256 seconds]
<dminuoso> Ill be sure to send a TV set to your parents when I do travel back in time. Clearly you have been wronged.
smach has joined #osdev
griddle has joined #osdev
Vercas6 has quit [Quit: Ping timeout (120 seconds)]
mykernel has joined #osdev
rwxr-xr-x has quit [Remote host closed the connection]
Vercas6 has joined #osdev
xenos1984 has quit [Quit: Leaving.]
Vercas6 has quit [Remote host closed the connection]
gildasio1 has quit [Remote host closed the connection]
gildasio1 has joined #osdev
invalidopcode has quit [Remote host closed the connection]
invalidopcode has joined #osdev
Vercas6 has joined #osdev
Vercas6 has quit [Remote host closed the connection]
Vercas6 has joined #osdev
xenos1984 has joined #osdev
FreeFull has joined #osdev
vai has quit [Remote host closed the connection]
vai has joined #osdev
<vai> yo dudes
veles2001 has left #osdev [Leaving]
dude12312414 has joined #osdev
bauen1 has quit [Ping timeout: 260 seconds]
Vercas6 has quit [Remote host closed the connection]
Vercas6 has joined #osdev
heat has joined #osdev
<heat> my system lost the ability to suspend over some updates
<heat> something something year of the linux desktop
Vercas6 has quit [Remote host closed the connection]
Vercas6 has joined #osdev
mahk has joined #osdev
xenos1984 has quit [Ping timeout: 256 seconds]
xenos1984 has joined #osdev
Vercas6 has quit [Quit: Ping timeout (120 seconds)]
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
<kaichiuchi> hi
<GeDaMo> Hi kaichiuchi :)
heat has quit [Remote host closed the connection]
heat has joined #osdev
gog has quit [Read error: Connection reset by peer]
justache- is now known as justache
bradd has joined #osdev
gog has joined #osdev
xenos1984 has quit [Ping timeout: 256 seconds]
wootehfoot has joined #osdev
wootehfoot has quit [Read error: Connection reset by peer]
xenos1984 has joined #osdev
acidx has quit [Quit: leaving]
<gog> hi
acidx has joined #osdev
<GeDaMo> Hi gog :)
<gog> what's shakin
<GeDaMo> It's December
<gog> happy december
<GeDaMo> So far so good :P
<heat> movember is over
<heat> now we have mocember
<GeDaMo> Why is Christmas like Halloween? Because DEC 25 == OCT 31
<Ermine> Hi gog
<gog> hi Ermine :)
<heat> gog
<heat> gog
<heat> gog
<gog> heatheathet
<Ermine> may I pet you gog ?
<heat> bazinga
<gog> Ermine: yes
* Ermine pets gog
gorgonical has joined #osdev
<gorgonical> Tomorrow I might be getting an espresso machine. Bets on how much my productivity changes by?
<heat> i personally hate my coffee machine soo, 0?
<heat> maybe even negative
<gorgonical> Maybe
<heat> 1) the coffee always tastes like exotic shit while I'm trying to, you know, drink normal regular coffee 2) I don't like plain old coffee that much
<mjg> snort fentanyl
<heat> is that the polish way
<gorgonical> After the first part I was gonna say it sounds like you don't really like coffee
<mjg> heat: not yet
<mjg> it matches the spirit
<gorgonical> slavic memory loss elixir
<heat> in a scale of 0 to 10 how wasted did you get yesterday
<gorgonical> taken in small quantities over the day
<mjg> i was already wasted
<heat> where 0 is "hurr durr your mutex is technically pessimal" and 10 is "POLANDsZSZS WORSZSZD CUP SZSZSZS"
<mjg> i googled the results for lulz
<mjg> was surprised to find pl won a game
<gorgonical> kurwa increases
<bslsk05> ​'A Hundred Coffees' by abalfourtube (00:02:23)
<mjg> for several world cups the scheme was: lose the first game "ok", then play the "all or nothing game" and lose it
<mjg> then fnally play "for honor" and draw that
<mjg> or win 1:0-ish
<mjg> pl made it to 3rd place in the world cup some time in the 70s
<heat> isn't this the first time you've gone through to the knockouts since like the 1980s or something?
<mjg> and people think this means it is a superpower
<mjg> ye probably
<mrvn> https://www.youtube.com/watch?v=NMFQ3YvR3Eo Are people still doing this?
<bslsk05> ​'It’s time for some hard truth' by Linus Tech Tips (00:20:02)
<gorgonical> i mean croatia's pretty good too right?
<mjg> i don't really follow the game
<heat> yes croatia is pretty good
<heat> serbia too
<gorgonical> and they aren't a superpower
<mjg> portugal sucksorz
<heat> oh 100, fuck ronaldo
<gorgonical> all I know is that the U S A is doing way better than anyone expected
<mjg> what are they doing
<gorgonical> sorry, patriotism reflex kicked in there
<gorgonical> they have made it to the next stage by beating iran
<heat> i swear to fucking god if I hear another american talk about how "IF OUR ATHLETES WENT INTO SOCCER RATHER THAN BUSKETBALL OR BUHSEBALL OR REAL FOOTBALL WE WOULD WIN THIS SHIT"
<heat> I will fucking die
<mjg> rekt by argentina 2:0
<gorgonical> mjg: really? rip lol
<heat> no
<mjg> pl rekt
<gorgonical> oh
xenos1984 has quit [Ping timeout: 246 seconds]
<heat> americans seem to have no concept of skill or talent in their sports, it's weird
<gorgonical> I don't like soccer/football much but honestly handegg is such a boring sport
<gorgonical> christ
<mjg> i tried watching few mins of basketball
<heat> if you're a 7ft 15yr old you can pick up like any US sport and be a top tier athlete
<mjg> well i watched a video explaining why cheating is allowed in that sport
<gorgonical> basketball is the bad parts of hockey without any of the things that make it good
<mjg> pretty funny
<heat> if you're a 15yr old and try to pick up football you'll be horrible at it forever
<heat> you either start at 3/4 or you'll never be good enough
<heat> while most US sports are: are you tall, fast, can you jump high? welcome to the pro league
<gog> and for US football, are you willing to have CTE by age 35
<gog> and be an invalid around age 50
<gorgonical> this is why paradoxically rugby is actually safer
<heat> case in point being that most international basketball players are (real) football rejects
<gog> rugby is marginally safer for your brain but iirc it has a high incidence of neck injuries
<heat> and lots of american basketball superstars did both basketball and murican football
<gorgonical> the pads and helmets make football tackles much more violent. In rugby we were taught to tackle as soft as possible
<gorgonical> gog: this is true
<gog> ok the hill i will die on is that baseball MINUS steroids is actually a skillful game that demands incredible team organization
<gog> your batting order or who's doing relief pitching can really make or break a game
<gorgonical> same with hockey!
<gog> yes
<mjg> lol i meant baseball previously :p
<mjg> anyhow
<heat> actually, pretty funny story: they're starting to ban heading from football in the youth leagues because of possible brain damage
<gog> yeh
<mjg> show me a pro game and i 'll show you steroid users at the top
<gog> oh absolutely
<gorgonical> what roids does magnus use
<gorgonical> how did he get his head that large
<gog> the enforcement is lax and only on "suspicion" which usually means a player was uncareful and spoke openly about it
<heat> the other dude used hemorrhoids
<heat> *ba dum tss*
<gorgonical> love it
<gog> technically i'm a steroid user tho
<gorgonical> me too
<gorgonical> just prescribed for itchy skin though
<gog> even without glucocorticoids
<gog> estrogen is a hell of a drug :P
<heat> yeah estrogen and testosterone are both steroids
<heat> anything that can change your testie levels
wikan has joined #osdev
<gorgonical> I wonder what would happen if you gave someone high doses of all three main sex hormones
<gorgonical> Just like, amp it all up
<heat> which is why athletes go bald, and then a year or two after retiring they suddenly get their hair back. the hair thingies have testie
<gog> you'd have a greasy horny mess of a person
<gorgonical> oh so teenagers
<heat> so they can't take the treatment without setting off every PED test
<gorgonical> heat: really?
<gorgonical> that's very interesting
<heat> gorgonical, you'd have a a very sexy FUCKBOY
<heat> yes
<heat> or FUCKBOY/GIRL
<gorgonical> I say this because I know in the bodybuilding world you have to be very careful about cycles because your boddy rubberbands
<bslsk05> ​www.healthline.com: Hair Loss and Testosterone
<gorgonical> the hormones when you finish a cycle. so it seems like an interesting notion that you could just turn them all up. add hdh in too
<gorgonical> hgh*
<gorgonical> man I can't type today. Sorry
<gorgonical> Not sure how this is osdev related
<heat> it just is
<gog> everything is osdev related
<GeDaMo> Hacking the biological operating system :|
<gorgonical> I am closing in on finishing the writing of my forth. Then I get to go through the enormous hassle of debugging it
<gorgonical> I considered unit testing but abandoned it when I considered how to actually do that
<gog> i'm a biohacker
<gog> also nice i should try writing an impl of forth
<gorgonical> I wrote a really quick and dirty one in C a while ago. So to ante up this one is baremetal asm
<gog> neat
<gorgonical> Ironically it really simplifies IO because you have a raw serial device
<Ermine> gog: good luck!
<heat> in riscv asm to be clear
<GeDaMo> Interpreter or native code generation?
<gorgonical> yes
<heat> because gorgonical is nuts
<gog> nice
<gorgonical> GeDaMo: what do you mean
<GeDaMo> Is it threaded code or do you generate native code?
<gorgonical> Oh it's threaded code. ~1500 loc .S file and then you feed code to it
<gorgonical> I hadn't considered the option of making a forth compiler
<gorgonical> Actually this is pretty close to being that, also
xenos1984 has joined #osdev
<GeDaMo> Forth makes that pretty easy because you can just concatenate machine code sequences
<gog> yes
<gog> that's what i want to do
<gorgonical> right. I just realized that basically adding dictionary words means I can produce native code quite easily too
<gog> i think that's my weekend plan is to try to write forth
<gorgonical> heat: riscv asm is dope
<gorgonical> don't hate
<GeDaMo> I did one where it would automatically inline words which were shorter than a certain number of bytes
<gog> i'm gonna tell my boss and he's gonna call me a nerd
<heat> gorgonical, it's definitely pain
<gorgonical> Just a little verbose
wikan has quit [Quit: Leaving]
<heat> hola gog, tu eres una nerd, sí?
<GeDaMo> gog: write it in Forth :P
<gog> a self-hosting forth compiler
<gog> hm
<GeDaMo> Forth calls that a meta compiler
<gog> heat: sí yo soy
<gorgonical> the only awful hack I've had to do is for the words I define in the asm directly I have to manually construct the dictionary linked list
<GeDaMo> You have two word lists, one for the host, one for the target
* geist yawns
<gorgonical> Because the toolchain doesn't let you change .set values inside the file because of relaxations
<gog> that's not that bad, and how else are you gonna do it on bare metal
<gorgonical> gog: you cheat and tell gas to do it. .set last MYWORD and then later .set last NEWWORD
<gog> ah i see
<mrvn> gog: Other than the pitcher hitting you in the head with the ball baseball is also rather non-violent.
<gorgonical> rinse and repeat. on other archs each time you say .word last it'll put hte *current* value of last in. but risc-v sees the multiple declarations and says no
<gog> mrvn: yes
<mrvn> and pretty impossible to explain if you aren't showing it on a field
<gog> very true
<gog> the number of things that can happen in any given play is pretty large
<gorgonical> the rules are really confusing too
<mrvn> I guess sliding into a base can be a bit violent if the other player doesn't get out of the way
<gorgonical> I saw a video recently of a dude basically flytackling the catcher
<gorgonical> "he was blocking the base"
invalidopcode has quit [Remote host closed the connection]
<gog> that move is a grey area wrt the rules
invalidopcode has joined #osdev
<bslsk05> ​github.com: flag/README.md at main · stepleton/flag · GitHub
<heat> lld got the relaxingss
<bslsk05> ​maskray.me: RISC-V linker relaxation in lld | MaskRay
<geist> someone has an old INMOS transputer card in a 286 and writing code for it
<GeDaMo> Cool
<bslsk05> ​Note by Tom Stepleton: "At last, my #transputer project is ready to share! ␤ I've written a program in the #occam language that uses a network of seven transputers ('80s/'90s UK CPUs for parallel proce[…]" https://assets.oldbytes.space/assets.oldbytes.space/media_attachments/files/109/439/983/051/746/333/original/79edc6914d538aff.jpg [An IBM CGA monitor displays an arrangement of blue, magenta, and white dots that resembles a transgender pride fla
<GeDaMo> I remember getting some promotional material from Inmos when the Transputer was launched
<geist> neat! i had no idea there was an inmos ISA card version
<GeDaMo> Transputers are stack machines, they have an operand stack on chip
<heat> why does x86 lack linker relaxation on things like jmp imm32 -> jmp imm8?
<heat> I think this means that jmp imm8 is only viable in object-file-internal jmps right?
<geist> probably just not worth the trouble
<geist> relaxations require a lot of extran relocations in the objet file and whatnot so the linker knows how to move things around after the fact
<geist> i think with riscv it's fairly straightforward sinc eyou can one pass relax things (with all the extra rels) but i think with something like x86 you might have to multipass it, maybe.
<geist> but i wouldn't be surprised if some dos compilers or whatnot used to do relaxations
<geist> or maybe MSVC
<heat> sure, you need extra relocs, but the final binary will be smaller no? maybe even a considerable bit
<geist> sure, but the extra relocs aren't free. etc. probably just not worth it
<heat> assuming you could do this sort of stuff for a handful of insns
<geist> yeah that's the real key, what would you actually get. jmp 32 to jmp 8? that might be a win, but i seriously doubt the compiler would emit a jmp to an unresolved symbol that happens to be within +/-128
<heat> maybe even cheaper to run? I wonder if the smaller instructions are any faster
<geist> on modern x86 probably not
<heat> hmm, good point
<geist> but seems like on older machines, back in the 386 era or so it might have really mattered
<geist> and smaller programs might have actually triggered it more
<geist> hence thinking maybe some dos compilers did
<geist> but i dunno, honestly just making it up
<heat> that's the spirit
<heat> https://github.com/riscv-non-isa/riscv-elf-psabi-doc/issues/298 maskray thinks riscv's gp relaxation is not a great idea
<bslsk05> ​github.com: Unallocatable global pointer (GP) · Issue #298 · riscv-non-isa/riscv-elf-psabi-doc · GitHub
<geist> personally i dont think it's really worth it yeah
<geist> there's only 4k of reach off of it, so it can only help with that much sdata/sbss anyway
gorgonical has quit [Ping timeout: 256 seconds]
fatal1ty has joined #osdev
<fatal1ty> i get it ... it's not the early 2000s, past are the times when you could actually find a hacker for a job
<fatal1ty> security is so critical these days, that the hackers who can bypass it don't work for single people anymore
<fatal1ty> it's all the big money
dude12312414 has joined #osdev
<gog> i'm willing to believe that in modern cpus when it decodes a jump or a branch what happens on the back end is the same no matter how far the displacement
<fatal1ty> gog: it's not a business for belivers
<fatal1ty> if you wanna believe go to church
<heat> lmao
<heat> how about that cock party eh?
<fatal1ty> gog: you are either know what you doing or not
<fatal1ty> don't believe
<fatal1ty> after you sensei
<heat> gog, yes, but maybe you can decode more instructions if the jumps are smaller
<gog> tru tru
<gog> idk i cba to do research about it rn
<fatal1ty> how can i refuse go to a party with a G like heat
<fatal1ty> tru ? no shit
<fatal1ty> gog: it seems like you are confirming what heat says
<fatal1ty> i don't like it girl
<bslsk05> ​'pcsubdbf283a1' by [idk] (--:--:--)
<geist> fatal1ty: what the hell are you goig on about?
<fatal1ty> geist: im getting tired of this
<geist> you and me both
<fatal1ty> every once in a while some girl give the "thumbs up" of one of my boys here
<geist> huh?
<fatal1ty> s/of/to
<gog> neat infinity box table
<fatal1ty> geist: she just said "tru" to heat
<fatal1ty> 10 seconds ago she was a believer
<geist> ?
<fatal1ty> im fine ..
<geist> oh, duh. never mind.
<geist> my brain wasn't working there for a minute. i forgot
<gog> as far as i can tell, it doesn't make a difference in execution speed
<gog> maybe i'll test this sometime
<gog> but tonight i'm le tired
<fatal1ty> you didn't test ? so how can you tell ?
puck has quit [Excess Flood]
<fatal1ty> or you believe that it doesn't make a difference ?
puck has joined #osdev
<fatal1ty> yeah don't be late to school tomorrow
<fatal1ty> geist: sorry, i don't like the girls who talk like they are in charge
<geist> oh?
<j`ey> o_O
<geist> well frankly you should leave that shit somewhere else, or better yet stuff it up your ass
fatal1ty was kicked from #osdev by geist [GTFO]
<gog> lmao
<gog> i don't even have him ignored i just pretend like it
<geist> same. i *would* ignore but i feel i have a duty to see the raw stuff so i can act on it
<gog> yeh
<geist> anyway i thought he was banned a long time ago, but i guess he changed his nick or something
<gog> if that's siberianascii, then he had some fixation on me for awhile for some reason
<gog> idk
<kazinsal> I think the only person on my ignore list is that one who pops in and dumps random wikipedia links then blathers on about them incorrectly for fifteen minutes
gareppa has joined #osdev
<kazinsal> I only know when they show up because bslsk will spew out a wikipedia link description completely unprompted
<geist> haha yeah
<gog> lol
<gog> yes
<geist> nah this one is just the guy that has serious 'i wanna be a hard core coder' problem, which is fine, but then he just randomly starts spewing racist or sexist shit
<geist> and then pretends (or actually doesn't know) that it's bad
<geist> he always start a long chat we me about 'why did you kick me? i didn
<geist> t say anything etc etc
<kazinsal> lol
<kazinsal> we do seem to occasionally get some interesting ones
<geist> like dude, if you seriously dont understand why that's an even bigger problem
<gog> i'm not a hardcore coder
<gog> and that's fine
<geist> yah i kept telling him o the first note that no one gives a shit if he is or isn't a hard core coder. we're not all sitting around here with some social status basde on that
<geist> and we dont care if he went to school or not or whatever
<kazinsal> most people are firmcore at best
<gog> i'm definitely softcore
<geist> but since he keeps circling back to that i guess he has some serious issues with that
wikan has joined #osdev
<gog> why don't we have a social hierarchy based around how hardcore of a coder one is
<gog> there's no way that could go wrong
<kazinsal> the hardest core coder you can possibly be is a chill coder
<gog> tru tru
<geist> and honestly even if we do have a defacto heirarchy i'd rather it not exist
<gog> found the anarchist
bradd has quit [Ping timeout: 252 seconds]
<kazinsal> osdev social hierarchy by how many vintage computers are within arm's length
* geist gives a nod to kazinsal, the other with a VAX
<gog> i have no vintage computers
<gog> i still want to get one but idk what
* kazinsal looks at the half-disassembled C64 on his coffee table
* acidx has a PiDP11/70 on her desk
<gog> hm a pidp isn't retro but it does act line one
<acidx> and a Motorola MDT9100 on the floor
<gog> that might be acceptable
<geist> yay pidp11!
<GeDaMo> I have a ZX81 about 2m away :P
<geist> they're great to have just off your monitor, you can stare at it and think of computers
<kazinsal> I gotta button this thing back up and either buy or make a composite cable for it
<acidx> I just like blinkenlights, and I don't observe christmas to have a tree in my house :)
<gog> what if i get a 5170
<geist> purchase approved.
<gog> i have a love/hate relationship with the 286 and honestly i'd liek to code on a real one
wikan has quit [Quit: Leaving]
<geist> there was one on sale here recently, but just a little too much for me
<gog> honestly if i could even find one here it'd probably be a little overpriced
<acidx> I always wanted to mess around with the 286 protected mode
<gog> yes
<kazinsal> yeah, it's a pain to get vintage computers complete with monitor and keyboard here as well. super expensive because magical canadia
<gog> that's what i was thinking about
<geist> yah i'm fairly happy with the 386 i got a ew years ago for that sort of thing
<kazinsal> I've seen like, one XT system here and it would cost twice as much to buy it as it would to fill up the BRZ's tank, drive to Seattle, buy one locally, and drive it home
<gog> i guess i could just buy a cheap 2000's pc and use it in protected mode with 1 byte granulary segments
<acidx> I used to have a lot of old computers back when I lived with my folks but, well, it's in another continent now. things used to be cheap as I would find them in junkyards and whatnot, but recently they're becoming as expensive as new computers
<gog> hell i could do that on my existing pc
<gog> fuck it i'm not buying a retro computer
<gog> wait no does this even have CSM
<kazinsal> honestly I ought to build a new desktop first. GPU's almost brand new but the 8700K is getting long in the tooth at high refresh rates
<kazinsal> I'm getting like, 50% GPU utilization in darktide because my CPU is crying out in pain
invalidopcode has quit [Remote host closed the connection]
invalidopcode has joined #osdev
heat has quit [Quit: Leaving]
bauen1 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!]
<Ermine> gog: may I pet you some more?
wootehfoot has joined #osdev
gog` has joined #osdev
bradd has joined #osdev
dude12312414 has quit [Remote host closed the connection]
dude12312414 has joined #osdev
DjanSeriy has left #osdev [zzZ]
_nater_ has joined #osdev
<mjg> * This version has been optimized for speed, throwing away some
<mjg> * This is the 10-Apr-92 bypass routine.
<mjg> * safety checks. It should still always work, but it's not as
<mjg> * robust to programmer errors.
<mjg> i think whoever wrote it was on speed instead
<bslsk05> ​cgit.freebsd.org: null_vnops.c « nullfs « fs « sys - src - FreeBSD source tree
gareppa has quit [Quit: Leaving]
<sbalmos> that has to be the first time I've ever seen a triple pointer
<mjg> this code is a relic of an insane era
<zid> I am an 8 star programmer
<zid> I just pretend not to be by using struct
<zid> I should use * and . more instead of ->, so you really get to see the stars
scaleww has joined #osdev
<FireFly> it's like reviews--the more stars, the better
* FireFly nods
<FireFly> zid: -> only hides one layer though tbf
<j`ey> ---->
<FireFly> ... is ---> legal syntactically (in say C++ with its operator overloading), hm
<j`ey> while (x --> 0) { ..
<j`ey> that is allowed!
<FireFly> yeah
<FireFly> the classic 'goes to' operator~
<mjg> :]
<FireFly> it'd be kinda funny if you can make a--->b legal (by overriding postdecrement)
<kof123> while ( 8< x-- >8 ) /* the double scissors operator */ i'm too lazy to make it serve a purpose, but i see possibilities with scissors
nyah has quit [Quit: leaving]
heat has joined #osdev
<kof123> scissors evolved due to lack of seeing a way for a spaceship
<heat> vppp sounds really good
<heat> great naming, I can't get this close even if I try
<mjg> v pointer pointer pointer
<mjg> vnode*
<mjg> this one makes sense, if you find yourself in this spot
<heat> this vnode pointer pointer, old vnode pointers, vnode pointers pointers, vnode pointer pointer pointer, long vnode pointer, descriptor pointer, error, i, reles
<heat> sounds great
<heat> what's with the C99 here man
<heat> wtf
<heat> struct vnodeop_desc *descp = ap->a_desc;
<heat> we doing that? we mixing declarations and code?
<zid> Initializations aren't code
<zid> I'll allow it as long as ap is an argument
<kof123> ^^^
<mjg> this is technically prohibited
<mjg> by the convention
<zid> Will The Convention send their assassins?
<mjg> assasin union is on strike
<heat> thank god your opinion doesn't matter
<heat> the sacrosanct K&R C compiler needs to have declarations first and then code so it can calculate the stack frame size and just fprintf it out
<zid> c89's perfectly happy as long as no statements appear first
<zid> regardless of how complex the initialization expressions are
<heat> but you need to appeal to the lowest denominator, the shitty C compilers
<zid> I am, gcc
<heat> is your program even valid C if it doesn't compile on a 1980s UNIX toaster
<mjg> i'm pretty sure the above does compile on that sucker
<mjg> df8bae1de4b67 (Rodney W. Grimes 1994-05-24 10:09:53 +0000 230) struct vnodeop_desc *descp = ap->a_desc;
<mjg> there you go motherfucker
<mjg> the line dates back to the import
<mjg> > BSD 4.4 Lite Kernel Sources
<heat> all I know is that the above is illegal in edk2, and edk2 is supposed to compile everywhere due to $REASONS
<zid> heat refuses to believe initialization is legal
<heat> 100%
<zid> because edk2 working around a bug in some vendor compiler from 2020
<heat> nope, this is old old
<heat> the coding conventions were defined in, what, 98/99? somewhere around that
_nater_ has left #osdev [#osdev]
<heat> if you look at old UNIX you'll notice it's always declarations;\n init;
<graphitemaster> Today I came across a T*****
<heat> ouptr 0;
<bslsk05> ​minnie.tuhs.org <no title>
<heat> look at that syntax
<graphitemaster> A five star pointer
<heat> I hope this is a misprint
<zid> I think more than ** means you fucked up not making some structs
<kaichiuchi> thought some censor filter was on
<zid> it should be global->namespaces[NAMESPACE_FRED]->identifiers[27]->name[0]
<zid> not *********************s;
<heat> you should look at edk2 more
<graphitemaster> Why not (*(*(*(*x).y).z).w).q
<heat> it's high quality ************s code
<zid> and doesn't know about initialization
<zid> sounds fun
<graphitemaster> one does not simply initialize a variable
<heat> dude im telling you, it wasn't universal in the 90s
<graphitemaster> look at C++ for proof
<FireFly> wild old C code reminds me of the bourne shell macros
<zid> universality is a bit of an ask though
<zid> I've seen "C compilers" that didn't understand addition
<zid> Mine, for example.
<graphitemaster> addition is just repeated incrementation
scaleww has quit [Quit: Leaving]
<zid> how do you say O(n) where n is the size of the *value* of the input? :P
<zid> "That's so dumb we don't have words for it"
<graphitemaster> #define O(n) n
<graphitemaster> for (i = 0; i < O(n); i++)
<graphitemaster> See, that loop is clearly O(n)
<graphitemaster> Reads like prose
<zid> It certainly is idiomatically a range of 0 to O(n)
<FireFly> zid: define size of the value?
<zid> read up
<zid> we we saying addition implemented via increment
<zid> hence the size of the *value* of the input, rather than the size of the input, becomes linear
<FireFly> ..that sounds like the value, and not the size of it?
<zid> values have sizes
<FireFly> "size of the *value* of the input" to me would be like, number of bits I guess
<zid> big values, small values
<FireFly> shrug
<zid> 7 is a small value, 283928392 is a big value
<FireFly> exactly
<zid> both are the same physical size
<kaichiuchi> zid: hey do you want to see my CPU monstrocity
<FireFly> anyway, that'd just be O(n), where n is the input?
<FireFly> perfectly fine to put it like that :p
<zid> kaichiuchi: as long as it isn't in a format I have to mess with sure
<kaichiuchi> it's... a cpp file...
<bslsk05> ​github.com: gb/cpu.cpp at main · kaichiuchi/gb · GitHub
<zid> Right but if you say strlen is O(n) where n is the *length* of the input, add(n) should be O(value(n)) or something
<heat> https://minnie.tuhs.org/cgi-bin/utree.pl?file=1BSD/ex-1.1/ex_io.c 1977, no init possible when declaring
<zid> oh yea I don't fuck with cpp files
<bslsk05> ​minnie.tuhs.org <no title>
<heat> https://minnie.tuhs.org/cgi-bin/utree.pl?file=2.9BSD/usr/src/lib/c/stdio/doscan.c same for 1983
<bslsk05> ​minnie.tuhs.org <no title>
<heat> seems to be possible in 4.3BSD, dated 1990
<FireFly> zid: e.g. for https://en.wikipedia.org/wiki/Sch%C3%B6nhage%E2%80%93Strassen_algorithm multiplying two n-digit numbers takes time O(n log n log log n), hence the comment about "sizes of numbers" in bits (or digits)
<bslsk05> ​en.wikipedia.org: Schönhage–Strassen algorithm - Wikipedia
<zid> yes, that's still the length of the input
rwxr-xr-x has joined #osdev
<zid> not the *value* of the input
<FireFly> but I think you don't need any particular notation for it, anyway, shrug
<zid> There isn't one because it's dumb to need one
<FireFly> yes, you'd just define what the variables you're using in the O-notation refer to..
<zid> n is just implicitly length, for good reason
<zid> I was saying my alg is so dumb that O(n) needs updating to account for the sheer complexity of it, more or less
<rwxr-xr-x> How can I debug my assembly kernel while it's running? I can't hook gdb into it right? gdb is for c only(?)
<zid> yes you can?
<zid> stepi not step
<zid> etc
<zid> read the gdb manual for 10 mins then come back
<rwxr-xr-x> alright, that's all I needed, googling it gave no concrete answers
<rwxr-xr-x> maybe I don't know how to google lol
<heat> gdb debugs whatever
<zid> works for me
<heat> it can debug asm, it can debug C, it can debug whatever can output dwarf
<heat> you can attach gdb to a program written in my favourite language, RSUTUSRUSTURUSTURustURURUTUSURURSURUST
<rwxr-xr-x> rust has infected irc to huh?
<rwxr-xr-x> damn
<rwxr-xr-x> no where is safe
<heat> irc, what's that?
<rwxr-xr-x> no clue
<zid> my sausage rolls have rigor mortis :(
<rwxr-xr-x> what client do y'all use outof curiosity
<heat> i'm typing this from my program using a matrix communications cargo module to matrix to a matrix bridge to this "I" "R" "C" thing
<rwxr-xr-x> what???
<zid> If you cook a sausage roll they start off hot and soft, then they go cold and hard, then they go cold and soft
<zid> I'm in the akward middle phase
<rwxr-xr-x> damn
<zid> They're like bricks atm, need to wait a while before they're nice and soft again so I can slather them in this lovely scotch bonnet sauce and gobble them up
<rwxr-xr-x> seems unnecesarily difficult and annoying heat, in other words, it sounds like the rust programming language
<kazinsal> irccloud. I gave up on janitoring IRC clients and bouncers and all that crap and just give some nice folks a few bucks a month to handle that garbage for me
<zid> I just use mirc and leave my PC on forever
<rwxr-xr-x> nice
<zid> not even a paid-for copy of mirc lol
<rwxr-xr-x> lol
<zid> it's a race to see who I pay for first, mirc or winrar
<zid> so far neither competitor is ahead
<rwxr-xr-x> haha
<rwxr-xr-x> i gave up on winrar, the op ups are to annoying
<heat> weird fact: windows explorer's zip plugin is very slow
<zid> doesn't surprise me
<heat> it dies extracting 10GB+ zips
<zid> winrar is pretty slow also to be fair
<rwxr-xr-x> yeah
<heat> i had to purposefully install winrar for it
<zid> but I bet it's 10x the speed
<heat> and it was blazingly fast
<bslsk05> ​df11faces.com: DF11 Faces: Best Football Manager facepack 2022/2023
<heat> try it
<heat> you'll see that poor windows explorer plugin written in the 90s choke to death over LE FOOTBALLER
<kazinsal> I just use 7-zip
<rwxr-xr-x> same
<rwxr-xr-x> 7-zip is nice
<rwxr-xr-x> it does the job fast, and for free
<heat> I use tar + zst
<heat> people always ask "what the fuck is zst" just so I can rustsplain them what zstd is and how it's so much superior to everything else
<heat> a bit like rust really
<heat> zx? really? how primitive and slow...
<rwxr-xr-x> what the fuck is zst
<heat> xz*
<rwxr-xr-x> Oh i've heard of it before
<rwxr-xr-x> bro went to the stone age the second i asked
xenos1984 has quit [Read error: Connection reset by peer]
<zid> I would like a decompressernator that could use both of my memory holes
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
gog` has quit [Read error: Connection reset by peer]
<heat> if I don't use zstd I much prefer using the standard compress(1) and decompress(1) utilities from your local UNIX installation
<rwxr-xr-x> fellas you lied to me
<rwxr-xr-x> its been 10 minutes
<rwxr-xr-x> no answers have been given by the manual
<rwxr-xr-x> i'm gonna fucking cry
<zid> quit then
<heat> no lying
<rwxr-xr-x> 'nuff said
<heat> what's the question
<rwxr-xr-x> nah im just kidding
epony has quit [Quit: QUIT]
<heat> ok
<kazinsal> whew. it's finally cold enough that I need to turn the baseboard heater on in my bedroom. happy winter
<kaichiuchi> there's a candle right in front of me in desperate hopes that I can get warm
<gog> hi
<kaichiuchi> hi
<zid> candles are famous for their incredible heat output afterall
<zid> compile some C++, that'll keep you warm
<heat> gog, https://www.youtube.com/watch?v=Qf0kC-MJZrU you're penny and im sheldon
<gog> zid uses his xeon as a space heater
<bslsk05> ​'The Bing Bong Theory' by Podel (00:00:27)
<gog> bayzinga
<zid> That is infact, what I do, yes
<zid> I don't have any C++ though so I use prime95
<heat> see, big bong theory is indeed zoomer humor
<zid> god I hate big bong theory
<gog> bag bing theory
<zid> autism blackface for morons
<zid> everybody involved it in should be ashamed of themselves
<heat> what, the vid is fine
<gog> it's a meme one
<heat> gog, if normal people smoke weed in bongs do you smoke weed in gongs
<gog> yes
<heat> thanks, all I needed to know