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=osdev&y=19&m=2&d=5

Tuesday, 5 February 2019

12:00:57 <MarcinWieczorek> good idea
12:04:17 <MarcinWieczorek> gtg, thank you guys
12:24:37 <jmp9> Okay
12:24:40 <jmp9> I spent hour in toilet
12:25:02 <geist> TMI
12:25:03 <jmp9> And I didn't figure out how to use GRUB and FAT16
12:27:44 <ronsor> FAT16!
12:27:57 <ronsor> and GRUB
12:29:41 <jmp9> So what
12:29:56 <jmp9> super mega ultra GRUB can't handle good ol' FAT16?
12:30:27 <geist> no, i think that works fine
12:31:35 <jmp9> okay, grub-rescue produces ISO file
12:31:45 <jmp9> but how to embedd some files into FAT16
12:31:53 <geist> grub-rescue is't what you want
12:32:09 <geist> it is a high level thing indenede to do precisely what it says: build a rescue disk for *your system*
12:32:26 <geist> so it sometimes generates something that's UEFI, sometimes for plain bios, depending on how it decided that particular PC wants to boot
12:32:55 <jmp9> What do I need and how to do it?
12:33:12 <geist> you want to find out to configure a disk image manually using the plain grub commands
12:33:19 <geist> grub-install, i believe and others
12:33:38 <geist> note you should only really need to do it once if you want to keep reusing the same disk image, like say using mtools to copy your kernel into it
12:33:51 <geist> i have a machine here with a usb floppy that i mount, copy, unmount
12:36:40 <geist> generally iirc you start by formatting the disk, then yuo can use grub-install to put an installation of it there, it'll copy bits to it and set it up
12:36:53 <geist> then you configuure the grub.cfg file and copy your file over and go
12:37:02 <geist> then from then on out you can just copy a new version of your system to it
12:37:50 <geist> note grub can be installed on a lot of different fses, which is why something like an iso9660 is also fine. or ext2
12:38:02 <geist> but FAT is a nice starting point
12:41:19 <jmp9> So, I mount my image
12:41:25 <jmp9> Then I type grub-install
12:41:34 <jmp9> and it will install grub into MBR and some files?
12:41:38 <geist> well, no, you go find the relevant installation on the internet
12:41:52 <geist> i'm giving you an overview of approximately what it is
12:41:59 <jmp9> As I googled
12:42:00 <geist> the specifics you'll have to find, i dont have it handy here
12:42:04 <jmp9> mount /dev/loop0 /mnt/usb
12:42:05 <geist> be very very careful with grub-install
12:42:09 <jmp9> grub-install --boot-directory=/mnt/usb/bugbios --force --allow-floppy /dev/loop0
12:42:11 <geist> it may trash your setup
12:42:23 <geist> ah now we're talking
12:44:05 <geist> yes, that seems like the right strategy
12:46:33 <jmp9> How do I make some configs
12:46:40 <jmp9> for GRUB
12:46:41 <jmp9> ?
12:46:51 <geist> look around on the net
12:46:57 <geist> basically you need an entry that points at your kernel
12:47:40 <geist> you can even set the timeout to be zero so it directly boots into it
01:05:23 <jmp9> guys
01:05:29 <jmp9> I don't ask for something bigger or special
01:05:38 <jmp9> But can anyone give me example of their GRUB config?
01:05:45 <jmp9> So I'll not destroy my PC
01:09:39 <geist> hmm, lets see
01:09:45 <geist> i have one but it's for grub 1.0
01:10:27 <geist> but lets get it somewhere
01:11:12 <geist> https://pastebin.com/u5Q4diQ8
01:11:41 <geist> i dont know of grub 2 willunderstand the same format, but it's fairly similar. you should be able to get an idea by looking at the grub that'sprobably booting your system (if you're using linux)
01:17:55 <eryjus> geist, grub 2 will recogize grub 1 formats and feed the info in the proper format
01:18:11 <geist> there ya go
01:18:47 <geist> i also dunno where it's hard coded, but on this old disk image it's called boot/grub/menu.lst
01:19:01 <geist> newer ones seem to be generally grub.cfg
01:19:09 <eryjus> https://github.com/eryjus/century-os/blob/master/modules/loader/src/i686/entry.s
01:19:25 <eryjus> has both MB1 and MB2 header in the same file and will boot either
01:20:03 <geist> eryjus: note i twas talking about the menu file, not multiboot 1 vs 2
01:20:13 <eryjus> whoops...
01:28:57 <geist> but i'm actually kinda curious now
01:31:06 <jmp9> okay i compiled kernel
01:31:16 <jmp9> now it's time to put this shit in FAT16 image
01:32:48 <geist> woot!
01:34:03 <eryjus> geist, please share!
01:34:12 <geist> hmm? what?
01:34:32 <eryjus> you were curious and then celebrating....
01:34:39 <geist> oh i was wooting jmp9
01:34:46 <eryjus> :D
01:34:47 <geist> a cheer from the sidelines as it were
01:42:39 <jmp9> what's name of fat grub module?
01:51:54 <geist> i'm going to guess something like fat, vfat, or dos
01:51:57 <geist> or maybe even msdos
01:55:26 <_mjg> yo
01:59:29 <jmp9> Okay guys
01:59:46 <jmp9> It's loading GRUB bash
01:59:49 <jmp9> but not menu
02:00:25 <_mjg> positively surprised with virtualbox
02:00:33 <_mjg> playing need for speed high stakes ('99 or so) no problem
02:00:44 <_mjg> with accell
02:03:36 <geist> jmp9: yah so now you need to figure out the format of that menu
02:03:44 <geist> and the name of it. i think it's usually grub/grub.cfg now
02:03:50 <geist> so you'll have to read up on what the format is
02:04:21 <jmp9> oh
02:04:25 <jmp9> i have grub2.cfg
02:04:42 <geist> that may be fine too. i'm just sayin
02:04:55 <geist> i dont know this stuff off the top of my head, but i'm trying to generally point you in the right direction
02:05:02 <geist> but take everything i say with some grains of salt
02:15:55 <jmp9> Yaaaaaay!
02:15:57 <jmp9> It works!
02:16:06 <geist> sweet, what did you end up doing?
02:16:25 <jmp9> dd image, then created grub partion with fdisk
02:16:26 <jmp9> grub-install
02:16:39 <jmp9> copy some configs and lenochka.bin (kernel file)
02:17:07 <jmp9> it didn't load because it must be /boot/grub/grub.cfg, not grub2.cfg
02:17:40 <jmp9> it's very easy to update kernel file, because all i need is mount image file
02:17:56 <geist> yep! it takes some time to set up, but it's pretty useful once you do
02:19:05 <jmp9> that's it
02:19:23 <jmp9> I can't wait to test it on real hardware
02:19:56 <geist> hav eyou tried with qemu or whatnot?
02:20:18 <jmp9> yes I did
02:20:50 <geist> rad!
02:22:57 <xiphias> this is a bad channel to start this discussion
02:23:12 <xiphias> but why does rust have the following it does
02:23:18 <xiphias> i'm sure it will eventually die out, but.
02:25:53 <xiphias> i am trying to understand what problem it's supposed to solve and I'm not seeing it
02:26:47 <ybyourmom> xiphias: No, it doesn't seem to be slowing down -- I think the draw behind it is that it has the whole safe vs unsafe distinction
02:26:58 <geist> yah
02:27:00 <ybyourmom> As well as there's some apparent link to formal verification as well
02:27:01 <xiphias> i did say eventually
02:27:43 <ybyourmom> I also thought it was a fad, but it seems like there are reasons why it is actually a different beast
02:27:52 <xiphias> i don't know, most of what I see is "oh it helps you write bug free code"
02:28:00 <xiphias> if you have bugs, your code is flawed
02:28:11 <ybyourmom> Hey, you have bugs right now lol
02:28:21 <xiphias> please don't do that to me
02:28:38 <xiphias> you're maybe the 5th person to say this to me as if these bugs actually have a dire, major impact on what i'm doing
02:28:41 <geist> well, yes, it's based on the premise that humans are inheiritantly bad at writing bug free code
02:28:55 <geist> of course, it depends on what you're trying to do and how important the code is
02:29:02 <xiphias> i'm by no means saying i'm perfect here
02:29:08 <geist> but for smoething like kernel development where it's mandatory that the code be essentially bug free
02:29:11 <ybyourmom> k, I'm sensing a bit of sensitivity that I didn't expect kek, I'll back off an observe for now
02:29:13 <geist> or at least fail gracefully
02:29:18 <xiphias> but coding is a process of refinement
02:29:22 <geist> then hypothetically it's a much better fit
02:29:34 <ybyourmom> I'm a patient man
02:29:44 <xiphias> ybyourmom: we're not playing league, are we?
02:30:01 <xiphias> i'm tolerant of other opinions :(
02:30:26 <geist> at least a few folks here have worked on rust based kernels
02:30:30 <ybyourmom> Also keep in mind that Rust has a link, though I'm not sure how strong, to formal verification
02:30:33 <geist> Mutabah: was it you?
02:30:43 <xiphias> geist: my main argument is Rust forces you to follow a certain model where deviation from this model can cause problems
02:30:56 <geist> of courrse
02:30:58 <xiphias> but dammit, I want to use my own fucking model
02:31:00 <geist> that's the tradeoff
02:31:07 <ybyourmom> Imo, limited-paradigm languages are nice - I wish C++ wasn't multi-paradigm
02:31:10 <geist> it's the main reason i haven't jumped all over it
02:31:20 <jmp9> uhm
02:31:21 <xiphias> I don't think I'll ever move from C
02:31:22 <jmp9> termlib.c:(.text+0x110): undefined reference to `__stack_chk_fail_local'
02:31:26 <geist> but i see the appeal, and there's good value there. but like most things it's a tradeoff
02:31:30 <jmp9> how to disable it
02:31:41 <xiphias> you do not disable an "undefined reference"
02:31:41 <ybyourmom> jmp9: #if 0 #endif
02:31:45 <geist> jmp9: dunno how you're getting stack check in there
02:31:52 <geist> are you compiling with stack check enabled?
02:32:07 <jmp9> idk
02:32:11 <ybyourmom> #ifdef out all your code
02:32:16 <geist> well, then go figure it out
02:32:28 <geist> look at how you're driving the compiler, see if you're setting any flags
02:32:36 <geist> especially if you copied the setup from somewhere else
02:32:52 <jmp9> I used old makefile from OS of my friend
02:32:57 <xiphias> overall, in regards to rust
02:32:58 <jmp9> that makefile I created so no copy paste
02:33:07 <xiphias> i'm kind of tired of it being the "use it for everything" trend more than anything
02:33:28 <ybyourmom> xiphias: I don't get the trend either, but the bit I've picked up is that it's not baseless
02:33:36 <ybyourmom> Unlike Go, for example
02:34:12 <xiphias> i mean, I don't do anything that could cause a major security concern
02:34:26 <xiphias> but rust seems to assume that I would
02:35:05 <ybyourmom> Well, if you don't like it, don't sweat it
02:35:06 <geist> xiphias: frankly it sounds to me like you have some amount of baggage here
02:35:15 <geist> as in you've already pre-decided you dont like it
02:35:15 <xiphias> define "baggage"
02:35:22 <xiphias> well
02:35:26 <geist> as in "I dont think i'll everr move from C"
02:35:46 <xiphias> I cannot deny I have a strong bias towards C, I love C, and yes that may cause my perceptions of other languages to be skewed
02:36:13 <geist> and mind you i'm partially in the sme state. i really shoulkd give Rust a go, and we're using it all over the place in fuchsia, so i have a fantastic opportunity
02:36:19 <ybyourmom> I also wish that new languages don't intrude on my professional domain so that I don't have to learn new languages -- I specifically do embedded stuff so that I don't have to deal with a constantly changing professional zeitgeist like web developers do
02:36:21 <geist> and i'm sitting near one of the main Rust folks
02:36:26 <jmp9> nice. I ported my old kprintf/ksprintf to my os
02:36:43 <xiphias> i just don't like the mindset it puts you in, where the language is supposed to save you from yourself
02:36:52 <xiphias> but yes
02:36:54 <jmp9> yes me too
02:37:00 <jmp9> I don't like that ideology
02:37:01 <xiphias> i understand humans are fallible
02:37:06 <jmp9> when language smarter than coder
02:37:21 <geist> i generally agree, except there is a lot of hard data that no, humans are pretty fallible
02:37:25 <ybyourmom> If I can earn more money by differentiating myself by learning Rust, then I'm in favour of Rust
02:37:32 <geist> it depends on the size of the project, the level of interactions between other stuff, etc
02:37:42 <ybyourmom> If there's no extra money in it, I won't learn it -- that's my stance; I'm all about that dollar
02:37:56 <ybyourmom> If it doesn't make dollars then it doesn't make sense
02:37:58 <geist> as projects gets bigger, and more people are added to it there's a multiplicative effect that happens there
02:38:08 <xiphias> i don't disagree, my argument falls flat there
02:38:38 <geist> i'm dealing with it a little bit with fuchsia, as things grow beyond my control and more process is added
02:38:48 <geist> which grates on me sometimes, but the process is there for good reason
02:38:55 <ronsor> Rust assumes mistakes will be made because they will eventually (it's statistics)
02:39:04 <kingoffrance> my complaint about rust is ppl who never learned/wrote C , claiming it will fix problems. maybe, maybe not, but such ppl are just parroting quotes
02:39:32 <ronsor> MYTH: Rust fixes all bugs "automagically"
02:39:32 <geist> well, that's true, and that happens everywhere
02:39:41 <ronsor> in reality, it fixes memory bugs
02:39:42 <kingoffrance> that might be small tiny fraction of people, but that is how i first heard of it
02:39:45 <xiphias> perhaps I should put it this way, C gives me the paintbrush to paint on the canvas any way I want, Rust gives me the paintbrush but shocks me every time I don't want to draw what it wants me to draw
02:39:58 <ronsor> of course if your security issue isn't related to that, it'll be an issue
02:39:58 <xiphias> er, I don't want to draw in the way it wants me to draw*
02:40:31 <xiphias> although, if i'm being fair here
02:40:39 <xiphias> there are many ways one can blow themselves up with C
02:40:42 <ybyourmom> Are you being fair tho, xiphias
02:40:51 <ybyourmom> :thinkingemoji:
02:41:00 <xiphias> i'm trying to consider the merits of both sides
02:41:31 <xiphias> I just feel like Rust micromanages me
02:42:13 <ybyourmom> Someday you'll want to be productive and things that streamline your productivity will look like more attractive tradeoffs
02:42:19 <Ameisen> At this point, I think the performance difference between the distro build and my build is due to clang
02:42:25 <ybyourmom> Until that day you'll want to be the l33thacker
02:42:30 <xiphias> ybyourmom: you can be productive in C
02:42:41 <ybyourmom> Fair enough, my bad
02:42:42 <xiphias> the language does not necessarily influence productivity, where do you get that?
02:43:29 <bcos_> If it takes you X weeks to learn a new language and become experienced with it; then that's X weeks of productivity that you've lost before you even use the language
02:44:13 <ybyourmom> Can't argue with that
02:44:28 <kingoffrance> the truth of the matter, is unix and linux and bsd all have libc. for better or worse, designed or by accident, that is the "standard". if some other OS with another language as "base" takes off, i will see a "c killer" finally
02:45:31 <kingoffrance> there may be many such languages 'already there' but momentum i have not seen any giant switch...ppl have been saying "c killer" for 30 years at least
02:45:43 <xiphias> indeed
02:46:11 <xiphias> ultimately if C were to go away, it's going to take decades probably, not counting the alleged 30 years of such sayings
02:46:16 <kingoffrance> there have been many such non-c-based OS...but hasnt hit critical mass
02:46:54 <ronsor> I am productive in C...
02:48:06 <jmp9> Now I can play with GDT/IDT and other stuff
02:48:23 <geist> yay glad we could convince you to not do the whole bios bootloader thing
02:48:33 <jmp9> :)
02:48:35 <jmp9> Thanks
02:48:36 <xiphias> :)
02:48:52 <xiphias> i'm going to increase my IRC presence and my presence here as I miss the old days
02:48:55 <jmp9> Because as my past tries it will be incompatible with new hardware
02:48:57 <xiphias> and I _finally_ have time to be active again
02:49:14 <xiphias> i'm old.
02:49:25 <geist> xiphias: ah we all get old
02:49:29 <geist> it's how it works
02:49:39 <xiphias> i've known you for almost 10 years
02:49:47 <kingoffrance> thats why when someone brought up micropython a few days/week ago, i went to see what lang it is written in :)
02:49:51 <geist> yep, and i've been here since.... 2001
02:50:05 <ronsor> micropython is C
02:50:19 <ronsor> used it on some esp8266 boards
02:50:29 <xiphias> on the agenda, I 'completed' my gameboy emulator
02:50:39 <xiphias> working on a playstation emulator now, which is yielding some good things
02:50:50 <xiphias> i.e. some real output
02:50:58 <jmp9> i'm 16 yo
02:51:01 <geist> oh neat
02:51:06 <xiphias> yes I *finally* got around to it
02:51:09 <kingoffrance> xiphias: which ps version? you need me to test on psx/ps1 :)
02:51:15 <geist> i just got a TRS-80 model 100, actually enjoying the hell out of this thing
02:51:18 <xiphias> i'm only targeting the SCPH-1001
02:51:23 <geist> and there's a fantastic emulator for windows for it
02:51:29 <xiphias> if you care, https://github.com/xiphffff/Katsura/tree/master/src/libps
02:51:32 <xiphias> I warn you, it is raw
02:51:39 <Mutabah> geist: A rust kernel? Yep.
02:51:51 <xiphias> and I'm intentionally taking a different mindset with this particular core
02:52:24 <geist> Mutabah: you should writ eup a little retrospective on it or something, if you were so inclined
02:52:27 <xiphias> write the _minimum amount of code_ to get games to work, but not necessarily do all of the 'accurate' things
02:52:31 <geist> i'm curious learning what did and didn't work for ya
02:52:40 <kingoffrance> xiphias: i misinterpreted, i thought you meant gb emulator running on psx :)
02:52:46 <xiphias> oh, no
02:52:51 <xiphias> that would be a cool project though
02:52:59 <kingoffrance> thats why i offered to test on real hw
02:53:20 <ronsor> what if we ported dolphin (wii emulator) to xbox
02:53:26 <xiphias> it would die
02:53:29 <xiphias> any other questions?
02:53:39 <jmp9> And another question. I'm not planning using user-mode, so, I can skip adding RING3 GDT entries?
02:53:48 <ronsor> nevermind
02:55:16 <geist> jmp9: yes, and loading a TSS entry
02:55:23 <xiphias> kingoffrance: *in theory*, if I had the codebase yet it would take me only a few hours to whip something up
02:55:24 <geist> you only need that stuff when you start switching rings
02:56:07 <Mutabah> geist: Well, i'm still fiddling with it
02:56:23 <Mutabah> The biggest thing that hasn't worked - My penchant for design perfection :)
02:56:46 <geist> ah. drat. what i need is a real pragmatist to sit down and really make it go
02:56:56 <geist> and then write up a report about the pain points of low level rust code
02:57:28 <kingoffrance> the real test will be when some lang gets into posix, then it will have "made it" into " "standard" OS" land
02:57:46 <xiphias> i don't know what that's supposed to mean
02:57:54 <Ameisen> port dolphin to the wii
02:58:14 <ronsor> Infinite Recursion
02:58:32 <ronsor> also POSIX is never going to add another language that isn't C
02:58:38 <ronsor> POSIX is too locked in
02:59:01 <ronsor> We'd need a radical new paradigm that transcends the current unix way of doing things
02:59:12 <kingoffrance> i guess it becomes "when some other lang starts there own posix" (the nice thing...so many to choose from -- tanenbaum
02:59:14 <geist> we're kinda trying to do that with Fuchsia
02:59:18 <geist> as in posix is not the goal at all
02:59:35 <xiphias> you won't have a compatibility layer?
02:59:35 <ronsor> yeah Fuchsia fits that well
02:59:47 <xiphias> well, that would probably be more trouble than it's worth
02:59:59 <ronsor> though POSIX has so much inertia that someone will make a compatibility layer
03:00:09 <ronsor> Windows got cygwin
03:00:25 <geist> that's possible, and it's certainly an acceptable thing to do
03:00:34 <xiphias> yeah but cygwin sucks :(
03:00:53 <xiphias> mingw forever
03:01:10 <ronsor> cygwin's job is to be a POSIX layer
03:01:14 <ronsor> mingw is different
03:01:19 <ronsor> it builds native win32 binaries
03:01:36 <xiphias> are we not th-
03:01:43 <xiphias> oh. yeah, you're right.
03:02:43 <xiphias> for a good long time I used MSVC because the debugger is simply top notch
03:02:59 <xiphias> then I quickly realized it's MSVC and the code generated probably pales in comparison to gcc
03:09:09 <froggey> geist: anything specific you're interested in wrt low-level rust?
03:10:10 <froggey> biggest issues for me were intrusive data structures not playing well with the type system (have to poke a bunch of ugly holes in my nice interfaces)
03:10:25 <froggey> and the lack of failable allocation support in the collections library (vector fails to allocate? better panic!)
03:18:29 <jmp9> I have trouble with this picture
03:18:38 <jmp9> https://wiki.osdev.org/images/6/68/Gdt_bits_fixed.png
03:18:44 <jmp9> flags field
03:18:49 <jmp9> what means 7 to 4?
03:18:58 <jmp9> ouw
03:19:00 <jmp9> no problem
03:19:15 <klange> bit offsets
03:19:20 <geist> yes
03:34:37 <kingoffrance> i have no idea if it is part of e.g. rust goals, but if "reduce bloat" is one of them, that would sway me. i havent heard of any of these new languages targetting that, but could just be uninformed
03:35:47 <ashkitten> depends what you define as bloat
03:36:00 <klange> anything I didn't write is bloat
03:36:23 <ashkitten> sounds like you want assembler
03:36:48 <klange> nah, I'm fine with C... I'll get this compiler project off the ground eventually
03:38:36 <ashkitten> like, if you don't want to have the lang insert checks and stuff for you, if you wanna reimplement all the standard library functions you want to use... be my guest, but that's not what high level languages are about
03:40:20 <Ameisen> is the compiler allowed to elide "if (a == b) return a;" if a and b are pointers marked __restrict?
03:40:34 <klange> probably
03:40:48 <Ameisen> My thinking is that, strictly speaking, the pointer values could be equal, technically, while they might still possible not alias, because of how lax the specs are for what an address is.
03:40:59 <klange> write some code and run it through the explorer
03:41:11 <Ameisen> well, whether the compiler DOES or not, I'm curious if the spec allows it.
03:42:19 <klange> ashkitten: i've gotten along just fine so far
03:43:22 <ashkitten> klange: i also don't see why you had to respond to my reply to kingoffrance, which i'm only realizing now
03:43:49 <ashkitten> your nicks are the same color in my client
03:44:18 <klange> because this is an IRC channel and you are speaking to everyone
03:44:47 <froggey> Ameisen: are __restrict pointers allowed to be null? if so, that seems like it'd prevent the compiler from eliding the check
03:44:55 <jmp9> okay guys, my GDT seems not work. How can I detect bug
03:44:57 <jmp9> ?
03:45:17 <geist> welcome to osdev
03:45:22 <ashkitten> klange: obviously what i'm saying doesn't apply to you, since you're "fine with c"
03:45:24 <ashkitten> lol
03:45:26 <geist> step 1: try to reproduce it on an emulator
03:45:43 <jmp9> i'm using qemu
03:57:11 <mrvn> Ameisen: My reading is that restrict pointers can never be equal unless they are nullptr. And nothing in the text for restrict says they may not be nullptr.
03:57:22 <jmp9> Hey guys
03:57:40 <jmp9> What is FLAGS field in gdt entry?
03:57:47 <klange> flags
03:57:57 <jmp9> https://wiki.osdev.org/images/6/68/Gdt_bits_fixed.png
03:58:07 <jmp9> what value (for example) will be valid
03:58:19 <geist> this is where you're going to need to invest in downloading the intel and/or amd manual
03:58:25 <geist> it'll have the full details of precisely what all of that is
03:58:25 <jmp9> i can get it because on picture we see that flags goes from 7 to 4 bit
03:58:27 <geist> and it's complicated
03:58:31 <jmp9> but flags field is 4 bit wide
03:58:42 <geist> yes. that's 4 bits
03:58:49 <geist> bit 4, bit 5, bit 6, bit 7
03:58:57 <klange> I think we have perfectly accessible descriptions of the flags field on the wiki, no need to pick up the bibles.
03:59:11 <klys> jmp9, 32-bit gdt? my sample gdt is as fillows: gdt: dw 0x0048,gdt ,0x0000,0x0000; dw 0xffff,0x0000,0x9a00,0x008f; dw 0xffff,0x0000,0x9200,0x008f
03:59:47 <klys> jmp9, that's cs at 8 and ds at 0x10.
03:59:50 <geist> so in that case the 7 to 4 is inclusive
04:02:14 <klys> jmp9, here's gdtr: gdtr: dw 0x0048,gdt,0x0000; and I load it like so: o32 lgdt [gdtr]
04:04:25 <geist> klange: but but you have to dig through the intel manual as a rite of passage!
04:04:46 <geist> i printed the intel manual when i was in college and kept it in a bunch of 3 ring binders!
04:05:12 <klys> remember retf will take a 32-bit segment and 32-bit offset: push dword 8; push dword pmodepoint; o32 retf
04:06:18 <geist> yah i like retf as a way to do a long call
04:06:37 <klys> yeah I used to have a hardcopy of the i386 manual too, intel sent it in the mail.
04:06:37 <geist> always works, very simple. much easier than trying to decode precisely how to get your assembler to generate a cs segment override
04:07:18 <mrvn> geist: the other way is to just insert the bytes for the right opcode.
04:08:28 <kingoffrance> ashkitten: it may be artifact of how people write apps/etc. more than languages, however i have not seen any modern language even admit there is a problem
04:08:40 <kingoffrance> that is more offputting than anything
04:08:48 <ashkitten> kingoffrance: what problem?
04:08:56 <ashkitten> we've got lots of problems
04:09:00 <jmp9> #define GDT_FLAGS_GR (1<<4)
04:09:06 <kingoffrance> ashkitten: bloat problem
04:09:08 <jmp9> #define GDT_FLAGS_SZ (1<<3)
04:09:11 <jmp9> is it right?
04:09:17 <ashkitten> kingoffrance: what bloat problem?
04:09:22 <jmp9> oh damn
04:09:24 <jmp9> i figured problem
04:09:25 <geist> mrvn: sure, tat's what i've done in the past
04:09:52 <jmp9> And
04:09:55 <jmp9> Everything works!
04:10:14 <mrvn> geist: given how often I've seen it I'm not even sure GNU AS can generate the cs override long jump.
04:10:19 <kingoffrance> ashkitten: well its fine it is subjective im not going to argue with you "theres a war going on between those who say thre is a war and those who say there isnt" i am on the side there is a problem
04:10:28 <jmp9> cs 0x8 8
04:10:36 <jmp9> ds 0x10 16
04:10:38 <jmp9> oh vey
04:11:55 <jmp9> It's very easy
04:12:27 <mrvn> kingoffrance: C code hasn't really changed in the last 20 years in any bloaty way. Still apps and libs are now magnitudes larger. It's not a language problem.
04:12:48 <ashkitten> kingoffrance: dynamic linking is big overhead, glibc is unecessarily large, etc. as a demoscener i don't disagree that a lot of things cause overhead, but i wouldn't say it's the languages' fault, it's just an artifact of how we write code these days, especially in portable and efficient ways
04:14:06 <mrvn> ashkitten: dynamic linking is only such a big overhead on x86
04:14:20 <klys> ashkitten, have you worked with opengl
04:14:56 <ashkitten> mrvn: that may be true, i mostly work with x86 because it's fun to dick around with hand optimization
04:15:01 <ashkitten> klys: yes
04:15:16 <mrvn> ashkitten: wasted effort. Go and get an x86_64 cpu.
04:15:21 <klys> ashkitten, pls describe a little
04:16:04 <ashkitten> mrvn: lol i have an x86_64 cpu, i mainly write 32 bit demos because there's less addressing overhead
04:16:13 <ashkitten> klys: what do you mean
04:16:16 <mrvn> ashkitten: ever tried x32?
04:16:44 <ashkitten> mrvn: nope
04:16:50 <geist> protip: you probably wont skool a demoscener
04:17:00 <klys> ashkitten, have you done some opengl with certain graphics libs, cards, or kernel(s), that made an impact on your understanding of drm?
04:17:35 <mrvn> ashkitten: all the nice registers of x86_64 without the 64bit pointer overhead. should suite you.
04:18:03 <ashkitten> klys: i haven't really explored much since most of the code is just setting up to draw shaders on a single quad
04:18:22 <ashkitten> mrvn: i'm aware of what x86_64 is, thanks
04:18:33 <ashkitten> oh you mean x32
04:19:18 <ashkitten> interesting
04:19:22 <jmp9> what difference between interrupt gate and trap gate?
04:19:43 <mrvn> jmp9: none, both are obsolete and don't work in 64bit mode. :)
04:20:00 <klys> harsh
04:20:02 <mrvn> jmp9: in 32bit mode one is for interrupts and one for traps
04:20:14 <jmp9> haha
04:20:17 <jmp9> what is a trap
04:20:39 <mrvn> exceptions
04:21:16 <mrvn> don't you need a trap gate for double fault in 32bit mode?
04:21:33 <jmp9> it's like zero division exception?
04:21:51 <klys> https://wiki.osdev.org/Interrupt_Descriptor_Table#I386_Trap_Gate
04:21:57 <jmp9> oh yes I was here
04:22:44 <jmp9> which type I must use for IRQ? Interrupt?
04:22:50 <klys> yes
04:23:25 <jmp9> oh nice
04:23:31 <klys> and it will cli for your handler
04:23:31 <jmp9> i have 30 mins to make interrupts working
04:24:05 <jmp9> yes i heard that when interrupt happens no one can interrupt us
04:24:20 <mrvn> jmp9: what do you think you need to interrupts? Interrupt gates or trap gates?
04:24:47 <klys> trap gates can be interrupted.
04:24:54 <jmp9> for interrupts is interrupt gate, for exceptions trap gaters
04:24:56 <jmp9> gates
04:25:11 <jmp9> but there is no difference between exception and interrupt
04:25:12 <jmp9> ?
04:26:46 <mrvn> I'm always confused about what will happen when you call an excpetion using an interrupt or vice versa.
04:27:04 <mrvn> jmp9: "Trap and Interrupt gates are similar, and their descriptors are structurally the same, they differ only in the "type" field. The difference is that for interrupt gates, interrupts are automatically disabled upon entry and reenabled upon IRET which restores the saved EFLAGS."
04:27:13 <mrvn> jmp9: they are not the same
04:27:40 <jmp9> in exception can happen another exception?
04:27:47 <jmp9> exception handler
04:27:52 <mrvn> jmp9: sure.
04:28:17 <jmp9> that's not good
04:28:51 <mrvn> The throwing of an exception can even cause an exception, in which case you get a double fault. If that also fails you get a tripple fault, which resets the system.
04:46:47 <bcos_> mrvn: If you try to start an exception with a software interrupt ("int n") then hopefully you set the DPL field right so it causes a real general protection fault. If you try to do it with an IRQ then that's not possible for IO APIC or local APIC (lowest 32 vectors are reserved), but for PIC it's possible and nasty and broken (but "work-around-able" if you sniff the PIC's "in service register")
05:07:01 <Ameisen> well
05:07:04 <Ameisen> the results aren't that interesting
05:07:06 <Ameisen> https://godbolt.org/z/9MofA1
05:34:20 <jmp9> I have question
05:34:25 <jmp9> When I remapping PIC in real mode
05:34:33 <jmp9> which offset I must use for Master&Slave PICs?
05:34:48 <jmp9> and what offset means in protected mode?
05:34:51 <jmp9> offset in IDT?
05:35:12 <jmp9> huh
05:35:13 <jmp9> ?
05:36:49 <bcos_> jmp9: IRQs have numbers (called "vectors") that determine which IVT/IDT entry gets used. The value you set in master & slave PIC is the "base vector". E.g. if you set master to "base vector 32" then its IRQs will end up triggereing interrupts 32 to 39
05:37:01 <jmp9> uh
05:37:24 <jmp9> because I saw "offset" word, not an "vector" in osdev example
05:37:27 <jmp9> and I get confused
05:37:33 <jmp9> Thanks
05:37:44 <bcos_> :-)
05:39:29 <jmp9> keyboard irq doesn't work
05:39:35 <jmp9> I remapped pic and unmasked irq #1
05:39:50 <jmp9> and installed handler on int 0x21 (i remapped master pic to 0x20)
05:40:42 <jmp9> oh
05:40:47 <jmp9> i forgot sti :D
05:44:01 <bcos_> Heh :-)
05:45:07 <jess3jane> q
05:45:12 <jess3jane> oops lol
05:45:29 <jmp9> i make GDT and IDT working in one night
05:45:41 <jmp9> just 2 hours
05:50:14 <kingoffrance> lots of complaints i read online are needing one function pulls in a giant dynamic lib == bloat. that tells me even dynlibs are not the problem per se, perhaps people dont split them fine grained enough into smaller libraries
05:50:34 <kingoffrance> ie laziness is the true culprit
05:50:59 <clever> kingoffrance: static linking and dead code elimination can deal with that bloat
05:54:40 <clever> kingoffrance: avr-libc makes use of both, to keep the firmware images small
05:55:14 <clever> and because of how well it optimizes, ive noticed the size spike massively just by adding a single printf to my code (because it was previously eliminating that code)
07:07:37 <immibis> https://xkcd.com/2044/
07:08:45 <klys> .theo
07:08:45 <glenda> Most people are not capable of writing good patches, so it would be unprofessional to ask such people to write patches.
07:25:11 <immibis> .theo
07:25:11 <glenda> Around here, you come off like a dick who didn't help everyone.
07:38:39 <lsneff> Hey y'all
07:39:12 <lsneff> Can I convince my os to signal on an unaligned atomic memory access, but not a nonatomic memory access?
07:48:05 <bcos_> lsneff: Depends - what kind of CPU?
07:48:14 <lsneff> Say, x86_64
07:48:26 <bcos_> Then, yes, if you want
07:49:11 <lsneff> Do misaligned atomic accesses generate an exception on x86_64 cpus?
07:49:32 <bcos_> (you'd enable the "alignment check exception" feature to get an exception for any misaligned memory access, then the exception handler would examine the code at RIP to determine if it was atomic or not, and send a signal if it was atomic)
07:50:18 <lsneff> Does linux support doing that?
07:50:50 <bcos_> (if the misaligned memory access wasn't an atomic you'd enable the "trap on single step" and disable alignment check, so you can execute one instruction and then re-enable the alignment check)
07:51:44 <bcos_> I doubt Linux supports it; although there was some funky stuff for reverse engineering drivers at one point that might be "bendable to your purpose"
07:52:41 <lsneff> Ah, hmm. It's a requirement for a runtime implementation I'm writing and I'm trying to avoid having to emit alignment check branches when emitting atomic instructions.
07:54:31 <bcos_> Standard practice is to design compiler to ensure nothing is misaligned in the first place..
07:55:13 <lsneff> Ideally, yes, but the spec specifies that unaligned nonatomic memory access don't trap and unaligned atomic memory access do trap.
07:55:16 <bcos_> (for some CPUs misaligned memory accesses aren't supported/possible, and for other CPUs it's a performance problem)
07:55:43 <bcos_> lsneff: Who wrote the spec, and can you punch them in the face until they change the spec?
07:55:49 <doug16k> it might be possible to setup a performance counter to interrupt on overflow to trap that, if there is a counter for it
07:55:57 <lsneff> It's webassembly
07:56:52 <bcos_> Wouldn't WASM have a JITter that can auto-insert alignment checks to atomic thingies?
07:57:09 <lsneff> well said
07:57:16 <lsneff> I'm writing an aot compiler for it.
07:57:31 <lsneff> Or, rather, I'm using an existing compiler and writing a runtime on top of that
07:58:22 <bcos_> ..wait - does WASM even have atomics?
07:58:34 <lsneff> It does now, yeah.
07:59:24 <bcos_> Hrm - OK
07:59:50 <bcos_> Same principle though - AOT compiler (or library?) can also insert alignment checks before atomics
08:00:14 <bcos_> ..which you're trying to avoid
08:00:26 <lsneff> Yes, that's what I'm going to have to do, but yeah, I want to avoid the overhead of extra branches.
08:00:31 <bcos_> ..but are likely to be much faster than other alternatives
08:00:37 <lsneff> Fair enough
08:01:13 <lsneff> Actually, speaking of, on x86_64, I won't have to use atomic instructions if they're aligned
08:01:17 <bcos_> (for something like "if(!aligned) { .." you'd expect CPU's branch predictor to always predict "not taken" so the branch ends up being virtually free)
08:01:40 <lsneff> As long as there isn't a jmp in the hot path, it'll be fine I guess.
08:02:26 <bcos_> If there's multiple CPUs involved you will need atomic instructions (but if it's "single CPU, multiple threads" you probably won't maybe)
08:03:11 <lsneff> Aren't aligned integer writes/reads guaranteed atomic on x86_64?
08:03:34 <bcos_> Yes, writes/reads are atomic, but something like "foo++;" is not
08:03:54 <lsneff> Ah, yeah, I'll just emit atomic instructions for other operations
08:03:54 <bcos_> There's a pile of cases where you want an atomic "read, modify then write"
08:04:16 <lsneff> wasm has instructions for all those various atomic instructions
08:05:54 <lsneff> Oh, the other interesting thing is that wasm has two instructions for basically a futex.
08:06:09 <lsneff> It waits on a memory location, and then notifies other waiters on that location
08:06:33 <bcos_> It's.. They could have a single instruction to display an entire HTML page if they wanted
08:06:48 <lsneff> Haha, yep
08:06:57 <lsneff> I mean, it's one instruction to wait and one instruction to notify.
08:07:07 <lsneff> So, not overly complicated.
08:08:01 <bcos_> Sounds racey (in an "Ooops, notification happened before I waited" way)
08:08:30 <lsneff> Just as racey as a futex
08:10:44 <lsneff> There are problems with wasm, but as a whole, I think it's a good thing
08:12:26 <bcos_> ;-)
08:12:50 <lsneff> Thanks for your help :)
08:12:51 * bcos_ is going in the opposite direction - increasing the use of run-time generated native machine code
08:13:54 * lsneff is wondering how using run-time generated machine code is different from using a wasm compiler
08:14:38 <bcos_> There's no compiling to start with...
08:14:55 <clever> i think modern android will translate the dalvki to native-arm, at install time
08:15:00 <lsneff> What are you generating it from then?
08:16:45 <bcos_> Last time it was a software graphics rendering thing that selected hand crafted snippets and pasted them together, then modified a few "constants" to create a function customised at run-time for the specific resolution, bits per pixel and colour space that the video card was using
08:17:38 <bcos_> Since then I've been thinking of things like auto-patching everywhere during kernel initialisation to eliminate all kinds of branches
08:17:53 <lsneff> Oh, that's very cool!
08:18:11 <lsneff> Patching running code will not make the instruction cache happy
08:18:24 <geist> you sort of need to do it once in that case
08:18:35 <geist> if anything because you want to map the kernel as R_X
08:18:38 <geist> but sure
08:19:11 <lsneff> Hi geist
08:19:25 <geist> hola
08:20:16 <lsneff> How's fuchsia going?
08:24:18 * bcos_ suspects Fuchsia is going well, given that (apparently) they got Andriod app support working last month
08:24:43 <lsneff> Ah, didn't hear about that, very nice
08:24:56 <bcos_> - can't be too much left before Google can ditch Andriod and switch smartphones over to Fuschia
08:25:10 <lsneff> I'd be all for that.
08:25:13 * geist neither confirms nor denies any of that
08:26:12 <lsneff> It'll be delightful to finally have a mainstream microkernel-based os
08:26:39 <bcos_> Yes - would also be nice to have something designed this century
08:26:51 * lsneff agrees
08:27:09 <geist> hopefully we can pull it off
08:27:35 <lsneff> I suppose I'll have to buy the pixel 4 or whatever it ends up being
08:28:11 <ashkitten> nobody should ever let me write anything that's not a demo because i'll always make ridiculous decisions
08:29:01 <ashkitten> that's not strictly true but it's hard as hell to switch between demo brain and normalcode brain
08:29:14 <geist> it's consumed 3 years of my life and i'm going grey over it, so it dang well better do well
08:29:37 <lsneff> We're all rooting for you
08:30:20 <klange> geist: i'd love to help
08:30:36 * geist would love help
08:34:52 * bcos_ is thinking that 2020 would be an awesome release date for marketting - just imagine things like "Google's 2020 vision"
08:37:37 <lsneff> Will it be ready then? That's not much time to polish everything.
08:57:34 <ashkitten> hng, i have Ideas for demos but i won't have a laptop for at least a week still
08:58:02 <ashkitten> fuchsia sounds cool btw
09:09:58 <ashkitten> what if i wrote a commodore 64 demo that depended on precise timing to display an image by changing the palette for each pixel
09:10:06 <ashkitten> thatd be pretty fucked up
09:10:27 <ashkitten> oh no, now i wanna do it
09:18:16 <geist> cga demo!
09:20:34 <ashkitten> yeah, but in a really convoluted way :3
09:21:10 <ashkitten> i'd pretty much be doing what the hardware/firmware is already doing, but in software
09:22:43 <ashkitten> i don't have a crt or a c64 tho
09:22:51 <ashkitten> so i'll save that for later i think
09:23:39 <geist> ya i'm wathing 8088 MPH again
09:24:15 <ashkitten> gonna be getting a new laptop soon as well as an older one just for demo testing, plus some floppies, cds, and dvds!
09:24:27 <geist> woot
09:24:30 <ashkitten> excite :3
09:24:52 <klys> did you know a db9 gender changer has the following pinout:
09:24:55 <klys> 1-5 2-4 3-3 4-2 5-1 6-9 7-8 8-7 9-6
09:26:40 <ashkitten> i will never be able to read that right the first time will i
10:20:34 <knebulae> @klys: who said hardware engineers don't have a sense of humor.
10:36:02 <immibis> lsneff: isn't OSX a mainstream microkernel-based OS?
10:36:29 <lkurusa> it's a hybrid kernel
10:36:41 <lkurusa> based on mach and BSD
10:36:43 <nyc> I thought it was FBSD.
10:36:56 <immibis> also don't forget the long tail of android apps
10:37:11 <nyc> Ah, they snuck Mach in while I wasn't looking.
10:37:44 <immibis> getting 1% of Platform X apps to work on Platform Y is pretty trivial (it's a bit of a grind but you can do it). getting 50%, a longer grind. getting 95 or 99%? you may spend years working out all the undocumented quirks that your apps are relying on
10:38:06 <lkurusa> you'd be a great BSD ports developer ;-)
10:43:06 <clever> lkurusa: something i discovered about darwin, is that it has both BSD and mach syscalls, one of them just uses negative its for the syscall#
10:43:18 <ashkitten> oh my fuck im dying i havent laughed this hard un months https://cdn.discordapp.com/attachments/269448132205608961/542292447775162368/264b498a6ed37f85.png
10:43:31 <ashkitten> OHMFUCK
10:43:34 <ashkitten> WRONG CHATNEL
10:44:04 <lkurusa> clever: i believe that's correct
10:44:40 <lkurusa> I can't go into details, though, but i believe there's an open source version somewhere
10:45:45 <immibis> actually I was working on a DildOS, now I know not to buy one from amazon :P jk
10:45:57 <ashkitten> lmao
10:46:10 <lkurusa> oh noes :D
10:46:42 <ashkitten> i think i heard about dildOS
10:46:47 <immibis> lkurusa: isn't darwin open source?
10:47:00 <lkurusa> opensource.apple.com/
10:47:02 <immibis> https://github.com/apple/darwin-xnu
10:47:27 <nyc> So that's what all the drivers for the USB vibrators were for.
10:48:08 <immibis> nyc: force feedback?
10:49:08 <nyc> Immibis: It must be.
10:49:44 <ashkitten> glad this channel is full of mature adults, unlike some other places i'd never live this down
10:50:33 <ashkitten> wait but why would you want a usb vibrator? i feel like that's just asking for trouble
10:50:46 <ashkitten> wireless, totally 100%
10:51:32 <painted_> usb means you never run out of juice
10:51:38 <immibis> I have no clue, but if there's a something labeled as a USB vibrator driver, it's probably something to do with game controllers
10:51:42 <painted_> which is this context means battery
10:52:01 <nyc> Joysticks have vibrators. I think electric toothbrushes in Japan, too.
10:52:14 <ashkitten> oh, not that kind of vibrator
10:52:38 <immibis> yes but you wouldn't have a USB electric toothbrush. Phones have vibrators, surely at least one is using USB internally
10:53:07 <ashkitten> would also be weird to need a special driver for your vibe, surely it'd just use hid or something yeah?
10:53:14 <clever> immibis: phones tend to have a lot more GPIO
10:54:49 <nyc> Most of it is battery and probably weaker vibrators than used for sex toys.
10:55:25 <immibis> nyc: there's https://github.com/torvalds/linux/blob/master/drivers/usb/misc/trancevibrator.c and as expected, it's a game controller
10:55:47 <clever> i saw a defcon talk a few years ago, about the poor security in sex-toys
10:55:49 <immibis> oh maybe not. I googled it :P
10:56:03 <clever> there was things like a vibrator, that your partner can control, over the internet
10:56:05 <immibis> I just saw PlayStation 2 and assumed it was a controller related thing
10:56:26 <clever> and general stupidity, like sequential userid's and allowing you to view peoples profile if you just know their id#
10:56:48 <nyc> This is all stunning.
10:57:06 <ashkitten> clever: i was gonna try to build my own personal thing like that, i suppose it'd be more secure as i'd be manually distributing tokens
10:57:17 <ashkitten> i think i saw that talk tho
10:57:57 <clever> https://www.youtube.com/watch?v=9Z3PomQpHOs i think was the talk
10:59:02 <nyc> clever: Wow, it's tough to imagine how someone would come up with things that insecure.
10:59:02 <ashkitten> i feel like most people using a service like that would feel very poorly toward a company if they found out that related information could be stolen
10:59:46 <immibis> nyc: haven't watched it but in general, I think a lot of things are insecure because nobody gives a fuck
10:59:48 <immibis> if it works, ship it
10:59:57 <clever> some malicious ideas i have, is to just walk into a large room, then fire up a mitm attack against the control server
11:00:02 <immibis> "why are you saying not to ship it? it works doesn't it?"
11:00:05 <clever> and see how many people jump when you set the vibrator to 100%
11:00:28 <clever> i think the talk mentioned a lack of ssl on most of them
11:01:05 <ashkitten> there was a talk sorta relatedly about so-called smart locks
11:01:13 <nyc> Immibis: Well, sure, but how do they even imagine things so insecure?
11:01:31 <immibis> nyc: nobody imagines security or insecurity. that's not something you imagine. unless you're trying to break something
11:01:54 <immibis> I remember a smart lock with no security in the actual lock part. You could open it with a screwdriver.
11:02:16 <clever> i saw a few defcon talks about electronic locks
11:02:31 <clever> one of them, allowed you to push the buttons for reprogramming (with a paperclip) while its locked
11:02:42 <clever> so you can just add more fingerprints to it, by poking thru a crack and hitting the button
11:02:50 <ashkitten> there was a lock.. august iirc it was called? that basically relied on factory keys and poor encryption. if you gave someone partial access, you could assume they would have permanent full access that couldn't be revoked even through a full reset of the lock
11:08:05 <clever> immibis: yeah, you could use an electromagnet on a metal shim, that simulates a swipe
11:08:15 <clever> immibis: and then just jam it in the reader, and simulate a few 1000 cards
11:08:39 <immibis> you have 6554 swipes, assuming you can get maybe 10 swipes per second, it's still over 10 minutes
11:08:43 <clever> immibis: some locks also have a service port on the bottom, that is serial
11:08:49 <clever> the service port allows reading all ram in the device
11:08:52 <immibis> only half that if it's +/- 10, actually
11:08:54 <clever> which tells you what the 16bit code is
11:09:03 <clever> it also allows you to just open the door :P
11:09:37 <clever> https://hackaday.com/2012/07/25/arduino-resistor-and-barrel-plug-lay-waste-to-millions-of-hotel-locks/
11:09:39 <immibis> for bonus points, find ones that have beepers, and reprogram all the door locks so they play a little jingle at random times of the day
11:09:42 <clever> https://hackaday.com/2012/11/29/burglar-suspected-of-using-arduino-onity-hack-to-rob-hotel-rooms/
11:10:00 <ashkitten> hotels are moving to chip cards tho, yeah?
11:10:15 <clever> a few hotels ive been to recently use rfid
11:10:29 <clever> https://hackaday.com/2012/10/02/dry-erase-marker-opens-all-hotel-room-doors/
11:11:22 <nyc> That's relatively stunning.
11:11:48 <clever> "Onity released a free hardware patch for their locks: actually a ‘patch’ of metal which fits inside the casing and covers the jack.."
11:12:00 <clever> (facepalm)
11:12:06 <immibis> you are only relatively stunned?
11:12:24 <ashkitten> i'm not surprised at all tbh
11:12:40 <nyc> Dry erase markers are pretty bad.
11:12:57 <clever> immibis: correction, the 1st link says they are 32bit codes
11:13:07 <clever> "It takes approximately 200 milliseconds from the time an attacker plugs the device in, until the door can be opened. Yes, in less than 1/4 of one second an Arduino can open any of the millions of these locks in service."
11:13:17 <clever> immibis: it still unlocks in an insanely short time :P
11:13:45 <klange> Sounds like no lockout time.
11:14:19 <clever> klange: its a service port, that lets you read all ram, and i think even write to GPIO ports
11:14:21 <ashkitten> clever: i was watching one of deviant ollam's talks on physical pentesting, he said something about one lock which had been notoriously easy to crack open by just jamming a thin piece of metal in and popping it apart.. the solution the company gave was quite similar, i believe he said that newer versions of the lock just have a piece of metal in the way (which doesn't help at all)
11:14:52 <klange> Oof. Sounds like electronic lock 101 to me.
11:15:25 <clever> ashkitten: ive also seen a number of talks about pentesting buildings
11:15:34 <clever> for example, "exit only" doors have a motion sensor to unlock it
11:15:35 <lkurusa> tabs suck
11:15:49 <clever> one blast of compressed air thru the crack in the door, and a cloud of cold air trips the sensor
11:15:50 <lkurusa> i hate this mess so mcuh
11:15:52 <ashkitten> oh yeah, i also saw that
11:15:53 <clever> and it unlocks the door :P
11:15:56 <ashkitten> ha
11:16:13 <clever> another building had an "exit only" elevator that "can only go down" (the up button was disabled in software)
11:16:17 <clever> and it led to an unlocked door
11:16:24 <klys> i used to dream of implementing 8-space tab stops in an editor i would write in gw-basic, when i was 14
11:16:28 <clever> you can buy elevator maintance keys on ebay
11:16:36 <clever> 2 seconds, and the elevator can go up
11:18:21 <immibis> I remember the part where he pointed out that nobody in the building realised the absurdity of "this elevator only goes down"
11:19:26 <clever> immibis: yeah, that part was great
11:19:40 <clever> other fun parts, the key for state X can only be bought with a proper license
11:19:42 <ashkitten> "only allowed people can get in" - oh yeah, what if i pretend to be one of those?
11:19:47 <nyc> Just wait for someone else to call it up even if you can't press the buttons for floors above.
11:19:49 <clever> but the key for state Y can be freely bought by anybody
11:19:55 <clever> (both states use the same key.....)
11:20:44 <ashkitten> nyc: yeah exactly
11:21:11 <ashkitten> if you have a clipboard and a hard hat, you can get through anything
11:22:29 <clever> there was one place where the guy tried that, and was correctly refused entry
11:22:49 <ashkitten> good on that one place
11:22:56 <ashkitten> everyone else is fucked
11:23:24 <clever> i also saw a reddit blog post, about a company that wanted to see how bad it is, if the attacker already got in, what can they do?
11:23:39 <clever> so they brought him into the building, said he was a new hire, gave him a desk&pc, and a login
11:24:11 <ashkitten> oops, new ceo?
11:24:17 <clever> after a while of poking away, he found an exploit in a windows service, that could run things as admin, but didnt want to run it on his own machine, because it could be traced back to him
11:24:22 <clever> so he ran it on accounting
11:24:30 <clever> 5 mins after triggering, IT showed up
11:24:39 <clever> "accounting doesnt use powershell, it triggered a red flag"
11:25:16 <clever> ah, found the link: https://www.reddit.com/r/netsec/comments/9xxurx/taking_down_an_insider_threat_story_of_a_failed/
11:25:35 <ashkitten> hot damn
11:25:41 <ashkitten> they've got their shit together huh
11:25:53 <clever> yeah
11:26:02 <nyc> The whole UNIX password authentication model could probably stand to be replaced.
11:26:13 <clever> the blog goes into depth on everything they block, and what you would normally think to check
11:30:16 <nyc> I think someone said that if a typical person can remember a password, it's not secure enough.
11:30:49 <nyc> The privilege structure on UNIX is shite, too.
11:30:52 <clever> usb dongles for all!
11:31:13 <clever> nyc: ive seen configs for openssh, that let it tie into google authenticator, for one-time codes
11:31:49 <clever> ive also seen mistakes in said ssh config, that cause it to ignore the pw entirely, and rely just on the one-time pin
11:31:50 <nyc> clever: Multiple factor biometric authentication seems more plausible.
11:32:45 <lkurusa> what you can't change shouldn't be a password at all
11:37:00 <nyc> I'm sure there's an argument for that somewhere.
11:40:33 <nyc> It's probably uncontroversial that superusers that can do everything as the only difference in privilege is a bad idea.
11:44:43 <knebulae> @nyc: an argument can certainly be made that a "system" context is also different from an "administrative" context; just spare me the turing-complete ACLs in NT (this is a joke).
11:45:21 <clever> knebulae: consolekit on linux links against scriptmonkey, because the policy rules are written in javascript
11:45:39 <knebulae> @clever: that's actually a great idea
11:46:13 <clever> its at least better then inventing your own turring complete language
11:46:14 <nyc> clever: That's impressively deranged.
11:47:29 <ashkitten> clever: damn, i just finished reading the thread.. damn
11:48:05 <nyc> One would probably not want to actually be Turing complete.
11:48:24 <clever> nyc: its up to the system admin to modify them (if they ever change them at all)
11:48:33 <clever> so its their own fault if they put an infinite loop in it :P
11:48:43 <clever> i would expect it to just be if statements 99% of the time
11:49:09 <ashkitten> that was a wild story
11:51:00 <ashkitten> i don't even use full disk encryption on my own machines lmfao
11:51:07 <ashkitten> i'm awful
11:51:07 <nyc> clever: The language doesn't need to be Turing complete for that. A restricted terminating subset of Prolog sounds plausible to me.
11:52:02 <ashkitten> i should prooobably encrypt my drives but then i wouldn't be able to reboot the machines remotely!!
11:52:05 <nyc> I don't use disk encryption either.
11:52:22 <lkurusa> ashkitten: i think that's acceptable as long as they are not laptops :p
11:52:29 <ashkitten> which is totally a real thing i do, because i'm definitely not always home all the time >,,>
11:52:33 <lkurusa> i would never ever have a laptop or a tablet or anything that doesn't have full disk encryption
11:53:00 <lkurusa> like if they can easily steal it or i can easily leave it somewhere, that warrants encryption
11:53:01 <ashkitten> ok actually i do reboot my desktop from bed sometimes because i have back problems and can't always get up
11:53:23 <lkurusa> brb lunch
11:53:25 <clever> ashkitten: it is possible to arrange for ssh access in the initrd
11:53:31 <clever> ashkitten: then you can answer a pw prompt remotely
11:53:34 <ashkitten> huh
11:53:39 <ashkitten> interesting
11:53:40 <clever> but, for wifi in the initrd, thats harder
11:54:08 <ashkitten> yeah, luckily i do have powerline networking and don't depend on the upstairs wifi lol
11:54:50 <clever> i have proper gigabit to everything
11:54:58 <ashkitten> oof i wish
11:55:01 <nyc> The CPU overhead hits the battery hard. I've tried it before.
11:55:32 <clever> my laptop is pretty much always plugged in
11:55:38 <ashkitten> i'm poor as shit, i can't even get a decent wifi router
11:55:44 <clever> the battery is only there for suspend to ram
11:55:55 <clever> ashkitten: i'm still on G band wifi, lol
11:56:00 <ashkitten> i was using my desktop's wifi card as a hotspot for a while
11:56:39 <ashkitten> that was awful, didnt even reach my bedroom
11:56:53 <nyc> I'm not going to get into the depths of my poverty.
11:57:06 <ashkitten> extremely valid
11:59:27 <nyc> I'm hoping to eventually be able to bolt my laptop back together. And replace its fans.
11:59:40 <ashkitten> good luck with that!
12:00:17 <ashkitten> i had to go to a friend when my laptop finally broke down.. got a perfectly working desktop that i can't use regularly because of my back
12:00:49 <ashkitten> luckily i've got friends in ever so slightly better situations than me
12:01:50 <nyc> Things have been rough enough for long enough that there aren't any left here.
12:02:00 <ashkitten> yeah
12:02:06 <ashkitten> legit
12:05:01 <nyc> AFAICT this is my last gasp.
12:06:18 <nyc> When the laptop goes, programming and esp. kernel hacking will be forever out of my reach.
12:06:45 <clever> i did some of my first kernel hacking on a 486 laptop with an lpt port
12:06:51 <ashkitten> that's really shit yeah
12:07:02 <clever> its trivial to bit-bang an 8bit wide array of pins on the LPT port
12:07:33 <clever> modern systems have so few "simple" IO on them
12:08:29 <nyc> Personal ownership of computers was out of my reach until I was hired to do kernel hacking.
12:08:39 * ashkitten wonders if its desktop motherboard has a pc speaker header
12:09:10 * ashkitten wonders what it could drive with such a header
12:09:16 <clever> nyc: ive gotten pretty much every single one of my dads old work laptops, every time he got an upgrade
12:09:42 <ashkitten> might be able to check out an electronics recycling center?
12:09:51 <ashkitten> if that's an option
12:09:59 <nyc> Hand-me-downs are unlikely for me.
12:10:18 <clever> nyc: but that also means i was always years behind
12:10:34 <clever> the first laptop, was a grey scale LCD, no cdrom, no onboard sound, and only 20mb of ram
12:10:48 * ashkitten drools
12:11:02 <ashkitten> sorry im a demoscener lmfao
12:11:16 <nyc> Tadpoles are the real collector's items.
12:12:56 <nyc> If I can make it to 21 Sep., I'll see my 20th anniversary on Freenode. I'll likely be indisposed that week if everything goes according to plan, though.
12:13:46 <nyc> I think it was actually OpenProjects Network when I started.
12:13:50 <ashkitten> yearning for a storage medium between punch cards and floppies so i won't feel bad about using less than 1% of the space
12:14:28 <nyc> ashkitten: Paper tape FTW?
12:14:36 <ashkitten> hhhh maybe
12:15:06 <ashkitten> im gonna need to look into how to read and write some of these things tho
12:15:20 <ashkitten> i was honestly looking at magstripes for a while but too small
12:15:34 <ashkitten> also expensive to write
12:15:57 <ashkitten> and i'm not sure the readers would let you do arbitrary things with the data easily
12:16:08 <nyc> ashkitten: I think OS/390 still has backward compatibility code for booting off of punch cards.
12:16:17 <ashkitten> hhhhh
12:17:05 <ashkitten> wait who runs os/390 tho
12:17:16 <nyc> ashkitten: The Hercules emulator might have enough docs to write your own thing that boots off of punch cards.
12:17:17 <FireFly> mmm demoscene stuff
12:17:31 <ashkitten> it's good shit huh, FireFly
12:17:33 <nyc> ashkitten: Mainframe users.
12:17:41 <ashkitten> thats fair i guess
12:17:58 <nyc> I have no idea about the demo scene.
12:18:05 <ashkitten> i don't know anyone who owns a mainframe lmao
12:18:29 <nyc> I think it was a PC hobbyist affair.
12:18:43 <FireFly> ashkitten: yeah.. I've been in a demo-y mood recently..
12:18:55 <ashkitten> hhh i wonder if there are punch card readers that could emulate a floppy drive
12:19:45 <ashkitten> would a modern bios time out a read if a usb floppy drive was too slow?
12:20:27 <clever> that reminds me, 2 of my older laptops had either a floppy or cdrom drive in the bay on the side
12:20:40 <clever> but when the floppy drive was external, it uses a special LPT adapter
12:20:44 <nyc> ashkitten: I know companies that IBM sold them to, but have never been directly involved with mainframe affairs.
12:20:56 <clever> then, dell finally stoped being dumb, and the floppy drive has a mini-b usb on the side
12:21:21 <ashkitten> what if me, but i have a mainframe
12:21:30 <ashkitten> lmao
12:21:47 <ashkitten> i think i'd die from overexcitement
12:21:58 <nyc> ashkitten: I'm not sure what you're trying to ask.
12:22:17 <ashkitten> "what if i had a mainframe"
12:22:38 <nyc> I used VM/ESA at IBM.
12:23:08 <ashkitten> sorry, in my circles that's just a way we talk for some reason.. "what if i had x" becomes "what if me but having x"
12:24:03 <nyc> ashkitten: They'd be very interesting to write kernels for with crossbar IO etc.
12:24:29 <ashkitten> a lot of machines would be interesting to write for tbh
12:24:56 <nyc> They're super IO shovels.
12:25:21 <ashkitten> relatedly i hope cisc never truly dies, so demosceners have architectures that are actually fun to sizecode for
12:27:11 <ashkitten> x86 is a fun arch to sizecode for, but it's awful for everything else
12:27:24 <ashkitten> it's fun because of its jankiness
12:27:39 <nyc> x86 has terrible floating point.
12:28:24 <ashkitten> that's okay, because i never use it in demos!
12:28:29 <ashkitten> :D
12:28:37 <clever> i recently ran into float problems when dealing with yaml
12:29:07 <clever> one of the fields in my yaml file had int_max (2^64), `jq` rounds it up slightly
12:29:24 <ashkitten> jq parses yaml?
12:29:27 <clever> luckily, the parser in my target program has strict parsing, and complained when the value was too large to fit inside a Word64
12:29:36 <clever> ashkitten: i first ran it thru yaml2json (which didnt damage the value)
12:29:41 <ashkitten> ahh
12:29:47 <clever> then used jq to modify 1 field, and json2yaml it backwards
12:30:00 <clever> but, jq also rounded all other numbers, to the nearest float
12:30:09 <ashkitten> gross
12:30:13 <clever> yep
12:30:18 <ashkitten> gonna report buggo?
12:31:14 <clever> probably should, but havent gotten to that yet
12:31:17 <clever> > 18446744073709552000 - 18446744073709551615
12:31:17 <clever> 0
12:31:24 <clever> the nodejs repl also claims these 2 numbers are identical
12:31:37 <ashkitten> haha, float precision
12:32:01 <ashkitten> https://haha.business
12:33:30 <jmp9> Okay guys, I got new question for you. How do I read some data from current bootable device? For example flash drive
12:33:30 <nyc> x86 also has terrible paging, task switching, power consumption, SMP, TLB structure, register pressure, reliance on stack discipline, IO, bandwidth to memory, etc.
12:33:45 <ashkitten> nyc: but it's fun to sizecode
12:33:51 <ashkitten> >:3
12:34:26 <nyc> ashkitten: That's never been a preoccupation of mine.
12:34:47 <ashkitten> nyc: indeed, for most
12:35:01 <nyc> ashkitten: Assuming I've guessed what you mean properly.
12:35:22 <ashkitten> i'm talking about hand-written assembly for demos
12:35:52 <nyc> ashkitten: Emulators can deal with it like they do for S/390.
12:36:26 <ashkitten> doing tricks like `inc cx; dec cx` instead of `cmp cx, 0` to set the zero flag in 1 less byte is my fucking JAM
12:36:43 <nyc> I cried the day I heard that x86-64 was being done.
12:38:08 <ashkitten> by all means, x86 and its extensions are awful and should never be used in practice, but they're incredibly fun to abuse for my purposes
12:38:34 <nyc> IA64 was my grand hope that the 64-bit transition would finally free the masses from the chains of x86.
12:39:04 <ashkitten> it's ok, we'll cross our noodly appendages for the rise of risc-v
12:39:59 <nyc> I'll never live to see it, and even if I lived long enough, I'd be too impoverished to.
12:40:44 <ashkitten> i hope dearly that you live prosperously to see the rise of an architecture you can appreciate
12:47:00 <nyc> I'd settle for ARM even though they're following a bit too much in x86' footsteps with hardware pagetables.
12:48:54 <nyc> MIPS was nice and minimalistic. Shame that never went anywhere and is declining even in embedded space now.
12:53:21 <ronsor> Hey I wrote a mips emulator once; the simplicity was nice
12:55:54 <nyc> It makes the hardware faster, too, though maybe not as much as fabrication processes.
12:55:55 <lkurusa> RISC-V is where i'll place my bets
12:56:04 <lkurusa> risky bet, but fingers crossed it pays off
12:56:35 <ronsor> Not too risky
12:56:44 <ronsor> since it appears to be gaining traction
12:58:10 <lkurusa> indeed, ARM also help gain it traction by releasing a full-FUD website lol
12:58:27 <lkurusa> https://www.theregister.co.uk/2018/07/10/arm_riscv_website/
12:59:34 <ronsor> no idea ARM was so sleazy
01:00:07 <lkurusa> when that was first posted to HN, i was like this can't be real and must be a parody
01:00:11 <lkurusa> but apparently it _was_ real
01:00:52 <nyc> Has it been taken down since?
01:01:12 <lkurusa> Yup
01:05:10 <nyc> I hope it has a software TLB like MIPS.
01:08:33 <nyc> I get the bad feeling that silence means it's got full x86-style hardware pagetables.
01:10:28 <lkurusa> i was afk
01:10:42 <lkurusa> i think it has a software-assisted hwtlb
01:11:02 <lkurusa> but maybe that's not architecturally defined
01:11:08 <lkurusa> and you can have your own TLB
01:11:35 <nyc> Please let it go the way of MIPS.
01:13:23 <lkurusa> wanna elabore why? :-)
01:14:17 <nyc> There are a lot of cases where you can fill the TLB from shared kernel data structures e.g. in-core file offset to physical page indices.
01:15:23 * glauxosdever would like to see some RISC-V desktops or laptops
01:16:22 <nyc> Even where you can't, there are better data structures to use than radix trees.
01:20:19 <nyc> COW mappings tend to have COW-faulted ranges that are relatively small relative to the whole mapping. So you would want to do a quick lookup of a small structure covering that range and then fall back to what's effectively a read-only shared mapping.
01:22:01 <nyc> And you can always exploit physical contiguity to render these structures shallower even in the absence of TLB entries being unable to use the physical contiguity.
01:22:59 <nyc> And on sane architectures the TLB mapping sizes are staggered at intervals that will be able to use it.
01:23:58 <nyc> B+ trees anyone?
01:41:49 <mrvn> nyc: A b+ tree would be twice the size of a radix tree since you have to store key+pointer instead of just pointers.
01:43:10 <mrvn> And you might want something more in the size of a cache line than a page for the tree node.
01:44:13 <nyc> mrvn: The usual idea is that one would have virtual and physical contiguity that would render the B+ tree substantially shallower than a radix tree.
01:45:20 <mrvn> nyc: The only difference is that a radix tree collapses around powers of 2. Which meshes well with page tables that need similar alignment.
01:47:06 <nyc> mrvn: It doesn't really collapse that quickly e.g. MIPS has powers of 4 around 4KB (or 1KB) up to 256MB. x86 has 4KB, 2MB, and sometimes 1GB.
01:47:26 <mrvn> The problem with a B+ tree is that lookup becomes O(node size * ln size).
01:47:55 <mrvn> nyc: the radix tree can collaps at any bit length. Doesn't have to match the page tables.
01:49:51 <mrvn> B+ trees are more for cases where you can't keep the tree in memory and the cost of loading a node far exceeds the cost of searching inside the node.
01:50:50 <nyc> mrvn: That translates just fine to caches and TLB's.
01:51:52 <mrvn> not so much to COW meta data
01:55:24 <nyc> mrvn: You only get the opportunity to collapse by bitslicing in a trie at the point a whole node would be used.
01:56:25 <mrvn> nyc: two leaves of size 2^n can combine to leaves of size 2^n+1 if they are buddies.
01:57:07 <mrvn> or 2^x leafs of 2^n to one of 2^n+x if the key is x bit long.
01:58:15 <nyc> You generally don't get a whole leaf node of the radix tree like that.
01:58:40 <mrvn> nyc: don't see why not. You said you have continious regions.
01:59:12 <nyc> The branching factor tends to be high enough to make it unlikely.
02:01:21 <mrvn> Just keep in mind the lookup cost of a b+ tree. If you need 8 lookups on average you can have a radix tree that is 8 times higher.
02:02:23 <mrvn> The nice thing about a radix tree is that it isn't expensive to balance.
02:02:29 <mrvn> the other ncie thing ...
02:04:16 <jmp9> 8259 PIC vs IOAPIC?
02:04:25 <mrvn> yes
02:04:51 <jmp9> Ok, I've done exceptions
02:12:54 <jmp9> What I should use to read sectors from hard drive in protected mode?
02:14:24 <mrvn> a driver for the hardware you have
02:15:14 <glauxosdever> I suggest you do memory management and scheduling first
02:17:03 <mrvn> and a ramdisk driver
02:25:55 <jmp9> My os will be singletasking
02:26:14 <jmp9> protected mode all flat memory for kernel, no user-mode
02:26:51 <klange> Has the spirit of Terry possessed you?
02:27:26 <jmp9> Yes
02:27:59 <klange> I'm sorry to hear that, means he hasn't moved on. Perhaps God thinks he has unfinished business.
02:28:09 <nyc> Who is Terry?
02:28:15 <jmp9> Terry A. Davis
02:28:29 <klange> Terry Davis is the late programmer behind TempleOS, which also went by either names in the past.
02:28:53 <glauxosdever> *was
02:28:57 <jmp9> Actually i'm inspired by Terry A. Davis. I'm creating my little os in order to make fun things in protected mode with compatibility to new hardware, to boost my asm skills
02:29:01 <nyc> That's hilarious.
02:29:05 <klange> "late" is sufficient on its own.
02:29:14 <klange> Don't need to change the tense of the copula.
02:29:15 <jmp9> Niggerlicious
02:29:21 <jmp9> ous*
02:29:37 <klange> jmp9: If you say anything similar to that again, I will remove you.
02:29:41 <nyc> wtf?
02:29:47 <mrvn> glauxosdever: was the later programmer? He no longer is late? He retroactively didn't programm it?
02:29:50 <jmp9> It's meme
02:29:55 <klange> Terry was schizophrenic and sadly passed in a train-related accident, which was likely suicide.
02:30:29 <klange> His OS project was noted for some very peculiar ideas, all inspired by his alleged interactions with God.
02:30:46 <mrvn> klange: well, God told him to.
02:31:01 <jmp9> Terry is a god-like programmer. He coded his own compiler, make C like scripting language and wrote his own bootloader and kernel from nothing
02:31:21 <jmp9> Also he's developer his own text document format, which can handle images and hyperlinks just in text or even code
02:31:41 <klange> The man literally spent all of his time on his projects.
02:31:48 <jmp9> 10 years
02:32:34 <klange> 14, and he didn't work a job at the time because he was on disability.
02:33:01 <graphitemaster> such a sad story
02:33:47 <glauxosdever> jmp9: Initially, I got inspired by MikeOS (does anyone remember that still?)
02:33:59 <glauxosdever> NOt a good paradigm either
02:34:23 <jmp9> Yes I read about MikeOS
02:35:31 <lkurusa> my inspiration was brokenthorn tutorials
02:35:44 <lkurusa> that's pretty much what got me into this (and hence my career lol)
02:36:03 <glauxosdever> lkurusa: I recall old stuff now.. I was reading those too :-)
02:36:16 <jmp9> I got into osdev by helping my friend create his Makefile to build os :)
02:36:39 <lkurusa> glauxosdever: i'm thinking i'll download them all just to have them archived lol
02:37:22 <klange> My inspiration was a college course I was denied access to.
02:38:07 <klange> Wish I could dedicate all my time to my OS; might actually manage to close the loop and get a C compiler banged out if I did.
02:39:05 <glauxosdever> klange: Now they should welcome you (and apologise for what happened)
02:39:18 <klange> lol I graduated years ago ;)
02:39:28 <glauxosdever> :-)
02:39:43 <glauxosdever> You could be a teacher there
02:40:49 <klange> That would require moving back to the middle of Illinois. I much prefer Tokyo.
02:41:18 <klange> And I don't want to be a professor of CS or EE... I want to be in the industry, making boatloads of cash, or retired.
02:41:59 <glauxosdever> Why not be a professor though?
02:42:14 <klange> Because the pay is garbage and you have to deal with college students?
02:42:56 <glauxosdever> I thought professors made more money than average? Just like doctors and lawyers?
02:44:04 <lkurusa> not in the US lol
02:44:11 <klange> You are incredibly mistaken.
02:44:40 <glauxosdever> Unless, we are not talking about university professors?
02:45:03 <glauxosdever> D'oh
02:46:00 <glauxosdever> Yep, I missed that it was a *college* course
02:47:08 <mrvn> There is a reason they say: Those that can't, teach.
02:47:29 <klange> college = university
02:47:36 <klange> american terminology
02:48:05 <klange> Tenured professors coming in from decade-long graduate research can make big bucks.
02:48:27 <klange> Someone like me would be starting form a "lecturer" position.
02:48:44 <lkurusa> associate professor, no?
02:48:53 <lkurusa> and then when you get tenure you become assistant professor
02:48:56 <lkurusa> or vice versa, i don't know
02:49:21 <lkurusa> but pay sucks until you are tenured (and it gets actually nice when you get a "named" position)
02:50:45 <klange> Adjunct -> Lecturer -> Assistant Prof -> Associate Prof -> Prof -> Distinguished Prof
02:51:24 <lkurusa> Ah
02:52:40 <klange> Some of the tenured professors and associate professors at my alma mater do make fantastic salaries, but they've been in those roles for decades now, and they're heading impressive research projects.
02:52:54 <klange> Meanwhile I can make that much in the industry shitting out webapps.
02:53:04 <klange> Thus is the paradox of academia...
02:53:32 <klange> Also I'm too young, no one would respect me as a lecturer.
02:54:14 <klange> But alas, it's nearing midnight, and unlike today I should actually go to work tomorrow...
02:55:33 <lkurusa> good night klange !
03:04:25 <nyc> I never looked into TempleOS. I thought it was just a Linux distro.
03:11:35 <clever> is the cpuid opcode typically enabled in userland?
03:12:31 <mrvn> clever: how would you disable it?
03:12:49 <clever> mrvn: more, does the CPU support disabling/restricting it?
03:13:53 <lkurusa> i don't think you can disable CPUID
03:15:00 <clever> thats a bit strange, since some VM software can limit the cpu features to a subset of what the cpu supports, to allow migration to lesser cpu's on other hosts
03:15:07 <mrvn> and how would ld.so then know which libc optimization flavour to load?
03:18:57 <mrvn> clever: interesting point. I wonder if VM software runs through the memory and replaces all CPUID occurances with a trap.
03:19:41 <clever> that could get racy with self-modifying code, and would heavily rely on non-writable execute segments
03:19:55 <clever> or setting the "wrong" bits on the real paging tables, and auditing everything when it faults
03:20:05 <mrvn> clever: the later
04:40:59 <nyc> I need to get it together and get a portfolio/whatever of my talent going before my laptop breaks down for good.
04:46:50 <klys> http://show.ing.me/paste/makefile-gnu32.txt
04:47:09 <klys> some guy from last night had me doin' my homework
04:51:07 <nyc> That's a weird way to write a makefile.
04:51:40 <klys> he wants to statically link a bunch of os calls
04:55:45 <nyc> Trying to statically link system calls seems like a misunderstanding of what system calls are.
04:56:47 <kingoffrance> re makefile s/less/$PAGER/ :/
04:57:33 <ashkitten> oh no.. i got out of bed, but i haven't been asleep that long have i
04:58:06 <nyc> ${PAGER:-less} or something like that to default to less if PAGER is unset.
04:58:34 <ashkitten> how long was i out
05:00:00 <klys> coldn't tell ye
05:00:10 <ashkitten> <4 hours, fuck
05:02:31 <nyc> PAGER?=less looks like what I'm looking for.
05:03:38 <nyc> I need to run off to get medicine.
05:04:02 <kingoffrance> its not a bad thing to not do so, but you can use make vars before "defining" them. that is the only weird thing to me, although maybe a reason for that
05:04:26 <kingoffrance> s/use make vars/refer to make vars from other vars/
05:05:24 <ashkitten> i'd guess the whole thing is evaluated before running targets?
05:05:25 <kingoffrance> i.e. you could alphabetize all those vars, or whatever, dont have to define before referencing from another var
05:05:35 <ashkitten> oh weird
05:05:56 <ashkitten> who knew make was good at dependency resolution s
05:06:09 <ashkitten> s/s//
05:06:17 <ashkitten> whatever, you know what i mean
05:07:03 <kingoffrance> well, maybe that is on purpose, but at first glance, i wonder if whoever wrote it was aware of that feature
05:07:24 <ashkitten> it's a complex feature, so yes?
05:08:49 <ashkitten> would require the same logic for dependency resolution in targets
05:09:51 <ashkitten> there's a good chance the same code is reused even, but i haven't so much as glanced at that codebase
05:10:32 <ashkitten> as in, variable assignment is just special targets
05:10:43 <ashkitten> maybe! i'm speculating!
05:11:12 <ashkitten> is how i'd do it
05:16:33 <nyc`> make is a nice example of parallel logic programming.
05:18:45 <nyc`> Autoparallelizing logic and functional language systems seem like a good idea for high-level userspace.
05:21:29 <FireFly> ashkitten: re. demoscene stuffs, do you participate in compos and stuff? :o
05:21:38 <ashkitten> ugh i wish
05:22:25 <nyc`> I'm not sold on the virtues of C even for systems programming in no small part because it's wedded to the stack discipline and calling convention.
05:22:43 <ashkitten> i'm barely surviving here, no way can i get out to like.. revision or something (i'd love to visit a friend there)
05:23:23 <ashkitten> besides, i'm shit at making cool things.. i do backend programming, my gfx look shit
05:24:50 <FireFly> ah fair
05:24:56 <ashkitten> i've got like, this.. a <256 byte demo of the dvd logo bouncing around like on a dvd player or whatever https://github.com/ashkitten/realdvd
05:25:23 <ashkitten> i wrote a brainfuck interpreter in 194 bytes
05:25:31 <FireFly> I'm plannng to revision this year, and hopefully put together some kind of demo for it
05:26:07 <nyc`> NYC isn't exactly a tech hub, but even when I was in the Bay Area, I couldn't get into anything. And besides, all the conferences have been happening outside the US entirely ever since that one guy got convicted in the early 2000's.
05:26:07 <ashkitten> my friend linked the revision invitation and i'm fucking sad i'll not be able to go
05:26:15 <FireFly> ashkitten: that's cool :o
05:26:27 <ashkitten> FireFly: what is?
05:26:49 <FireFly> the dvd demo & consise bf interpreter
05:26:59 <ashkitten> oh, thanks lol
05:27:54 <FireFly> I messed around with trying to do 256b DOS stuffs, but I'm notsure my brain is tuned for x86 asm.. still want to do *something* interesting there though
05:28:16 <ashkitten> the dvd demo mostly consists of the encoded bitmap and decoding routine.. i think the rest is just ~80 bytes
05:28:36 <ashkitten> bitmaps are fucking gigantic shit
05:28:42 <FireFly> haha
05:29:05 <FireFly> that's why they're fun to try to compress well/cleverly
05:29:27 <FireFly> It's like kolmogorov-complexity codegolf tasks
05:29:56 <ashkitten> it's a mono bitmap, i was like "how hard could this be?"... ughhhh i couldn't have written the decoder without my gf, she's way better at thinking about this stuff than i am
05:29:57 <nyc`> Most of the security people could be prosecuted in the US for kernel patches to fix exploits and especially descriptions of what the kernel bugs they're trying to fix are.
05:30:55 <FireFly> nyc`: I know some folks doing tech stuff in NYC.. and speaking of demo stuffs, was a demoparty kinda in NYC recently :o
05:31:16 <ashkitten> my gf implemented fucking 5 bit rle, i don't even know how because i haven't looked at the code she wrote.. it works, i'm impressed
05:31:38 <nyc`> FireFly: I was never a hobbyist.
05:31:54 <FireFly> nyc`: ah fair
05:32:08 <FireFly> ashkitten: haha, nice
05:32:26 <FireFly> I like messing around with things like that a bit..
05:32:33 <ashkitten> it's magic
05:32:41 <ashkitten> i don't understand it
05:32:56 <nyc`> FireFly: I think the only kernel action in NYC is high-frequency trading wanting to microoptimize the net stack.
05:33:04 <ashkitten> it helps that she's decoding on the fly to save space tho
05:33:39 <nyc`> My net-fu is nil.
05:34:30 <FireFly> *nod*
05:34:57 <nyc`> I'll have to learn about that once I get to the point enough things are working around it.
05:36:39 <FireFly> ashkitten: I did a silly thing recently.. wanted to test DOS demo ideas in real MSDOS instead of DOSbox, so I decided to use qemu.. but for convenience I wanted a simple feedback loop from code changes to testing...
05:37:02 <ashkitten> autorun.bat!
05:37:34 <ashkitten> what were you saying sorry
05:37:36 <ashkitten> lol
05:37:41 <FireFly> so, I decidd the best way to do that is by generating a floppy... so I wrote nasm code to build the FAT12 fs of a floppy :D
05:38:07 <ashkitten> oh honey no
05:38:16 <FireFly> like, as the output when assembling with -fbin
05:38:28 <FireFly> it works fairly well :p
05:38:36 <ashkitten> don't you know you can virtualize a fat with qemu
05:38:48 <FireFly> nope!
05:38:50 <FireFly> TIL
05:39:00 <ashkitten> -hda fat:rw:path/to/dir
05:39:06 <ashkitten> or whatever
05:39:19 <FireFly> I learned a bunch about FAT though
05:39:26 <ashkitten> glad for that
05:39:33 <ashkitten> but.. oh dear
05:39:55 <ashkitten> were you even using dos provided interrupts?
05:40:05 <FireFly> Yes
05:40:10 <ashkitten> okay
05:40:12 <FireFly> But like
05:40:42 <FireFly> I could show you what I ended up with in a while when I get home, it's not *that* horrific I think
05:40:56 <ashkitten> i can imagine it's not
05:41:03 <ashkitten> mbr isn't sooo awful
05:41:13 <ashkitten> fat shouldnt be either
05:42:36 <ashkitten> on that note, for my dvd demo i can just turn it into an mbr image with an assembler flag
05:42:52 <ashkitten> run it in any computer's bios, modern or ancient
05:44:15 <FireFly> nice
05:44:17 <ashkitten> best part is, since it all fits in a stage1 i can put it on any bootable media; usb, floppy, hard drive.. i think cdrom is different and doesn't use mbr?
05:44:41 <ashkitten> idk how bootable cdroms work and i haven't looked tbh
05:45:12 <olsner> iirc it's something like you put a floppy disk image on it and point it out with some magic attribute
05:45:21 <ashkitten> ugh
05:45:32 <ashkitten> but that means my mbr image will work too
05:45:38 <ashkitten> so, win
05:46:47 <olsner> https://en.wikipedia.org/wiki/El_Torito_(CD-ROM_standard) seems there are two modes and the floppy disk emulation is just one of them
05:50:09 <ashkitten> neat
05:52:25 <ashkitten> if i were writing cds to distribute i'd probably make them bootable and also include something extra in the rest of the disk
05:53:06 <ashkitten> don't have cds quite yet tho
05:53:10 <FireFly> hehe
05:53:28 <ashkitten> i'll be getting some soon
05:54:11 <ashkitten> ...i might want to take the disk drive off the chain hanging from the back of my desktop and shove it back in my lappy
05:54:13 <ashkitten> oh wait
05:54:17 <ashkitten> lappy broken
05:54:20 <ashkitten> oh well
05:55:05 <ashkitten> i don't remember if the thinkypad i'm getting has a disk drive.. i know the older one i'll have for demo testing does?
05:55:14 <FireFly> I was thinking it'd be cool to have a floppy that shows a menu of demos and lets you boot them, possibly setting up a thin sorta-DOS-like environment for them
05:55:25 <ashkitten> yeah
05:55:40 <FireFly> so you could run the demos both from boot and by mounting the floppy under DOS
05:56:27 <ashkitten> i think jess is writing a demo loader that'll decompress a demo into ram and jump to it
05:56:41 <ashkitten> but i don't think a menu is on her mind
05:57:19 <jess3jane> i've been considering it tbh but i'm not sure if that'd be better served as another demo (meta demo?) instead of as a part of the bootloader
05:57:25 <ashkitten> oh hi jess
05:57:33 <jess3jane> hi ash
06:03:50 <ashkitten> i want so badly to have a scenario where i can save bytes by overlapping instructions
06:04:02 <ashkitten> that'd be such a dream come true
06:04:36 <ashkitten> i would be a goddess of code
06:05:46 <jess3jane> even just as a trick, a program that did something entirely different but still inteligible if started slightly offset would be suchhhhhh a good trick
06:05:59 <ashkitten> hhh yes
06:06:17 <ashkitten> but like, overlapping instructions hhhh
06:06:26 <ashkitten> i want it
06:07:53 <ashkitten> jmp label + 1 ; the second byte of this is a different instruction that does something else we want
06:13:38 <olsner> an easy one would be a jmp with an offset that starts with the opcode for jmp
06:14:32 <ashkitten> huh
06:15:06 <ashkitten> but the opcode is pretty large, yeah?
06:15:21 <ashkitten> can't remember off the top of my head tbh
06:15:49 <ashkitten> besides, jmp short is only two bytes anyways
06:15:59 <nyc`> I mostly need to get to where I can do some program loading at some point.
06:16:14 <FireFly> have you seen the sizecoding.org wiki?
06:16:18 <olsner> well, it's less than 256, but you would need a program large enough to jump that far
06:16:21 <ashkitten> i haven't!
06:16:41 <FireFly> it's about <256b DOS/x86 demo techniques... it's really tiny currently, so it's quite easy to literally read all the pages on there
06:17:00 <FireFly> and it has some cute tricks (and at least one example of jumping into the middle of an instruction like that!)
06:17:04 <zhiayang> ugh, my good friend shl_load link tests not allowed after gcc_no_executables has come back to pay me a visit
06:18:31 <ashkitten> nice!
06:18:45 <ashkitten> gonna show this to blackle
06:21:20 <ashkitten> jeez how the hell even, re those 16 byte examples on the main page
06:21:46 <jess3jane> the 8 byte matrix jeeeeeeeze
06:24:55 <FireFly> http://canonical.org/~kragen/demo/fr-016.html this one is magic... I disassembled and messed around with it trying to understand it, but I can't really see what gives rise to the radial pattern
06:25:11 <FireFly> but it's something to do with adding the carry in-between iterations
06:26:09 <ashkitten> these demos scare me lol
06:26:22 <ashkitten> how do you even get things that small
06:26:34 <rain1> kragen is so cool
06:26:43 <rain1> done lots of interesting hacks
06:28:58 <FireFly> well, that's ryg's (of farbrausch) demo
06:29:05 <ashkitten> makes me feel inadequate... but fitting a 64x29x1 bitmap along with drawing code and logic is also really difficult, and not possible procedurally like these demos
06:29:06 <FireFly> just that kragen apparently disassembled it
06:29:09 <FireFly> and analysed it a bit
06:29:22 <FireFly> ashkitten: yes, it's also a demonstration of technological skill :)
06:29:44 <ashkitten> which i do not possess lol
06:30:19 <ashkitten> jess did all the bitmap encoding/decoding and i haven't even tried to understand how
06:30:30 <ashkitten> tho i'm sure she could explain if i asked
06:32:59 <nyc`> I think things like aio, gang scheduling, automatic/transparent superpaging, coremaplessness, stacklessness, etc. are more interesting than hand-coding assembly to size optimize it.
06:33:03 <FireFly> I think writing tiny x86 demos for fun to begin with requires a certain mindset, and plenty of people wouldn't be able to pull that off :p
06:33:46 <ashkitten> i don't hope to understand any of those concepts nyc`
06:34:34 <ashkitten> writing tiny demos is just kinda.. idk, it's a fun puzzle and you don't have to have much extraneous knowledge to start out
06:36:18 <FireFly> I like solving silly problems under harsh constraints
06:36:23 <FireFly> which might be size, or other things
06:36:31 <ashkitten> yeah
06:36:51 <ashkitten> the brainfuck interpreter was how i started out
06:37:16 <geist> yep. tis why i fiddle around with obsolete machines some too
06:37:21 <FireFly> People enjoy different things though, which is fine :p
06:37:24 <nyc`> Asynchronous IO largely applies to block IO. There, issuing IO operations is done in such a way that it doesn't block the issuing thread or process.
06:37:33 <geist> similar ideas, you play in difference spaces where the constraints are different
06:37:35 * FireFly is idly reminded of the "stereotypes" page on the osdev wiki
06:37:41 <geist> haha
06:37:47 <geist> oh yeah i haven't thought about that one in a while
06:37:50 <geist> we get all kinds here
06:38:26 <FireFly> https://wiki.osdev.org/What_order_should_I_make_things_in that one
06:38:28 <ashkitten> it was blackle i think who i showed the interpreter project to, and it told me a bunch of easy ways to decrease the size a lot, went from over 500 to under 200 bytes...
06:38:34 <nyc`> It's largely a UNIX issue because the UNIX vfs presents a blocking interface for file and otherwise block IO.
06:39:12 <geist> FireFly: ah yeah there it is. i thought there was a larger one?
06:39:46 <FireFly> It looks like there's separate articles for each persona
06:39:49 <FireFly> Dunno if that was the case before
06:40:43 <geist> well, ether way they're cute
06:41:10 <geist> i dunno where i sit there. whatever one is basically 'go forth and do it!'
06:41:21 <geist> and 'read everything you can'
06:41:46 <ashkitten> i'm whichever one is "fuck up a whole lot and spend hours optimizing four bytes out"
06:41:52 <geist> kidna depends on what hat i'm wearing for whatever project i'm working on
06:41:53 <FireFly> haha
06:42:37 <geist> to do and fail is far more useful than planning on doing and never doing it
06:42:44 <nyc`> My schedule doesn't have as much room in it as I would like.
06:43:16 <FireFly> I'm way too good at planning on doing and never doing
06:43:33 <geist> yes it's an extremely common pattern, especially if it's something you haven't done before
06:44:32 <ashkitten> i often jump in without looking and end up fully rewriting about 4 times
06:44:53 <geist> as long as you learn from your mistakes i think that's a pretty good strategy
06:45:09 <geist> within reason. a bit of planning helps, but you have to be self aware enough to know when you're overplanning
06:45:23 <nyc`> I end up bogged down in bughunts.
06:45:44 <ashkitten> see: my demotool yotredash, which i've probably added and modified many tens of thousands of lines for.. iirc it's only about 2500 lines right now
06:45:57 <FireFly> oh yeah, ashkitten: http://xen.firefly.nu/up/fat12.mac.html http://xen.firefly.nu/up/floppy.asm.html this is what I came up with for the floppy thing :p
06:46:45 <ashkitten> ooo
06:47:02 <FireFly> (with a ton of hardcoded stuff of course, since I only really need it to know for my very specific usecase)
06:47:10 <ashkitten> mhm
06:48:04 <ashkitten> lol i sometimes feel i should use macros but that would mean code duplication and i can't have *that*
06:48:11 <ashkitten> :p
06:48:16 <FireFly> hehe
06:49:15 <ashkitten> it's actually really hard to optimize out duplicated code paths where one thing is different
06:50:23 <ashkitten> at least if you want to save bytes lol
06:52:16 <ashkitten> jess3jane: we should look at x32 for (probably non-bios) demos
06:52:45 <ashkitten> cuz i know you were having trouble finding unused registers lol
06:53:15 <jess3jane> ?
06:53:17 <geist> alright, wish me luck. going to drive to work, even though the roads are fairly crummy
06:53:22 <geist> go team Subaru!
06:53:26 <jess3jane> o7
06:54:01 <jess3jane> and yes, i very much was. 4 gp registers is not enough lol
06:54:14 <jess3jane> makes me miss arm land where you have 14
06:54:29 <jess3jane> (or like, anything other than real mode >.>)
06:54:58 <ashkitten> jess3jane: x32 is the linux abi for using 64 bit instructions in a 32 bit address space
06:55:34 <ashkitten> also also you can abuse ebp and esi and edi and stuff hehe
06:55:42 <jess3jane> ah, interesting
06:56:31 <ashkitten> so if you ever need 3 extra gp regs.. those 3 are usually free
06:57:36 <ashkitten> what's the use of ebp anyway, if you control the stack completely ;3
06:58:28 <jess3jane> that is fair, i'm always afraid that something ~mysterious~ will break because i'm not entirely sure what uses those registers
06:59:17 <ashkitten> eh, the movement logic is surrounded by pusha/popa
06:59:23 <ashkitten> you're all good
06:59:29 <nyc`> The SVR4/i386 ABI demands a minimum of 3GB for user virtualspace beyond just eating registers.
07:00:55 <nyc`> That's a big part of why 2:2 splits couldn't fly for large memory 32-bit.
07:02:07 <nyc`> The other being that major databases like Oracle and DB2 ran much slower when starved of room for large shared memory segments.
07:04:28 <nyc`> The big thing on 32-bit is:
07:04:44 <nyc`> 1. Low per physical page overhead
07:04:53 <nyc`> 2. XKVA
07:05:40 <nyc`> And probably hoisting as much as you can up out of kernel virtualspace.
07:06:04 <nyc`> Stacks and pagetables are good for u areas.
07:06:40 <nyc`> But a lot more can go in the u area too.
07:08:25 <nyc`> struct seg or whatever you call per-mmap data structures can often go there. File handle structures. Etc.
07:09:30 <FireFly> ashkitten: duplicated code paths where one thing is different -> hmm, self-modifying code...
07:09:32 <nyc`> I think XKVA is getting used for spectre or meltdown.
07:09:44 <ashkitten> hng selfmodifying code
07:09:58 <jess3jane> FireFly: someday i will find an excuse to play with self modifying code
07:10:10 <ashkitten> i always forget that's a possibility in real mode
07:10:18 <FireFly> something I thought of the other day which would be fun to mess around with would be to do something ROP-y to save space in a 256b DOS demo
07:10:18 <ashkitten> can't do it under linux
07:10:28 <FireFly> abusing the tail ends of functions
07:10:33 <jess3jane> you can, just gotta make your code segment writable
07:10:40 <ashkitten> oh yeah
07:10:42 <jess3jane> my old flag demo has a writable code segment
07:10:45 <ashkitten> wait i literally did that
07:10:53 <jess3jane> cause it self modifies it's data to save space
07:10:53 <ashkitten> i've fucking done that before
07:11:17 <nyc`> Servicing as much as one can out of the u area to avoid the full address space switch is generally a good idea.
07:11:31 <FireFly> oh..
07:11:32 <FireFly> hm
07:11:51 <MayorHaxmo> you can only do that in real mode? :(
07:11:52 <ashkitten> anyways FireFly wdym with rop? there's not really that many native functions to call
07:12:38 <ashkitten> MayorHaxmo: no i'm just bad at things and got mixed up
07:13:06 <FireFly> well, like would be fun to find at least one location where the tail of a function does something useful enough that setting up and calling into that tail saves space vs. duplicating the instructions
07:13:16 <FireFly> just for the obscureness of doing something like that in a demo
07:13:20 <nyc`> Are they planning on adding ASN's to x86-64 to combat spectre/meltdown?
07:13:43 <MayorHaxmo> how do you make code segment writable? (looking at page 98 in intel manual volume 3)
07:14:02 <ashkitten> uhhh
07:14:15 <ashkitten> depends what environment?
07:14:39 <ashkitten> in linux you can set the section attributes or smth i forget lol
07:14:41 <nyc`> Permissions in the gdt, no?
07:15:03 <FireFly> jess3jane: oh... hm, the x11 flag demo? I think I've seen that one, heh
07:15:27 <nyc`> Or ldt I suppose.
07:15:29 <MayorHaxmo> maybe something to do with paging? i haven't done that yet
07:15:31 <jess3jane> MayorHaxmo: depends on os, in linux it's in the elf header
07:15:52 <jess3jane> which in turn sets gdt permissions i believe
07:16:43 <jess3jane> FireFly: probably not, it was just a little silly thing that dumped a flag to tty. interlaced with it's header, but it was x86_64 so i couldn't get it too small.
07:16:51 <FireFly> ah
07:16:55 <nyc`> The Linux loading doesn't set up gdt permissions that I'm aware of.
07:17:10 <MayorHaxmo> yeah it runs everything in ring 0
07:17:19 <jess3jane> i stand corrected hehe
07:19:39 <nyc`> The way Linux does it is that the code and data segments alias each other and are identical save for permissions, so a data access only really has pagetable permission checks and the code just picks up modifications from that.
07:20:36 <ashkitten> huh
07:21:52 <jess3jane> but either way, it in the flags field of the section header in elf: set write and execinstr and you've got the ability to self modify
07:22:07 <orion> Hi. I just got a FreeBSD security advisory about a leakage of information from syscalls. In the "Impact" part of the advisory they say, "Typically an address of some kernel data structure used in the syscall implementation, is exposed." Why are the addresses of kernel data structures considered sensitive? Isn't that memory locked away from user-space?
07:24:06 <nyc``> It reuses the same code alnd stack and data segment gdt entries for all user processes, too.
07:26:22 <MayorHaxmo> orion: what do you mean by "locked away"
07:27:07 <nyc``> It used to be that Linux used TSS's etc. in the 2.0.x timeframe and that limited the number of processes on a system.
07:30:53 <nyc``> I need to get program loading happening.
07:33:55 <orion> MayorHaxmo: "locked away" as in the processor and MMU will prevent a user space process from reading kernel space memory.
07:39:23 <doug16k> orion, you can possibly infer where some juicy important information is in the kernel that way and use that to conduct another more useful exploit
07:42:07 <doug16k> i.e. you may not even need to breech the paging security, you can sometimes trick the kernel into doing it itself if you know what address you need to affect
07:43:54 <doug16k> because bugs of course, not by definition
07:52:21 <MayorHaxmo> or you can trick a cheap DRAM implementation into doing it
08:04:21 * Ameisen is still wracking his brain over why clang is making a substantially slower binary
08:04:24 <Ameisen> too many variables :(
08:09:17 <nyc> I thought clang was rather competitive with gcc.
08:38:37 <orion> Thanks for the explanation.
10:04:40 <nyc> hello.S:11: Error: `nooddspreg` cannot be used with a 64-bit ABI <--- is this a floating point issue?
10:06:52 <nyc> Something is assuming a single-precision operation on an odd-numbered register.
10:18:36 <bcos_> nyc: Maybe "nooddspreg" is "no odd sp reg" (saying that stack pointer can't be odd); and maybe "nooddspreg" is saying that your noodds is pregnant; and maybe someone needs to be slapped with a trout for using poorly chosen function names
10:21:22 <nyc> No odd single-precision reg.
10:22:15 <nyc> I figure I probably have to break down the full address immediates into their 16-bit constituent parts.
10:24:25 <nyc> addi, aui, ahi, ati, should do it for the successive 16-bit pieces of the immediate.
10:25:02 <bcos_> Hrm
10:25:49 <bcos_> nyc: I suspect the assembler thinks you're loading a double precision value into a pair of single precision registers and won't let you use an odd numbered single precision register for the first register of the pair
10:27:11 <nyc> I'm at least trying to get it to use 64-bit instructions etc.
10:28:09 <bcos_> D'oh: "Some MIPS processors allow only even-numbered registers ($f0, $f2,...) for single precision instructions. However SPIM allows you to use all 32 registers in single precision instructions"
10:28:38 <bcos_> ..so maybe (depending on which CPU) you can't use $f1, $f3, .. for single precision
10:28:52 <nyc> I'm only using integer operations to begin with here.
10:31:45 <nyc> When I commented out literally all of the instructions I still got the same errmsg.
10:32:27 <bcos_> Maybe it's conflicting command line args (and maybe there's a "enable oddspreg" command line arg you want?)
10:33:40 <olsner> are you assembling it directly or e.g. using gcc as a driver? it might be adding some target options that it thinks you need (based on whatever kind of mips it's targeting by default or so)
10:33:58 <nyc> olsner: Yes, that's when it started behaving badly.
10:34:22 <nyc> I may very well dump gcc and just cpp by hand.
10:34:52 <olsner> could try -v to see what it's sending on to gas (e.g. confirm that's where nooddspreg is coming from)
10:36:01 <nyc> -mabi=32 is getting crapped all over me.
10:37:41 <nyc> -mabi=64 overrode it.
11:01:19 <nyc> TFW you're attempting to squirt hello world out a serial port and nothing happens.
11:02:33 <mrvn> could be worse, could reset
11:02:48 <ConstableHaxmo> are you smelling smoke yet?
11:03:08 <ronsor> are you talking about the magic smoke
11:03:14 <ronsor> you have to let it out
11:03:16 <nyc> qemu fortunately doesn't catch fire when it halts.
11:03:21 <ronsor> I've found that mains power is very good with that
11:04:14 <nyc> Hmm. The linux-mips.org docs are out of date and the default is apparently a Malta.
11:07:27 <ronsor> I've found linux-mips.org outdated many times
11:08:55 <nyc> Selecting the thing with ISA PC serial doesn't help much.
11:16:21 <nyc> Oh brilliant. gdb isn't readily available.
11:32:26 <nyc> gdb-multiarch has to be explicitly invoked as gdb-multiarch. That's bizarre.