Search logs:

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

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

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

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


http://bespin.org/~qz/search/?view=1&c=osdev2&y=22&m=6&d=4

Saturday, 4 June 2022

01:16:00 <mrvn> gcc std::lcm(50000, 49999) is buggy, doesn't detect UB in constexpr.
01:33:00 <mrvn> *grrr*, I want to static_assert(m == 0) in a constexpr function. But m is an argument, not a constexpr. :(
06:26:00 <radens> Does someone have a good example of setting up the arm64 gic for virtualization?
06:26:00 <radens> as a hypervisor?
06:36:00 <zid> *finally* got a useful trace for my crash, hoorah
06:40:00 <zid> ..I wish, it goes from `bswap r13d` to page fault handler..
06:43:00 <zid> I guess I'll just assume the faulting instruction was never printer and it was the one after the bswap
06:43:00 <geist> Or you’re not running what you think you’re running
06:44:00 <zid> next line was a mov [rax], r8b and rax contains.. -2GB which I'm not sure is mapped
06:44:00 <zid> so it'd make sense
06:44:00 <geist> But also that’s the case, the faulting address in a page fault will be be set up such that if you return from it it’ll rerun the instruction
06:45:00 <geist> Yah
06:45:00 <zid> qemu's cpu trace prints everything except cr2 for some reason, unless I am blind
06:45:00 <zid> oh nevermind I see it
06:45:00 <zid> yea confirmed, dunno why I forgot to think about cr2
06:46:00 <zid> this is a different crash from the one before where it was executing 0 and the cr2 value was just 0 and useless
06:46:00 <Andrew> The bochs simulator is quite nice when it comes to debugging
06:46:00 <zid> yea I love bochs for debugging just because of xchg bx, bx :P
06:46:00 <Andrew> :P
06:47:00 <Andrew> Bochs is quite customizable too
06:47:00 <Andrew> Though the same could be said for QEMU
06:47:00 <Andrew> But QEMU isn't so good at telling you what instructions are running
06:47:00 <zid> yea I've patched qemu to find a bug in my code before
06:47:00 <Andrew> s/so good at/as good at bochs at/
06:47:00 <zid> it's a nice process
06:47:00 <Andrew> I patch programs all the time anyway, lol
06:50:00 <geist> There are ways of getting pretty good traces from qemu,you just have to know the appropriate tricks
06:51:00 <geist> Notably iirc it’s -S (or maybe it’s -s) that puts it into single stepping mode, where it runs one instruction at a time
06:51:00 <zid> -singlestep
06:51:00 <geist> Much slower, but it doesn’t end up running traces of instructions like it usually does
06:51:00 <zid> I did that, bisected down which frame it was crashing on
06:52:00 <geist> Yah
06:52:00 <zid> then toggled loging with `log cpu` at that point
06:52:00 <zid> then let it run with a breakpoint on the pf handler
06:52:00 <zid> then I had a 7GB log, so I grep RIP= | awk "{print $1;}"'d that so my text editor could open it :P
06:52:00 <zid> and tail -n1000000'd it too actually in there somewhere
06:53:00 <geist> SKILLZ
06:53:00 <zid> I need to write a script to addr2line them all
06:53:00 <geist> The huge log of data is a favorite of mine
06:53:00 <mrvn> such a tiny 7GB file shouldn't be a problem for an editor. :)
06:53:00 <Andrew> Yeah
06:53:00 <zid> but I am dumb at bash scripts
06:54:00 <geist> You’d be surprised. I open large ass files like that with vim fairly frequently
06:54:00 <Andrew> I'm going to install the MMIX architecture simulator tonight
06:54:00 <geist> And though it chugs a bit it actually works fairly well
06:54:00 <zid> I figured out it's in e1000_recv anyway, and ends up in memcpy and kalloc and dies, good enough for now
06:54:00 <zid> never had a crash anywhere near that code though so fuck knows what's going on
06:55:00 <zid> and it isn't the same crash as I was getting yesterday, the debugging seems to have changed why it crashes
06:55:00 <Andrew> I think vim doesn't load the whole file into memory
06:55:00 <zid> I'm too dumb at vim to use it for useful stuff other than line editing
06:55:00 <Andrew> Otherwise opening a 2G text file with vim will definitely oom myself
06:55:00 <Andrew> line editing, use ed :)
06:55:00 <Andrew> I'm using bvi a lot these days, nice stuff
06:56:00 <Andrew> (vimmy hexeditor)
06:56:00 <zid> I use notepad++ on my desktop, vim if I am ssh'd
06:56:00 <geist> Reminds me, somewhere here was talking about there not being a good arm board with a bunch of Ethernet
06:56:00 <zid> I don't really give a shit cus all I really do is line edit
06:56:00 <geist> This showed up in my feed today: https://www.cnx-software.com/2022/06/02/fastrhino-r68s-router-offers-4gb-ram-dual-2-5gbe-dual-gigabit-ethernet/
06:56:00 <bslsk05> ​www.cnx-software.com: FastRhino R68s router offers 4GB RAM, dual 2.5GbE, dual Gigabit Ethernet for $80 (in China) - CNX Software
06:56:00 <Andrew> I think notepad++ is windows-only so I can't use it
06:56:00 <geist> There’s also a similar other board, R5S i think, that has three eths on it, with the same soc
06:56:00 <zid> probably works fine in wine tbh
06:56:00 <Andrew> And it's hard for me to use editors that aren't vim-like
06:57:00 <geist> https://liliputing.com/2022/05/nanopi-r5s-is-a-tiny-router-board-or-mini-pc-with-rk3568-and-3-ethernet-ports.html for the other board, or at least some article that references the board and has links to it
06:57:00 <bslsk05> ​liliputing.com: NanoPi R5S is a tiny router board or mini PC with RK3568 and 3 Ethernet ports for $59 and up - Liliputing
06:58:00 <zid> It sounded to me like they wanted like 16 ports, rather than 16 gigabits of ports
06:58:00 <zid> but I don't emember
07:47:00 <kazinsal> hmm. if the CPU on that thing had more PCIe lanes it'd be pretty solid
07:48:00 <kazinsal> the big issue with it is that it has two 3.0 lanes and one 2.1 lane and the 3.0 lanes are both consumed by onboard gig-e ports
07:49:00 <kazinsal> which is... odd for that design because there's two GbE MACs on the SoC
07:49:00 <kazinsal> so one of those MACs on the SoC is completely unused on that board
07:49:00 <kazinsal> ???
07:49:00 <kazinsal> ah okay it looks like it's attached on the R68s
08:20:00 <geist> and there's a lane for the m.3
08:20:00 <geist> m.2
08:20:00 <geist> i guess that.s the 2.1
08:21:00 <Andrew> Random thought: Files won't exist on my operating system, things will be raw hard disk with pointers pointing to disk locations because fun
08:22:00 <geist> actually looks like on the r5s it has a rtl8211F for the GbE
08:23:00 <geist> oh wait, that's the PHY. okay
08:29:00 <mrvn> The standard setup for such routers is one MAC for an uplink port and the other connected to a switch chip.
10:19:00 <zid> I put 5 more minutes of effort in, my freelist is empty. That is very strange.
10:36:00 <jafarlihi> Can someone please tell me why this guy multiples by 4 at this line?: https://github.com/mkilgore/protura/blob/c6d6371a23220e4b8e9ce2cfbd598680c34cbfbe/arch/x86/boot/boot_multiboot.S#L76 | KMEM_KPAGE is 0xC0000000
10:36:00 <bslsk05> ​github.com: protura/boot_multiboot.S at c6d6371a23220e4b8e9ce2cfbd598680c34cbfbe · mkilgore/protura · GitHub
10:37:00 <mrvn> because there are 4 pg0dir?
10:39:00 <jafarlihi> But that represents the address, if you multiply by 4 you are looking at addresses over 12GB
10:39:00 <mrvn> No, it's 16k of page tables.
10:40:00 <mrvn> it's just the begin() and end() used in the loop later.
10:41:00 <mrvn> no, wait, it's 2 tables liek I thought first.
10:44:00 <zid> https://cdn.discordapp.com/attachments/417023075348119556/982594826463752242/unknown.png
10:44:00 <mrvn> jafarlihi: what's 16k after initial_pgdir?
10:44:00 <zid> This is how you're supposed to debug things right?
10:44:00 <jafarlihi> No idea
10:44:00 <mrvn> check yout elf file
10:45:00 <zid> jafarlihi: do you know what a page table entry looks like?
10:45:00 <zid> and do you know the relationship between multiplication by powers of the number base and place value
10:46:00 <mrvn> What's KMEM_KPAGE? Maybe that isn't the page size?
10:47:00 <jafarlihi> It's C0000000
10:47:00 <zid> I didn't ask you what value it had
10:48:00 <jafarlihi> I know what page table entry looks like, I just don't get the purpose of multiplication here. It refers to 12GB+ after mul.
10:48:00 <mrvn> jafarlihi: no, it overflows and becomes 0
10:53:00 <mrvn> jafarlihi: when are you going to stop reading other peoples broken code and write your own?
10:53:00 <jafarlihi> Soonish
12:15:00 <jafarlihi> I made a script to git clone literally everything from projects page so I can grep through everyones' projects
13:13:00 <Andrew> Can anyone note me some complications if I treat hard disks as memory, as in things are just stored in the hard drive, accessed through pointers?
13:16:00 <\Test_User> Andrew: "your SSD now has 0 write cycles left"
13:18:00 <Andrew> \Test_User: I mean, I still only store persistent data in there and stuff, not things like current system boot state, but I jsut don't want filesystems
13:19:00 <j`ey> so youre storing data there.. does data including files from a user?
13:19:00 <\Test_User> Andrew: if it's treated *the same*, you can't make that distinction; ram from your programs may like this new 1TB available and decide to use it
13:19:00 <j`ey> where is the metadata stored to know where the 'data' on the disk is?
13:20:00 <Andrew> "There are no files"
13:20:00 <Andrew> \Test_User: Treated "like", as in it's used with pointers and stuff, miswrote
13:20:00 <j`ey> Andrew: how is users data stored?
13:20:00 <\Test_User> then that's just a weird filesystem type
13:21:00 <j`ey> or is there no user data?
13:21:00 <Andrew> \Test_User: Well, kind-of
13:21:00 <Andrew> j`ey: Basically like how user data is stored in memory
13:21:00 <Andrew> Note that I'm still planning this new idea
13:22:00 <\Test_User> "storing this new idea in memory" :P
13:22:00 <j`ey> Andrew: and when you turn the machine off, and want to persist the data, what happens?
13:22:00 <Andrew> j`ey: Since it's a hard drive and I'm only accessing it like how I access memory, it stays there, though I need a place to store the pointers and stuff which would be insanely annoying
13:23:00 <Andrew> yeah, finding where data is where is annoying
13:23:00 <GeDaMo> How is the user going to refer to data?
13:23:00 <Andrew> Tags
13:23:00 <Andrew> Ugh
13:23:00 <Andrew> Tags for searching
13:23:00 <j`ey> Andrew: so yes, you want a file system ;)
13:23:00 <Andrew> Literal position in disk for reference
13:24:00 <Andrew> Yup, I seem to be making a filesystem :)
13:24:00 <j`ey> why dont you want a file system?
13:24:00 <Andrew> Nah, what I didn't want was a directory hierachy, alternatively that's called "normal filesystem"
13:25:00 <Andrew> (But I won't call them files, just like how I don't call random data in memory files)
13:25:00 <GeDaMo> "In early MCP implementations, directory nodes were represented by separate files with directory entries, as other systems did. However, since about 1970, MCP internally uses a 'FLAT' directory listing all file paths on a volume." https://en.wikipedia.org/wiki/Burroughs_MCP
13:25:00 <bslsk05> ​en.wikipedia.org: Burroughs MCP - Wikipedia
13:26:00 <Andrew> Hmm
13:27:00 <j`ey> folders seems like a good way to represent structure, I feel like tags dont work as well
13:27:00 <GeDaMo> No reason you can't have both
13:27:00 <j`ey> (for me)
13:28:00 <Andrew> I can have both, but then there'd be the question of "should I use folders or tags", and I want tags better, don't really want folders anyway
13:29:00 <GeDaMo> You could see a folder name as a special form of tag
13:29:00 <GeDaMo> Maybe have a way of marking it as 'primary' or something
13:30:00 <Andrew> That's not how my brain works, so nah
13:30:00 <Andrew> There would be different types of metadata though
13:31:00 <Andrew> tags = general for-human representation of categoreis
13:31:00 <Andrew> and filetype
13:31:00 <Andrew> etc
13:32:00 <GeDaMo> Full text search is also pretty good :P
13:32:00 <GeDaMo> https://www.tbray.org/ongoing/When/200x/2003/07/30/OnSearchTOC
13:32:00 <bslsk05> ​www.tbray.org: ongoing by Tim Bray · On Search, the Series
13:33:00 <j`ey> with folders, a file can for example only be in 'photos' or 'source-code', with tags it can be in both
13:33:00 <j`ey> what good example do you need for something to be in two major tags?
13:34:00 <GeDaMo> Also, the same tag can apply to many 'files', how do you uniquely specify a 'file'
13:34:00 <GeDaMo> ?
13:35:00 <Andrew> The only way to uniquely specify a file is to use its pointer
13:35:00 <Andrew> A good example: I might have a tag called "BruhOS" for my OS's stuff, and if I wrote a school essay about it, it's gonna be tagged both BruhOS and Essay and School
13:36:00 <GeDaMo> And maybe a date
13:36:00 <j`ey> hm
13:36:00 <psykose> definitely no dates
13:37:00 <GeDaMo> What if you have the same file on more than one machine?
13:37:00 <j`ey> could easily be school/essays/bruhos.txt or whatever
13:37:00 <j`ey> guess you might forget its there
13:38:00 <Andrew> j`ey: There can be essays that are not for school, and I would have other bruhOS stuff that I would organize together
13:38:00 <Andrew> GeDaMo: Don't know
13:38:00 <Andrew> Maybe hostname:pointer or something
13:39:00 <GeDaMo> URLs aren't perfect but they're pretty good :P
13:39:00 <Andrew> URLs assume hierachical data
13:47:00 <GeDaMo> I suppose you could use the hash of the file as an identifier which is what Bittorrent does
13:47:00 <Andrew> Hash collisions will *always* exist
17:37:00 * geist yawns
17:37:00 <geist> good morning folks
17:41:00 <GeDaMo> Ahoy hoy :P
18:01:00 <GeDaMo> https://www.youtube.com/watch?v=LL0dUP_WOvE
18:01:00 <bslsk05> ​'Spyro the Dragon Soundtrack - Gnasty's Loot' by FlippyAndSpyro (00:03:24)
21:43:00 <jafarlihi> Hey. How do I convert this to GAS?: mov [page_table0+kernel_virt2phys+eax*4], ecx
21:46:00 <klys> mov %ecx, $4(page_table0+kernel_virt2phys+$eax) ;work?
21:46:00 <klys> oh
21:46:00 <klys> mov %ecx, $4(page_table0+kernel_virt2phys+%eax) ;work?
21:47:00 <geist> generally would recommend assembling it and then disassembling it in the other form
21:47:00 <jafarlihi> mov [page_table0+kernel_virt2phys+eax*4], ecx
21:48:00 <geist> but really page_table0 and kernel_virt2_phys are a single offset
21:49:00 <klys> 0: 67 89 0c 85 00 00 00 mov %ecx,0x0(,%eax,4)
21:49:00 <geist> yah there it is
21:52:00 <klys> $ cat >> instr.asm ; section .text ; page_table0: ; kernel_virt2phys equ 0 ; mov [page_table0+kernel_virt2phys+eax*4],ecx ; ^D ; $ nasm -felf64 -o instr.o instr.asm ; objdump -d -r instr.o ; that's what I did.
22:00:00 <mrvn> can't you write it in C and objdump?
22:01:00 <mrvn> Andrew: do you know of a sha256 hash collision?
22:13:00 <geist> hmm, wonder if there are any known sha256 collisions
22:15:00 <geist> internet says probably not
23:07:00 <\Test_User> mrvn: take the length of a sha256sum, add 1, and I can guarantee you'll get many of them
23:08:00 <zid> sha256's not common enough even if the keyspace were smaller :p
23:08:00 <zid> even birthday paradox can't really help you
23:12:00 <mjg_> people say memory barriers are difficult, try probability
23:12:00 <mjg_> :>
23:16:00 <zid> memory barriers are easy, put your sparc in the bin and buy an x86
23:16:00 <zid> solved
23:17:00 <mjg_> is sparc that bad?
23:17:00 <mjg_> i know ppc to be atrocious in that regard
23:18:00 <zid> https://en.wikipedia.org/wiki/Memory_ordering#In_symmetric_multiprocessing_(SMP)_microprocessor_systems
23:18:00 <bslsk05> ​en.wikipedia.org: Memory ordering - Wikipedia
23:18:00 <zid> I meant alpha more than sparc
23:18:00 <zid> but that table is funny
23:19:00 <mjg_> alpha is the obvious pick, so kind of cheating
23:20:00 <mjg_> ok mofos, poll time
23:20:00 <mjg_> should this create a warning https://dpaste.com/CFQA86U6L
23:20:00 <bslsk05> ​dpaste.com <no title>
23:20:00 <mjg_> clang says all good, gcc says warning: control reaches end of non-void function
23:26:00 <moon-child> I would be tempted to say it should warn, and you should default: __builtin_unreachable() if you wanna assert as your api contract that you can only eat shit and turds
23:27:00 <mjg_> that's what i happen to be doing
23:27:00 <mjg_> so thanks for nothing!
23:27:00 <mjg_> well, not in default:
23:27:00 <moon-child> because I can imagine cases where a warning would be useful
23:27:00 <mjg_> after the switch
23:27:00 <moon-child> mjg_: what's the difference?
23:27:00 <mjg_> specifically so that the compiler still can tell me i got a new num i did not account for
23:27:00 <mjg_> in the switch
23:27:00 <moon-child> right
23:35:00 <zid> -Wswitch-enum is neat
23:35:00 <zid> -Wswitch is silenced by the default:
23:51:00 <mrvn> \Test_User: You can guarantee there are some, but the chance of getting even one is miniscule
23:51:00 <\Test_User> ye
23:52:00 <mrvn> The chance of it being 2 useful files is even less
23:52:00 <\Test_User> but as far as hashing stuff for indexing goes - you don't need a secure hash, you want a fast one
23:53:00 <mrvn> you want both
23:53:00 <\Test_User> there's no need at all for it to be secure if you're using it for indexing
23:53:00 <mrvn> just collision free
23:53:00 <\Test_User> yes
23:54:00 <mrvn> which pretty much comes down to the same functions
23:54:00 <mrvn> I would even say that if you can't force a collion then it's going to be secure.
23:59:00 <mrvn> mjg_: an enum can be any number representable in as many bits as the largest enum member requires. So crap is 1 bit and you covered all cases. `enum more { shit, turd, piss };` on the other hand is 2 bits and you wouldn't cover "case 3"