Search logs:

channel logs for 2004 - 2010 are archived at http://tunes.org/~nef/logs/old/ ·· can't be searched

#osdev2 = #osdev @ Libera from 23may2021 to present

#osdev @ OPN/FreeNode from 3apr2001 to 23may2021

all other channels are on OPN/FreeNode from 2004 to present


http://bespin.org/~qz/search/?view=1&c=osdev2&y=21&m=11&d=13

Saturday, 13 November 2021

00:00:00 <zid> I hope you counted your swapgses right!
00:00:00 <geist> exactly
00:00:00 <zid> Roll on FRED
00:00:00 <geist> goddamn swapgs. if AMD just designed it as `setgs #0` `setgs #1` (if they wanted to continue that route) it would be perfect
00:01:00 <geist> it's the modality of it that sucks
00:01:00 <geist> or just having which one is active directly tied to the ring, which iirc that's what FRED does now?
00:02:00 <geist> but i can see why they did swapgs. i think that's basically the simplest possible microcode you can come up with
00:03:00 <geist> since it simply swaps two regsters, doesnt have to keep any sort of scoreboard which one is active and doesn't involve banking things due to ring, which iirc there isn't anything else in x86 that does that
00:30:00 <heat> just found out there are opengl man pages
00:30:00 <heat> mind = blown
00:31:00 <zid> yea the khronos (kronos?) docs are nice
00:33:00 <gog> q'plah!
00:33:00 <zid> stop trying to summon things
00:33:00 <klange> It's spelled Qapla'
00:34:00 <gog> ok nerd
00:52:00 <geist> oh this is a fun file i forgot i had put together: https://newos.org/txt/task%20switch%20benchmarks.txt
00:52:00 <geist> basically a quick benchmark using TSS task switching vs software switching
00:53:00 <geist> on an original 386 and a few more modern pieces of hardware
00:54:00 <gog> pretty funny how bad the hardware task switching was even in the time it was meant to be used lol
00:55:00 <heat> geist, broken link?
00:56:00 <gog> worked for me
00:56:00 <heat> i'm getting a not found
00:57:00 <heat> (firefox)
00:57:00 <gog> worked for me on ff
00:57:00 <gog> :thinking:
00:57:00 <heat> ah it doesn't play nice with the %20
00:57:00 <gog> ah ok
00:57:00 <zid> fewer pushes, smh
00:57:00 <heat> for some reason, since when I copy the URL and paste it I get the %20 anyway
00:59:00 <heat> what if skylake uses really cheap emulation?
01:00:00 <zid> now divide through the clockrate
01:01:00 <zid> (to make the result even worse)
01:02:00 <moon-child> anyone happen to know how fast sqrt is on gpu, vs mul? Or have links to cycle timings etc? Cuz I think I can do this algorithm as either 3 muls + 1 sqrt, or 5 muls
01:03:00 <moon-child> on cpu obviously go for the mul. But I feel like on gpu they put a lot of effort into making sqrt fast?
01:03:00 <zid> I'd imagine the 5 muls is faster
01:03:00 <heat> try it
01:03:00 <zid> gpus use lots of little cores, I don't think they have the die area to make a stupidly fast sqrt with lots of luts etc
01:04:00 <zid> You'll just have to get an 8k monitor and benchmark it :P
01:04:00 <moon-child> oh wait no I can do it in 4 muls
01:05:00 <moon-child> i think
01:05:00 <heat> yeah 4 muls is faster for sure
01:11:00 <geist> gog: yah it being slow even on 386 was surprising to me
01:11:00 <geist> i think if you do the math it's like 300 something cycles, which is basically what the manual said
01:11:00 <geist> to be fair i think the main reason it was unilaterally slow is the TSS switch always reloads all of the segment registers, even if you dont need to
01:12:00 <geist> so ring0 -> ring0 transitions via it is more work than you need to
01:12:00 <geist> the big advantage of it is you can do a one stop ring3 -> ring3, and in that case it may be strictly speaking faster than r3 -> r0 -> sw csw -> r0 -> r3
01:13:00 <geist> the bulldozer was interesting though, since it ran 40x slower than equivalent sw csw
02:22:00 <geist> man, trying to have nice conversations on the osdev discord, but there's this one guy that keeps trying to argue with me about everything
02:22:00 <geist> sigh. there's always that one
02:22:00 <geist> he was also the one that immediately crapped all over zircon and microkernels, so started off on shaky ground in my book
02:23:00 <geist> like, having opinions is fine, but it's not conducive to having good relationships when the first thing out of your mouth when you meet someone is how much you hate what they do and what they work on and you hope it fails
02:25:00 <heat> is it linus?
02:25:00 <heat> :v
02:38:00 <geist> heh funny. linus gave some tech talk at work a few years ago and of course someone immediately asked him about fuchsia
02:38:00 <geist> he gave a fairly standard noncommittal answer of course. he's learned to be a diplomat over the years
02:40:00 <wleslie> I'm a bit impressed. of course if work /is/ google, diplomacy to your host is not /so/ surprising
02:42:00 <geist> heh yeah
02:45:00 <heat> I just wanted to play csgo in linux but now I'm debugging csgo
02:45:00 <heat> woohoo
02:45:00 <heat> linux gaming is so easy
02:46:00 <wleslie> I know that feeling, like going to play a source-engine game and instead having to dig through ldd to find out which included libraries to delete
02:46:00 <heat> i'm running into a glx issue with nvidia and PRIME offloading
02:47:00 <wleslie> ach, that one
02:47:00 <heat> apitrace isn't helping so I'm trying out nsight
02:49:00 <wleslie> offtopic opinions are even more offensive when they are compounded by the attitude "I see you're building something there, have you considered justifying your design decisions to me instead?"
02:51:00 <wleslie> I must admit I've probably had that attitude at some point
02:52:00 <geist> wleslie: oh yeah totally
02:52:00 <geist> not you having the opinions, but the offensive part
02:52:00 <zid> *spies on geist*
02:56:00 <zid> I have to wait 600 seconds before I can troll zircon too? :(
02:58:00 <geist> haha
02:58:00 <geist> i mean you gotta at least try to get to first base before you start trolling
03:00:00 <zid> I should really clean my drop into usermode code up
03:00:00 <heat> where's the trolling?
03:00:00 <zid> It's.. still hardcoded into main in inline assembly
03:00:00 <heat> i'm intrigued
03:02:00 <geist> oh no nothing
03:02:00 <geist> was a while back
03:02:00 <geist> days ago
03:03:00 <geist> zid: interestingly, actually dropping to user space is one of those few things you can fairly legitimately do in inline asm. normally you should never branch/iret/etc inside an inline asm block
03:03:00 <geist> but.... if you never return, then it really doesn't matter if you completely trash the current stack
03:04:00 <geist> https://github.com/littlekernel/lk/blob/master/arch/riscv/arch.c#L227 for example
03:04:00 <bslsk05> ​github.com: lk/arch.c at master · littlekernel/lk · GitHub
03:04:00 <geist> like, yolo
03:07:00 <zid> mine's good because it's in main
03:07:00 <heat> booooooriiiiiiiing they're talking about nerd stuff :(
03:08:00 <zid> NERRRRDS
03:08:00 <zid> https://github.com/zid/boros/blob/master/main.c#L27 One day I will have more than one user process and will have to put this into a file somewhere
03:08:00 <bslsk05> ​github.com: boros/main.c at master · zid/boros · GitHub
03:09:00 <wleslie> Muuuuuum the other gamers are trolling userspace from inline assembly again
03:09:00 <heat> i drop user threads directly into user space, no trampoline outside of the standard pops
03:10:00 <zid> if you're *really* lucky I will match some #defines between the code that builds the GDT and this code
03:10:00 <heat> i do have one for execve returns though
03:10:00 <zid> so that I can do USER_CS instead of 0x23
03:12:00 <heat> the d in osdev stands for BORING
03:19:00 <geist> omg zid is participating on discord
03:19:00 <geist> what is this world coming to
03:20:00 <zid> I am on lots of discords
03:20:00 <zid> just we never bothered to mention it here before now really
03:20:00 <geist> oh no am i participating in the demise of the thing i hold dear?
03:20:00 <zid> so for all I knew it had 4 people in it all posting onlyfans links to each other on a loop
03:21:00 <geist> unrelated: i recently bought a bunch of Zigbee multicolored lightbulbs for my computer area
03:21:00 <geist> and it's neat as hell
03:21:00 <zid> for your onlyfans shoots?
03:21:00 <geist> welllll
03:21:00 <geist> no, but mostly for late night hackery. Indigo color is good for hacking
03:21:00 <zid> I had a red light bulb in my room once
03:21:00 <zid> red is really good, it isn't bright but you can still see shit
03:22:00 <geist> yah i have a few red flashlights. great for walking around at night and not ruining your night vision
03:22:00 <geist> but enough to keep from stepping in a hole
03:29:00 <brynet> there's a discord?
03:30:00 <zid> What's the nested flag
03:30:00 <zid> I just checked my flags
03:32:00 <zid> well, it works, but I have no idea how to find it in the manual without ctrl-f'ing for nested 8000 times
03:33:00 <zid> The other bits are iopl, but I don't remember which way up it is :D Leaving notes for yourself is overrated
03:36:00 <geist> yeah i always forget how the nested flag works
03:36:00 <geist> it's something to do with TSS, but i think it's so atrophied you just set it (or clear it) and then forget it
03:36:00 <zid> If the NT flag (EFLAGS register) is cleared, the IRET instruction performs a far return from the interrupt procedure, without a task switch. The code segment being returned to must be equally or less privileged than the interrupt handler routine (as indicated by the RPL field of the code segment selector popped from the stack).
03:37:00 <zid> If the NT flag is set, the IRET instruction performs a task switch (return) from a nested task (a task called with a CALL instruction, an interrupt, or an exception) back to the calling or interrupted task. The updated state of the task executing the IRET instruction is saved in its TSS. If the task is re-entered later, the code that follows the IRET instruction is executed.
03:37:00 <zid> Looks like it's whether it does a tss writeback or not, vaguely?
03:37:00 <zid> so technically I don't think I want it set
03:38:00 <heat> i dont even have that one in my defines
03:38:00 <zid> remind me when I move this code to a real file to unset nested and the iopl bits I guess
04:02:00 <heat> okayyy so I have two identical traces but one crashes and the other one doesnt
04:03:00 <zid> sounds like your trace is lacking something
04:04:00 <heat> i'm lacking alcohol
04:16:00 * kingoffrance missed the meta "the x86 kabbalah"
04:16:00 <kingoffrance> you know that implies theres a damned version underground ?
04:17:00 <kingoffrance> if you didnt like x86 before, its gets better
04:18:00 <heat> it's highly likely there's an internal intel doc like that
04:18:00 <heat> with hidden instructions!
04:18:00 <zid> It's in the materials section under 'industrial solvent'
04:18:00 <kingoffrance> well, it'll help us summon doug16k someday
04:22:00 <geist> hrm, damn you qemu. was wiring up pcie for qemu-virt arm. turns out it always puts the ECAM > 4GB
04:23:00 <geist> that's fine, except on arm32. forces you to use LPAE (which i have no intention of doing)
04:29:00 <heat> welp I give up
04:29:00 <zid> good idea
04:29:00 <heat> shit game anyway
04:29:00 <heat> i only have *checks notes* 2232 hours in this crappy game
07:00:00 <zid> lel booted from that osdev discord
07:01:00 <zid> I found the small child who runs it
07:02:00 <zid> geist: lmk what they say about me that's the best bit usually
08:07:00 <geist> zid: oh? how so?
08:08:00 <geist> zid: oh yeah i read it now. that's the guy that i was butting heads with already
08:08:00 <geist> i give some advice and now he pulls rank, makes some long post about a thing i recommended and the pins it
08:08:00 <geist> so... ugh.
08:08:00 <geist> and rips on people from the 90s and klange right there
08:09:00 <geist> like dude man, learn how to disagree. i think we were butting in on his turf
08:15:00 <zid> He's just some little kid despot, you see it all the time
08:15:00 <zid> it's "his" discord
08:15:00 <zid> Rather than a community discord that he manages
08:16:00 <zid> There's a big difference in mindset there
08:17:00 <geist> yah arging with him now and he's just trying to shoot down everything i say
08:17:00 <geist> i'm just wrong wrong wrong
08:17:00 <geist> and if i say something he's like PROVE IT
08:17:00 <geist> cripes. so annoying
08:17:00 <zid> copy paste pls :D
08:19:00 <geist> just blocked him. much nicer
08:20:00 <zid> So did I, then the server disappeared from the list as if magically in response
08:20:00 <geist> i'll just sneak off after a bit. it's not worth my time giving him the satisfaction of even seeing me leave
08:21:00 <geist> like i like to help people but i really have no interest in pissing matches with other people
08:21:00 <geist> and then him pulling rank on me is really a dick move
08:21:00 <zid> He did it to a total of two people, with his total of two interactions, in the space of an hour
08:22:00 <geist> yeah and that exact guy was the one that within 30 seconds of seeing me went on some rant about how mcirokernels are lame and he hopes i fail, etc
08:22:00 <zid> I'd be surprised if that place isn't pretty polarized between people hanging off his dick and people avoiding him
08:22:00 <geist> yeah
08:22:00 <geist> anyway, didn't take too long to figure out how that particular society works, just a couple days and it's pretty clear
08:23:00 <zid> You're slow, took me 15 minutes
08:23:00 <geist> heh i have a lot more patience
08:24:00 <geist> and he may have just been an asshole, but him pulling rank on me seals it
08:24:00 <zid> I'd rather have the inevitable confrontation up front
08:24:00 <zid> then I'm not invested
08:24:00 <geist> sure, half the regulars may be admins but you do *not* use it for petty shit
08:24:00 <geist> but anyway i'll mute it for now and slip out in a few days so he doesn't get the satisfaction
08:25:00 <zid> I mute every server immediately
08:25:00 <zid> then mute all the channels except the ones that look good, then 'hide muted channels'
08:25:00 <zid> idk how else you can possibly use discord
08:26:00 <geist> oh yeah, never noticed the 'hide muted channel' thing
08:26:00 <geist> i always thought it just took it out of the notification queue
08:26:00 <zid> each server is more like an entire irc network, that's set to ping you if anybody speaks on any channel
08:27:00 <geist> yah i usually mute the server immediately, but didn't notice you can straight hide muted channels, vs them just appearing grey
08:27:00 <geist> and no tick box, etc
08:28:00 <clever> the thing that anoys me the most, is that the default notification mode, is set by the server
08:28:00 <clever> and it defaults to notifying you for every single msg
08:28:00 <clever> so for any server that hasnt changed it, you have to turn it off the instant you join
08:28:00 <clever> also, there is zero way to find out what made it ding!
08:28:00 <zid> oh yea
08:28:00 <zid> ctrl-i
08:28:00 <geist> the other power tip i learned long after using discord is you can collapse all of the groups and then only channels that are unmuted and have something show up
08:29:00 <clever> zid: that only works if you are directly pinged
08:29:00 <zid> yea that's why you turn on hide muted channels, so that works
08:29:00 <geist> one of the servers i hang out on for RL friends has a #zen-garden channel at the top that explicitly has no posts
08:29:00 <zid> https://cdn.discordapp.com/attachments/417023075348119556/908996958864150528/unknown.png
08:29:00 <zid> heh
08:29:00 <geist> you just hang out there all the time and can wait for other channels to open up. very nice
08:29:00 <clever> zid: but the default mode for a new server, is to play a ding sound for every msg, even if your not pinged
08:30:00 <clever> zid: yep, that exact option
08:30:00 <zid> https://cdn.discordapp.com/attachments/417023075348119556/908997260208128030/unknown.png My stuff ends up looking like this
08:30:00 <zid> server mute + hide muted + mute boring channels + collapse every category
08:31:00 <geist> yah
08:31:00 <geist> makes it almost tolerable
08:31:00 <zid> lots of lovely grunt work every time you join one
08:31:00 <geist> of coruse the other problem is the 'but but there's a channel there where they might be talking shit about...'
08:31:00 <geist> and that's hard to avoid
08:31:00 <geist> but.... if you literally hide the channel then it's that much more difficult to unmute it
08:31:00 <zid> Treat it like an irc network imo
08:31:00 <geist> so that may be the final barrier
08:32:00 <zid> I'm not going to join bearcave just in case someone says something interesting
08:32:00 <zid> in exchange for reading 8000 messages that aren't
08:32:00 <geist> yah in that regard it's like irc but far less dense
08:32:00 <geist> and thus not as useful
08:32:00 <zid> irc networks with ~500 people on each, spread over 50 channels, that's the future apparently
08:32:00 <geist> here, using any decent text viewer, and/or irccloud i can see a good 150 lines of backlog
08:33:00 <geist> discord i can't collapse it any denser than maybe 20, due to the damn logos, etc
08:33:00 <zid> My irc is basically set up like discord, the text for the channel name changes colour if someone speaksa
08:33:00 <geist> so i can walk over here and instantly spot if anything interesting set up
08:33:00 <zid> and I see one channel at a time
08:33:00 <zid> You can adjust the text style on discord
08:33:00 <zid> to irc like, small icons, big icons
08:33:00 <geist> hmm, actually there is an irc style huh
08:34:00 <geist> i thought i really went through all fo the settings, but maybe they have been adding this stuff over the years
08:34:00 <zid> nah that's been there for ages
08:34:00 <zid> just it used to be on the right click menu or something, before being moved there a few years ago
08:34:00 <geist> yah this is nice
08:34:00 <zid> now you just need to find a discord server actually worth being in
08:35:00 <zid> good luck
08:35:00 <geist> well like i said there are a few local ones set up by RL friends that are nice
08:35:00 <geist> folks recommending shows, books, cocktails, games, etc
08:35:00 <zid> yea I have a couple discords that are just a couple of friend groups
08:35:00 <zid> I even leave one unmuted :o
08:36:00 <geist> yep. the ones that are topic like... yeah dunno
08:36:00 <geist> though clever and i hung out on the raspberry pi unofficial one for a bit and it was pretty nice
08:36:00 <geist> some f the RPI folks where there and answered questions nicely. it was a pleasant set of chaps
08:36:00 <zid> I liked the Hunter class discord for world of warcraft classic :P
08:37:00 <geist> aww wow. i pine for that some days but really jsut dont have the energy/time to dedicate to it
08:37:00 <geist> but i really enjoyed it for about 10 years
08:41:00 <zid> I loved classic it was a blast, I played the first 6 months, up to BWL clear
08:41:00 <zid> Had never played a dps class before either, I played vanilla/tbc/wotlk/etc as a prot warrior every time
08:43:00 <jafarlihi> Hey, I'm trying to learn x86 assembly but the Intel manuals are too dense for me. Is there any book out there that is not MASM? I need GAS or NASM. (also, sorry for trolling in past, I have matured up)
08:43:00 <zid> dense how? you don't understand certain concepts so you're totally lost, or what?
08:44:00 <zid> Bear in mind you don't need to *read* the intel manual beyond the 'b means bit, B means byte, 0x means hex' in the intro, and then the instruction set reference
08:46:00 <zid> Like, if any info from the manual isn't in some other reference, that reference is just missing information
08:46:00 <jafarlihi> I just want the easy experience of a book with handholding, I can't even explain what throws me off with the manual.
08:47:00 <zid> What's your experience level? it sounds like a holistic problem
08:47:00 <jafarlihi> I can't write binary search with asm from exercism
08:47:00 <jafarlihi> I think I have significant backend experience
08:47:00 <zid> Can you write a C program? Can you debug one?
08:47:00 <kazinsal> I'm not sure if there even *is* a solid "how to assembly" book that's got any sort of modern-ish relevence...
08:48:00 <jafarlihi> Yes and yes, but quality is questionable
08:50:00 <geist> also sadly it tends to get tied up a lot in the architecture. a lot of times folks say 'learning assembly' and it's really 'learning x86' or 'learning ARM'
08:50:00 <zid> according to the results.
08:50:00 <zid> You should honestly be fine with the reference manual then tbh, Compares the first source operand with the second source operand and sets the status flags in the EFLAGS register
08:50:00 <geist> assembly itself is not a particular language per se, but a class of languages that are more similiar than dissimilar
08:50:00 <zid> Isn't exactly a hugely difficult thing to parse, and if you don't know what operands are or eflags are etc that seems lookupabble
08:51:00 <jafarlihi> Can you suggest architecture I can start with, that I can make OS for and has easier learning curve?
08:51:00 <zid> geist: I'd agree but I'd also disagree that it's an issue
08:51:00 <geist> zid: LOL! :)
08:51:00 <zid> Think of it like, "Learning a romance language, as a japanese speaker"
08:51:00 <zid> You're going to be 90% of the way there to speaking french, romanian, spanish, etc after you do it
08:51:00 <geist> but yeah. if you want to generally learn assembly i'd definitely recommend starting with something like risc-v
08:51:00 <zid> but it will be awkward as hell at first
08:51:00 <zid> I recommend anything you can stand
08:52:00 <zid> getting disheartened is the major stumbling block
08:52:00 <geist> but i guess the question is what is the goal? do you want to learn assembly generically, or are you specifically trying to write some asm because you have to because yiou want to do osdev on a particular piece of hardware?
08:52:00 <zid> so for a lot of people, the thrill of writing programs they can actually run on their desktop is a very good motivator so I tend to recommend x86
08:52:00 <geist> right
08:52:00 <jafarlihi> Thanks, I will look into other archs for now
08:52:00 <geist> exactly, hence the 'what are you looking to do this for' question
08:52:00 <zid> My favourite is the gameboy's cpu
08:53:00 <sham1> Ah yes, the not-quite-Z80
08:53:00 <zid> Writing a gameboy emulator has masses of documentation and really teaches you how a cpu works
08:53:00 <zid> and it's modern enough to be translatable to any other isa
08:53:00 <zid> either backwards to 6502 etc, or forwards to x86
08:53:00 <sham1> There's also always 6502 yeah
08:54:00 <zid> The problem I have with the 6502 is that it's very arcane
08:54:00 <jafarlihi> geist: I'm just trying to become as good of a programmer I can be, doing web stuff is boring as well
08:54:00 <geist> yah it's hard to recommend how to learn asm since i did it the old way: a 6502 book when i was a kid and an apple ][ mini-assembler
08:54:00 <zid> I learned x86 real mode
08:54:00 <zid> geist is an old man
08:54:00 * geist warily watches the front lawn
08:54:00 <zid> We're just waiting for him to finish turning to dust so we can have his stuff
08:54:00 <sham1> I learnt just x86 protected mode, real mode came later
08:55:00 <zid> pmode held no interest for me because I didn't feel like I could "do" anything
08:55:00 <zid> I relied heavily on the bios routines
08:55:00 <geist> same. honestly though i had a PC through most of my teenager and college years, x86 was always so icky i wans't that interested in it until college
08:55:00 <zid> It's taken until tbh fairly recently until I was ready to do osdev without bios routines
08:55:00 <geist> and then i went straight to protected mode
08:55:00 <zid> long enough that I skipped pmode and did straight long mode
08:55:00 <geist> only really via having to do bootloaders and whatnot did i backfill knowledge about real mode and wehatnot
08:56:00 <sham1> Well I also learnt assembly due to osdev like a couple of years ago, so I didn't feel like I needed real mode until I needed it
08:56:00 <geist> and even then i've only written hundreds of lines of real mode
08:56:00 <zid> On the plus side though, when I did come back, I had absolutely 0 issues with C or assembly or binutils etc
08:56:00 <zid> so I could just write whatever I wanted and all I had to deal with was the system stuff
08:56:00 <zid> osdev is hard because most of the time you're dealing with language + isa + tools + osdev
08:56:00 <sham1> Oh yeah, long mode 64-bit submode as well
08:56:00 <geist> i do think i wonder if i had had access to a 68k in high school if i would have gone more into things earlier
08:57:00 <geist> now that i've gone back and learned 68k its soooo much nicer
08:57:00 <sham1> The 68k is so good
08:57:00 <zid> I was absolutely avid about getting hold of a PC as a kid, not sure why
08:57:00 <geist> at the time now i understand why 68k folks were so snobby to PC people
08:57:00 <zid> jafarlihi: I recommend asking a specific question at some point, btw, it should be easy enough for us to answer, and we'll get a sense of where you're at and what you're struggling with
08:57:00 <sham1> I learnt to do 68k for megadrive stuff and hot damn is it a good ISA
08:58:00 <zid> yea SMD is a nice platform
08:58:00 <zid> It's that nice sweet spot before you get into the horrific messes that are psx/n64, but later than grotty 6502
08:58:00 <geist> recently rekindled my interest when qemu 6 (or was it 5) added a 'virt' machine for 68k
08:58:00 <geist> and via.. -kernel... you can get your 68k kernel running in like 0 lines of asm
08:58:00 <geist> well 1
08:58:00 <zid> snes but with a nicer cpu basically
08:59:00 <zid> geist: nah you have to write a bootloader first, we covered this, smh
08:59:00 <sham1> I've wanted an Amiga for some time now so I could just play around with a 68K
08:59:00 <geist> heh well i was looking into what it'd take to bootload off a floppy disk on a mac classic
08:59:00 <geist> and the answer is... it's complicated
08:59:00 <zid> Only reason I know anything about or care in the least for amiga is because I had a friend who was part of the amiga demo scene
08:59:00 <geist> talk about bios, that is a whole nother level of need to udnerstand the rom
08:59:00 <geist> sicne the lines between bios and kernel and OS on a mac classic are blurred
09:00:00 <zid> dude was less old than I am now, and wrote way better shit than I could still, rip
09:00:00 <geist> i keep an eye out for one, but amigas are so expensive now
09:00:00 <geist> but i did recently get a hold of a mac plus and it's a lovely machine
09:01:00 <zid> Disregard toys, write emulators
09:02:00 <kazinsal> kinda thinking about trying to get netbsd/mac68k booting on my classic II
09:03:00 <geist> oooh i guess it's an 030?
09:03:00 <zid> One day I will write an emulator that does codegen.. I just need to finish all this important procrastinating first
09:03:00 <kazinsal> yeah, so it has the MMU baked in
09:04:00 <geist> https://i.imgur.com/s3ZgqG6.png is the extent of my 68030 board :)
09:04:00 <geist> clearly need to spend more time on it
09:04:00 <zid> also yea, I need to finish my logisim cpu
09:05:00 <zid> stop reminding me of half started projects
09:05:00 <geist> but i actually have 2 or 3 030s in that form factor and a pile of sockets, so i'm thinking of starting a board that just wires up the data bus but runs all of the control signals out to pins
09:05:00 <geist> so i can prototype the control logic on rev 1 on a breadboard, but not have to worry about the bazillion data bus lines
09:05:00 <geist> and address bus
09:07:00 <geist> thats 4 512KBx8 bit sram chips, so have to also wire up a set of roms. darn 32a/32d bus
09:07:00 <zid> I'd like a gigantic bin of assorted crap to do something like ben eater
09:08:00 <zid> buying it all fresh would cost a fortune, you really need a stockpile of "random crap I've got after 20 years of playing"
09:08:00 <geist> yep. that's kinda my missino thus far. collect random crap for 20 years
09:09:00 <geist> i'm hitting that point where i spend more time buying and collectingb things to sort and store the random crap than the crap itself
09:09:00 <geist> it becomes it's own self perpetuating thing
09:11:00 <klange> hi what
09:11:00 <geist> heya klange
09:11:00 <zid> we found your secret boyfriend
09:12:00 <kazinsal> yeah I'm now at the point where if I just keep collecing crap I'm going to have yet another move one of those days where I just don't unpack everything until the next move
09:12:00 <kazinsal> so naturally my next focus is guitar pedals.
09:13:00 <geist> haha, i got my ts808 and then declared it done
09:14:00 <geist> actually reminds me, i hooked up my old peavy amp from high school that i hadn't used in like 10 years and omg all the pots are so noisy it's unusable
09:14:00 <geist> thats my projec tfor tomorrow: take it apart and clean it up
09:14:00 <klange> i just got a guitar recently
09:14:00 <kazinsal> I picked up an ehx od glove the other day and it's a great marshall plexi style overdrive. works fantastic into the "fat" clean voicing of my mark v
09:14:00 <geist> yay
09:14:00 <kazinsal> klange: one of us! one of us!
09:14:00 <geist> been thinkign of picking up a big muff for a while
09:14:00 <klange> luckily most of what i know from strumming an uke for the last fifteen years has actually translated
09:15:00 <geist> though honestly i really should sit down and invest in modelled software amps. seems to be The Thing now
09:15:00 <zid> I got an 80s casio recently, I really should put more than 10 minutes of practice into it
09:15:00 <geist> oh reminds me of a local guy in SF back when i lived there: casiotone for the painfully alone
09:15:00 <klange> essentially all amps are modelled amps now, tubes just ain't easy to find and cheap DSPs are plentiful
09:15:00 <geist> saw him a bunch
09:15:00 <kazinsal> yeah, I know a lot of people who just plug right into a USB-C interface and run various amp sims and effects and IRs through a DAW
09:15:00 <zid> ..It's a casiotone
09:16:00 <geist> zid: of course!
09:16:00 <zid> It's so 80s it's advertizing the fact it uses PCM as groundbreaking
09:16:00 <geist> klange: yah tell me about it. i have a big complicated tube amp and... needs some fixup on the tubes i think
09:17:00 <zid> https://pictures-nigeria.jijistatic.com/80114662_MTA2OC04MDItOWEyNWNhNjA1ZQ.jpg Assuming this website lets me hotlink their images..
09:17:00 <geist> one of the channels was getting crackly. haven't plugged it in in a year
09:17:00 <zid> It says PCM in big letters in about 4 places
09:17:00 <geist> nice!
09:17:00 <zid> It cost me an absolute fortune, 5 of the finest british pounds
09:17:00 <geist> i've got a mid 90s Roland that I like, been doing some work with that
09:17:00 <zid> and £1 for a 9V transformer
09:17:00 <geist> also has a floppy drive!
09:18:00 <kazinsal> I dread the day when I'm eventually going to need to diagnose failing preamp tubes and whatnot
09:18:00 <zid> I need to get a male phono to phono cable so I can plug it into my line-in on my PC and use it silently
09:18:00 <klange> I was tinkering with my DJ booth kit but it's meant for digital line-level stuff, so ended up picking up a little roland cube
09:18:00 <kazinsal> when 12AX7s fail, they fail *weird*
09:18:00 <zid> just call it circuitbent
09:19:00 <klange> https://cdn.discordapp.com/attachments/901993453452398623/908479956336668752/IMG_8446.jpg
09:20:00 <kazinsal> I dig those tetromino fret inlays
09:20:00 <geist> kazinsal: yah and my amp has a crapton of tubes
09:21:00 <zid> I'm trying to read the text on the books but I am failing hard
09:22:00 <kazinsal> geist: same. I think the V:35 is 6 preamp tubes and 4 power tubes. all that for 35 watts, but even at that it's waaaaay too loud with a cab for my apartment so I'm running it DI into an interface instead so I can use my headphones
09:22:00 <zid> square, square, something, something, fu? i? shi? ru? ka? i? ? bu? :P
09:22:00 <geist> mesa boogie mark 5?
09:22:00 <kazinsal> yeah
09:23:00 <kazinsal> ended up getting one a couple months ago. kind of a holy grail amp for me
09:23:00 <geist> niice! I always kinda wanted one of those. j petrucci plays on those
09:23:00 <geist> and i have one of his JP ernie ball guitars
09:23:00 <kazinsal> nice. I've got one of the sterling sub-brand lower cost JP signatures
09:23:00 <geist> my big tube amp is a hughes and kettner triamp
09:23:00 <klange> zid: the only books in that photo are titled in english; the things on the lower shelf are oversized bluray boxes for Kemono Friends
09:24:00 <geist> sice it has 3 full channels its just a crap ton of preamp tubes
09:24:00 <geist> though it shares the same 4 power tubes i think
09:24:00 <kazinsal> one day I probably want to get a full music man though, probably a silhouette. throw in the JP dimarzio bridge pickup and it'd be perfect for me
09:24:00 <zid> kemono friends has vtubers now I think?
09:25:00 <kazinsal> that being said I'd also love to actually *do* something with all this gear before I consider dropping three grand and change on a guitar
09:25:00 <zid> yea, two penguins, matsuri did a collab with one of them recently and I saw a clip. That show is amazingly popular
09:25:00 <geist> yah i gotta say the JP signature i got in 2006 or so and it's the last guitar i ever bought
09:25:00 <klange> I kinda stopped paying attention after season 1 of the anime and how the producers did the studio dirty
09:25:00 <geist> it's such a fine instrument
09:28:00 <kazinsal> they really do play like a dream
09:28:00 <geist> kazinsal: agreed. i play fairly constantly but for no particular reason
09:29:00 <zid> Coming as a surprise to absolutely nobody, learning to play keyboard/piano is hard
09:30:00 <zid> I can't remember the music so I have to stare at them, and then I can't look at my fingers so I get lost
09:30:00 <zid> s/them/it
09:30:00 <geist> being the nerd i am i'm much more interested in using keyboard as a master music theory instrument than a skill thing
09:30:00 <geist> i work out chords and scales and wehatnot on the keyboard
09:30:00 <zid> I just wanted to play ocarina of time music
09:30:00 <geist> but not particularly adept at playing it
09:30:00 <zid> turns out a lot of it is octaves and those are.. kinda hard to play especially without being able to look at the damn keys :p
09:31:00 <klange> I play a lot instruments... poorly.
09:31:00 <zid> plus my ear is still bad so I'm not always certain I even hit the right key
09:31:00 <zid> it's very.. osdev
09:31:00 <zid> lots of skills needed at the same time to get anything done
09:32:00 <klange> Piano, uke, trombone (had actual instruction on that one!), harmonica (inc. chromatic), theremin... and now I'm picking up the guitar...
09:32:00 <geist> it's like writing assembly, the first one is the hard one
09:32:00 <geist> then you can apply a fair amount of what you know to the next one
09:46:00 <klange> < geist> and rips on people from the 90s and klange right there ← what was this about?
09:47:00 <geist> i dunno. some guy in the discord thing name dropped you a few times for seems like random reason
09:47:00 <geist> sorry for dragging you in, it's not worth it
09:47:00 <j`ey> klange: apparently you endorse qemu's
09:48:00 <j`ey> '-kernel' option
09:48:00 <geist> i've about given up on that place, but i gave it a jolly good go
09:49:00 <kazinsal> I never joined that discord but if I did I'd probably get thrown out for telling idiots they're idiots
09:50:00 <geist> yeah it looked like it was deceptively more together than the last time i've checked it out
09:50:00 <geist> and if it weren't for a few bad apples that'd probably be the case
09:50:00 <zid> I wonder what the guy who was here the other day extolling the virtues of the discord thinks
09:50:00 <geist> but it seems like there's at least one guy that just keeps being aggressively a dick to me at least so i'm pretty much done
09:50:00 <klange> 'endorse' is perhaps a bit too positive, but I do support it and think it's an acceptable thing; half-baked as far mulitboot1 implementations go, but it's workable
09:50:00 <geist> he just fights me everywhere
09:51:00 <zid> that one guy being the ban happy owner
09:51:00 <geist> but sicne he's an admin he can just win the argument
09:51:00 <geist> so basically, meh.
09:51:00 <kazinsal> about what I expect
09:51:00 <zid> about what I expected too
09:51:00 <kazinsal> so, yeah, I'd be removed from the premises within about 30 minutes
09:51:00 <zid> I gave it a chance purely because of the guy here who said it was fine
09:51:00 <zid> kazinsal: I lasted 15
09:51:00 <geist> hah zid actually got booted
11:02:00 <sham1> Boot boot
14:40:00 <wleslie> ah, -kernel
14:40:00 <wleslie> I mean, is there even a solution to building a system image without root trickery or building the image itself from within a virtual machine?
14:41:00 <wleslie> because that's not really a great option, either
14:41:00 <wleslie> the sad thing is, ari who created rump has almost exactly the thing, but I can't figure out how to make that work
14:42:00 <clever> mkfs.ext4 -d ./rootImage blk.bin
14:43:00 <clever> wleslie: this will format blk.bin as an ext4 fs, and automatically copy the rootImage dir to the root dir of that new fs, without needing root
14:43:00 <j`ey> clever: !
14:43:00 <j`ey> clever: what file type is rootimage?
14:43:00 <wleslie> you'll still need to install grub onto it
14:43:00 <clever> j`ey: directory
14:44:00 <j`ey> clever: that's cool
14:44:00 <clever> wleslie: yeah, i believe grub-install can be convinced to do it, but youll also have to use dd to assemble the mbr and partitions by hand
14:45:00 <zid> yea losetup needing root is kind of annoying
14:46:00 <wleslie> it's a rabbit hole I should follow
14:46:00 <zid> mkisofs is what I use as a workaround
14:47:00 <clever> j`ey: https://youtu.be/suswjbpR1HU is one of my recent animation tests on the rpi, that scaling uses <1% of the cpu time
14:47:00 <bslsk05> ​'HVS scaling animation test' by michael bishop (00:00:26)
14:47:00 <zid> no native fs, but iso9660 at least gets you a boot fs
14:47:00 <j`ey> clever: can you only walk diagonally?
14:48:00 <j`ey> clever: neat, is that the LK console?
14:48:00 <clever> j`ey: the h and v axis each have their own scale, and i'm just using a basic loop to animate them seperately
14:48:00 <clever> yeah
14:51:00 <clever> j`ey: https://github.com/librerpi/lk-overlay/blob/master/app/grid/grid.c#L50-L77
14:51:00 <bslsk05> ​github.com: lk-overlay/grid.c at master · librerpi/lk-overlay · GitHub
14:52:00 <clever> i can just freely manipulate the x/y/w/h of this layer, and the hw will do the rest
14:52:00 <clever> as long as they are all positive ints
14:52:00 <heat> soo yesterday I spent the whole evening debugging csgo
14:52:00 <heat> turns out it just needed a reboot
14:52:00 <heat> fml
14:52:00 <zid> nice
14:52:00 <j`ey> heat: always turn it off and on
14:52:00 <zid> now you can get to silver 3
14:52:00 <heat> nicen't
14:53:00 <heat> great I've never been silver 3
14:53:00 <zid> I have, I placed there when I first booted it, had never really played an fps :(
14:53:00 <heat> my first rank was silver elite master around 2015
14:54:00 <heat> 2000 hours later I'm mg1-mg2
14:54:00 <heat> worth.
14:54:00 <zid> I got to double ak whatever rank that is after a couple hundred
14:54:00 <zid> maybe a 500, idk how much is surf and fucking around and stuff, I apparently have 700 total
14:55:00 <heat> the best part about this whole adventure is that it runs like shit here in linux soo this was not worth it
14:55:00 <zid> heh
14:55:00 <zid> I should check how much my ak redline is worth now
14:55:00 <zid> it was £3 when I got it, I've variously checked back and seen it as high as 15
14:55:00 <heat> around 15 euro I think yeah
14:56:00 <zid> £10 :(
14:57:00 <zid> You need a recent purchase and a phone attached to your account that can run the steam app and shit though to actually sell now
14:57:00 <heat> that's been the case for a long time
14:58:00 <zid> I had a phone that could run it when they added it, but it stopped being able to
14:58:00 <zid> it's just 'a website in a box' and they changed it to need newer tls and newer js and stuff so it stopped
15:03:00 <heat> yeah
15:04:00 <heat> no idea why it's not just some standard 2FA thing
16:08:00 <vdamewood> Is it worth while to support networking stacks other than TCP/IP?
16:13:00 <heat> what other stacks do you have in mind?
16:17:00 <heat> i'd say in general you should strive for decent enough abstractions so that it's not bothersome to add support for anything else, but it depends on your use case of course
16:17:00 <heat> i.e wanting to add raw sockets to your bsd socket implementation
16:19:00 <vdamewood> I was thinking IPX
16:19:00 <vdamewood> And you would still need some level of abstraction for things like IPv4 vs IPv6.
16:22:00 <heat> the way I do it: sys_socket() calls tcp_create_socket(), udp_create_sockets(), etc
16:22:00 <heat> a tcp_socket or udp_socket is a specialisation of inet_socket and can call inet 4/6 code at will
16:23:00 <heat> note that if you don't need to support a hybrid v4/v6 stack you can use a better structure and have a inet4_socket and another inet6_socket
16:24:00 <heat> if I want to add different stacks, I just add more cases to the switch statement, and that's it
16:25:00 <heat> note that each protocol needs to implement the basic read/write primitives (sendmsg and recvmsg in my case)
16:26:00 <heat> mostly because it's very hard to do a portable recvmsg and sendmsg due to differences between protocols
16:36:00 <kaichiuchu> fun task: i'm trying to write a xbd utility syntax guideline parser: https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/
16:36:00 <bslsk05> ​pubs.opengroup.org: The Open Group Base Specifications Issue 7, 2018 edition
16:36:00 <kaichiuchu> it's.. difficult
16:36:00 <kaichiuchu> the idea being for the userland you can just say XBD::UtilitySyntaxParser parser{ argc, argv, "[-acm] [-r ref_file|-t time|-d date_time] file..."};
16:36:00 <kaichiuchu> and it simply becomes done
17:19:00 <jjuran> I learned 68K asm initially because I needed it for appdev
17:27:00 <jjuran> sham1: I wrote xv68k, which can run raw 68K machine code out of a file
17:28:00 <sham1> Nice
17:28:00 <sham1> So basically an interpreter for the ISA
17:28:00 <jjuran> yeah
17:28:00 <jjuran> It has a minimal syscall bridge so you can write() and writev() to stdout, for example
17:29:00 <sham1> Neat
17:31:00 <jjuran> Back to keyboards, I acquired a Yamaha DGX-640 last year.
19:30:00 <Baobab> hi
19:31:00 <junon> henlo
20:18:00 * geist yawns
20:18:00 <geist> good afternoon everyone
20:19:00 * gog meows
20:19:00 <gog> good evening
20:19:00 * geist pets the resident kitty
20:24:00 * gog purrs
20:24:00 <gog> i tried to program today and failed miserably
20:25:00 <j`ey> gog: at least you tried?
20:25:00 <GeDaMo> https://v.redd.it/3baa2dsxwcz71/DASH_360.mp4
20:25:00 <bslsk05> ​'3baa2dsxwcz71' by [idk] (--:--:--)
20:25:00 <gog> i guess lol
20:25:00 <gog> i think that kitty is a little bigger than the physical gauge of that railway
20:25:00 <j`ey> I submitted some patches to the kernel today, to clean up a driver that got merged recently
20:27:00 <j`ey> *linux kernel
20:32:00 <geist> https://www.youtube.com/watch?v=W85oD8FEF78
20:32:00 <bslsk05> ​'Jurassic Park but with a Cat' by OwlKitty (00:01:15)
20:32:00 <geist> j`ey: oh yay.
20:33:00 <geist> i mean yay if it gets in, not yay in having to do that
20:33:00 <geist> i submitted a trivial patch to qemu a few weeks ago that made it in, so now i think i understand how it works
20:34:00 <j`ey> should be fine, just minor style things :)
20:34:00 <j`ey> geist: what did you do to qemu?
20:34:00 <geist> just a reformatting and lining up of text in 'info registers` on riscv
20:35:00 <geist> kinda a test push if nothing else
20:35:00 <geist> the columns were all malformed before
20:36:00 <j`ey> ah cool
20:36:00 <geist> qemu does the usual 'email the patch to this mailing list' thing which i hadnit done before
20:36:00 <geist> but turns out to not be so bad
20:38:00 <j`ey> yeah, im getting used to it now
20:38:00 <geist> i quietly slipped out of the osdev discord a while back. bummer it wasn't going to work
20:39:00 <geist> but so it goes.
20:39:00 <gog> i haven't even looked at it in a few days
20:39:00 <gog> my server list in discord keeps getting shorter also
20:39:00 <j`ey> most i never lool at
20:40:00 <geist> yah i guess it was more of a big thing to me :)
20:40:00 <geist> i still am too ol school about internet social stuff. i like to be full engaged or not at all
20:40:00 <gog> i had to quit a server i've been in for like 4 years a few weeks ago
20:41:00 <geist> this whole discord style thing where you join 20 servers and then never really check 18 of them is actually kinda anxiety inducing
20:41:00 <gog> true
20:41:00 <geist> there's a FOMO affect to it. i'd rather something not be on the list at all then know its there and never read it
20:44:00 <j`ey> same. i need to trim my irc channels too
20:45:00 <GeDaMo> I'm only in 4 at the moment
20:45:00 <geist> yah i did somewhat when i moved off freenode and haven't been too upset
20:45:00 <GeDaMo> There's a sweet spot for the amount of activity, too much or too little and I leave :P
20:45:00 <gog> i'm still mildly upset about the circumstances of quitting that one server
20:46:00 <geist> side note: i do kinda wonder what happened to the other #osdev channel on freenode. did it die on the vine? I haven't bothered to even try to log in there anymore once they wiped the accounts
20:46:00 <geist> and also since irccloud is still klined i think
20:46:00 <GeDaMo> Somebody came into ##programming the other day asking if Freenode was still there because they couldn't connect
20:47:00 <geist> yah it has some whole pre-auth SSL/TLS thing now
20:47:00 <geist> looks like you have to make an account up front, etc
20:47:00 <GeDaMo> "Replace Services Authentication with Fiat, Decentralized Blockchain Based Authentication" :| https://freenode.net/
20:47:00 <bslsk05> ​freenode.net: freenode
20:48:00 <geist> but that doesn't have a check box next to it
20:48:00 <gog> blockchain lol
20:48:00 <GeDaMo> Ah, missed that
20:48:00 <GeDaMo> "Officially become digital territory of the Joseon Empire" :|
20:48:00 <geist> .... WTF
20:48:00 <geist> yah was just reading this whole manifesto. okay. wow
20:49:00 <gog> digital territory lmfao
20:49:00 <GeDaMo> https://en.wikipedia.org/wiki/Joseon "was a Korean dynastic kingdom that lasted for approximately five centuries."
20:49:00 <bslsk05> ​en.wikipedia.org: Joseon - Wikipedia
20:49:00 <geist> i mean it means nothing at all to someone that connects to it, but it's clear that guy has some issues he's working out
20:49:00 <gog> or not, for that matter
20:49:00 <GeDaMo> Well, he names himself "HIH"
20:49:00 <GeDaMo> Presumable His Imperial Highness
20:50:00 <geist> wow. okay. wow.
20:53:00 <gog> lel
20:53:00 <geist> yah can't even easily peek in to see what's going on, since you have to create an account on the web page up front, etc
20:53:00 <geist> and i have no idea what sort of crazy that will go to
20:56:00 <geist> nice, irccloud lets you download all the logs for a server in a .zip file
20:56:00 <geist> download and then delete server. done with an era
21:01:00 <gog> i'm gonna start my own irc server
21:02:00 <gog> gog.is is availabe!
21:02:00 <geist> we can talk about good old games!
21:02:00 <gog> oh it's not nevermind
21:02:00 <gog> some norwegian owns it
21:03:00 <gog> it expires 2/1/22 so i'll wait to see if it's renewed
21:04:00 <gog> osdev.is is available
21:04:00 <GeDaMo> Doesn't seem to have a website on it
21:07:00 <gog> it has an ip registered but it doesn't reply
21:09:00 <gog> aha, it's a domain squatter
21:09:00 <gog> domeneshop.no
21:11:00 <geist> Yah I could imagine a lot of .is stuff could be squatted on because of the is word
21:12:00 <gog> i'm gonna send false abuse reports to isnic and then buy it out from under them :p
21:31:00 <j`ey> oh hey, a wild sortie appeared on my twitter feed
21:31:00 <sham1> Sounds nice
21:31:00 <j`ey> https://twitter.com/sortiecat/status/1459491375167291395
21:31:00 <bslsk05> ​twitter: <sortiecat> Guess who's back. Back again. sortie's back. Tell a friend. https://pbs.twimg.com/media/FEEnDo8XEAMhH-y.jpg [sortie having a mild case of times square syndrome, this time having learned to smile beautifully among the neon bill boards on a busy tourist evening, but forgetting to horizontally flip the image so the read is illegible]
22:03:00 <tomathy> hi is osdev the same as computer architecture?
22:04:00 <tomathy> (effectively/approximately)
22:07:00 <kazinsal> in the sense that hockey and basketball are the same games if you put a wooden floor on top of an ice rink
22:23:00 <tomathy> well they'd both be very difficult to play
22:24:00 <tomathy> but a "floor" cannot really be placed on ice
22:25:00 <tomathy> ok maybe it can
22:25:00 <tomathy> i dont bleong here
22:41:00 <j`ey> anyone know about mips? someone said that the when the syscall instructions returns to whatever the link register was.. not to the instrction after the syscall?
22:42:00 <geist> hmm, lets see
22:42:00 <geist> i did a mips port but i didn't mess with the syscall instruction
22:43:00 <geist> i'd assume the return method is the same as a regular interrupt exit
22:43:00 <geist> iirc mips did something cute on interrupt return like it's a regular branch, but in the branch delay slot you load the main control register that flips back to user space
22:43:00 <geist> so there's no explicit iret like instruction
22:45:00 <geist> hmm, guess not, there's an eret instruction: https://github.com/littlekernel/lk/blob/master/arch/mips/vectors.S#L129
22:45:00 <bslsk05> ​github.com: lk/vectors.S at master · littlekernel/lk · GitHub
22:45:00 <geist> been a while sicne i fiddled with it. but... all that aside i dont think the syscall instruction on mips is particularly fancy
22:46:00 <geist> and yeah it may be that the syscall handler has a responsibility to push the return address forward to the instruction afterwards. that's not particularly uncommon in some arches
22:47:00 <geist> i did that mips port like 5 years ago and forgot all the details. worse, riscv is very similar and has mostly paved over those neurons in my brain since. makes sense, since riscv is effectively the same lineage of architecture
22:51:00 <j`ey> hmm
22:52:00 <geist> (the branch + control register in branch delay slot is microblaze, looked it up)
22:53:00 <geist> oh heh, yeah that's right, riscv has the same thing: https://github.com/littlekernel/lkuser/blob/master/sys/lib/lkuser/syscalls.c#L243
22:53:00 <bslsk05> ​github.com: lkuser/syscalls.c at master · littlekernel/lkuser · GitHub
22:54:00 <geist> you have to manually return one instruction later or it repeats it. so given that riscv has it, and it's effectively the successor to mips...
22:55:00 <j`ey> I'll write a little paste
22:55:00 <geist> so it's not exactly your question, but yeah there's some fiddling going on there. looks like both riscv and mips put the return address in the EPC control register, which is what eret returns to
22:56:00 <geist> but... in both cases the PC it saves isn't necessarily the next instruction
22:56:00 <geist> that being said the kernel could choose to return to the LR if it wanted to, if someone wanted to microptimize that or something
22:57:00 <j`ey> https://paste.gg/p/anonymous/4f9b7ee29aa84d56bd1313fed4c4e8db this is whats happening
22:57:00 <bslsk05> ​paste.gg: pastefile1 · paste.gg
23:07:00 <j`ey> which seems weird, you'd need to set lr before 'syscall'
23:07:00 <geist> is this on some particular OS?
23:07:00 <geist> what does the exception handling code in the kernel do?
23:07:00 <j`ey> windows NT
23:08:00 <geist> ah. well it's possible they literally defined the syscall api as 'return to what was in LR'
23:08:00 <geist> which i guess could be some microptimization to avoid having to just `j lr` on the other side of the syscall
23:08:00 <j`ey> yeah, maybe ill try look for something NT specific
23:08:00 <geist> but from what i understand mips has an eret instruction that among other things copies EPC -> PC
23:10:00 <j`ey> I guess youre meant to always call syscalls through some wrappers, so it makes sense
23:13:00 <clever> j`ey: i think that is part of what the vdso does on linux, and the hypercall page on xen
23:13:00 <clever> the higher power supples a chunk of binary wrappers, that deal with the permission level transfer
23:16:00 <j`ey> yeah, similar, it was just the weird return i was confused by!
23:16:00 <geist> also maybe someone thought 'hey i already have to screw around with the return address because of the += 4 anyway, so may as well just make it simpler and iframe->epc = iframe->lr'
23:16:00 <geist> of course that now opens you up to a new set of fun user space exploits and whatnot (set lr to weird, unaligned, or kernel things)
23:17:00 <geist> but this was late 80s, early 90s. a simpler time.
23:26:00 <sham1> BTW, I'm not at the computer so I can't check this myself, what would be the best way of doing something like `lea rax, [rax - 7]` or `lea rax, {
23:26:00 <sham1> lea rax, [rax - 3]
23:27:00 <sham1> IIRC those values aren't valid, since they'd need to be powers of 2
23:27:00 <sham1> And these are powers of two minus 1
23:29:00 <sham1> Now, this is really an XY question since really what I'm trying to do is clear the 2 or 3 bottom bits of an address because it's a tagged pointer. And I was wondering if one could use lea for it. Of course the real solution is to use AND
23:32:00 <j`ey> godbolt says and+mov
23:32:00 <sham1> Hmm, so and it is
23:33:00 <sham1> Makes sense. No reason to do any complicated arithmetic when doing addr & (~7) does the trick
23:33:00 <moon-child> sham1: first: [rax - 7] is a valid address. You can use any 32-bit value as a displacement. It's scale that has to be 1, 2, 4, or 8
23:34:00 <sham1> Ah, I see
23:34:00 <sham1> I misremembered
23:34:00 <moon-child> also, since dst is the same as src there, you could just say sub rax, 3 :)
23:34:00 <moon-child> sham1: second: with a tagged pointer, it generally makes more sense to access it at offset, so you don't have to explicitly untag it and re-tag it later
23:35:00 <sham1> Yeah, so you'd do something like `mov rbx, [rax - 7]`, say
23:35:00 <sham1> Makes sense
23:35:00 <j`ey> interesting that gcc doesnt do it
23:35:00 <moon-child> yeah
23:37:00 <sham1> And ofc replacing mov with lea if one wants the address of the first word. Makes sense. Glad that was sorted out
23:47:00 <geist> i'm guessing all else held equal less complex addressing modes are more preferred
23:48:00 <geist> also just to be clear (since i'm not entirely sure which addressing mode you're trying to use there) you want to dereference something off rax - 7 and put it in rax?
23:48:00 <geist> or you want to just subtract 7 from rax?
23:50:00 <geist> oh i see. yeah just masking with an and
23:50:00 <moon-child> geist: most accesses to a given pointer will be offset anyway, so pre-masking doesn't gain you much
23:59:00 <kaichiuchu> dunno if anyone cares but arch linux's qemu seems to not have rtl8139 support
23:59:00 <kaichiuchu> had to compile from source