klange changed the topic of #osdev to: Operating System Development || Don't ask to ask---just ask! || For 3+ LoC, use a pastebin (for example https://gist.github.com/) || Stats + Old logs: http://osdev-logs.qzx.com New Logs: https://libera.irclog.whitequark.org/osdev || Visit https://wiki.osdev.org and https://forum.osdev.org || Books: https://wiki.osdev.org/Books
orthoplex64 has quit [Ping timeout: 244 seconds]
_mrlemke_ has joined #osdev
gog has joined #osdev
mrlemke_ has quit [Ping timeout: 246 seconds]
pretty_dumm_guy has quit [Quit: WeeChat 3.5]
kingoffrance has quit [Ping timeout: 265 seconds]
Burgundy has quit [Ping timeout: 240 seconds]
kingoffrance has joined #osdev
floss-jas has joined #osdev
Matt|home has joined #osdev
<mrvn> gcc std::lcm(50000, 49999) is buggy, doesn't detect UB in constexpr.
nyah has quit [Ping timeout: 240 seconds]
<mrvn> *grrr*, I want to static_assert(m == 0) in a constexpr function. But m is an argument, not a constexpr. :(
qubasa_ has joined #osdev
qubasa_ is now known as qubasa
bliminse has quit [Ping timeout: 246 seconds]
bliminse has joined #osdev
gog has quit [Ping timeout: 246 seconds]
papaya has joined #osdev
the_lanetly_052_ has joined #osdev
the_lanetly_052 has quit [Ping timeout: 258 seconds]
terrorjack has quit [Quit: The Lounge - https://thelounge.chat]
terrorjack has joined #osdev
theruran has joined #osdev
dude12312414 has joined #osdev
PSedlacek has joined #osdev
Matt|home has quit [Ping timeout: 244 seconds]
Likorn has quit [Quit: WeeChat 3.4.1]
chartreus has joined #osdev
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
robert_ has quit [Read error: Connection reset by peer]
radens has joined #osdev
<radens> Does someone have a good example of setting up the arm64 gic for virtualization?
<radens> as a hypervisor?
<zid> *finally* got a useful trace for my crash, hoorah
<zid> ..I wish, it goes from `bswap r13d` to page fault handler..
<zid> I guess I'll just assume the faulting instruction was never printer and it was the one after the bswap
<geist> Or you’re not running what you think you’re running
<zid> next line was a mov [rax], r8b and rax contains.. -2GB which I'm not sure is mapped
<zid> so it'd make sense
<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
<geist> Yah
<zid> qemu's cpu trace prints everything except cr2 for some reason, unless I am blind
<zid> oh nevermind I see it
<zid> yea confirmed, dunno why I forgot to think about cr2
PSedlacek has quit [Quit: Connection closed for inactivity]
<zid> this is a different crash from the one before where it was executing 0 and the cr2 value was just 0 and useless
<Andrew> The bochs simulator is quite nice when it comes to debugging
<zid> yea I love bochs for debugging just because of xchg bx, bx :P
<Andrew> :P
<Andrew> Bochs is quite customizable too
<Andrew> Though the same could be said for QEMU
<Andrew> But QEMU isn't so good at telling you what instructions are running
<zid> yea I've patched qemu to find a bug in my code before
<Andrew> s/so good at/as good at bochs at/
<zid> it's a nice process
<Andrew> I patch programs all the time anyway, lol
<geist> There are ways of getting pretty good traces from qemu,you just have to know the appropriate tricks
<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
<zid> -singlestep
ThinkT510 has quit [Quit: WeeChat 3.5]
<geist> Much slower, but it doesn’t end up running traces of instructions like it usually does
<zid> I did that, bisected down which frame it was crashing on
<geist> Yah
<zid> then toggled loging with `log cpu` at that point
<zid> then let it run with a breakpoint on the pf handler
<zid> then I had a 7GB log, so I grep RIP= | awk "{print $1;}"'d that so my text editor could open it :P
<zid> and tail -n1000000'd it too actually in there somewhere
<geist> SKILLZ
<zid> I need to write a script to addr2line them all
<geist> The huge log of data is a favorite of mine
<mrvn> such a tiny 7GB file shouldn't be a problem for an editor. :)
<Andrew> Yeah
<zid> but I am dumb at bash scripts
<geist> You’d be surprised. I open large ass files like that with vim fairly frequently
<Andrew> I'm going to install the MMIX architecture simulator tonight
<geist> And though it chugs a bit it actually works fairly well
ThinkT510 has joined #osdev
<zid> I figured out it's in e1000_recv anyway, and ends up in memcpy and kalloc and dies, good enough for now
<zid> never had a crash anywhere near that code though so fuck knows what's going on
<zid> and it isn't the same crash as I was getting yesterday, the debugging seems to have changed why it crashes
<Andrew> I think vim doesn't load the whole file into memory
<zid> I'm too dumb at vim to use it for useful stuff other than line editing
<Andrew> Otherwise opening a 2G text file with vim will definitely oom myself
<Andrew> line editing, use ed :)
<Andrew> I'm using bvi a lot these days, nice stuff
<Andrew> (vimmy hexeditor)
<zid> I use notepad++ on my desktop, vim if I am ssh'd
<geist> Reminds me, somewhere here was talking about there not being a good arm board with a bunch of Ethernet
<zid> I don't really give a shit cus all I really do is line edit
<bslsk05> ​www.cnx-software.com: FastRhino R68s router offers 4GB RAM, dual 2.5GbE, dual Gigabit Ethernet for $80 (in China) - CNX Software
<Andrew> I think notepad++ is windows-only so I can't use it
<geist> There’s also a similar other board, R5S i think, that has three eths on it, with the same soc
<zid> probably works fine in wine tbh
<Andrew> And it's hard for me to use editors that aren't vim-like
<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
<bslsk05> ​liliputing.com: NanoPi R5S is a tiny router board or mini PC with RK3568 and 3 Ethernet ports for $59 and up - Liliputing
<zid> It sounded to me like they wanted like 16 ports, rather than 16 gigabits of ports
<zid> but I don't emember
Likorn has joined #osdev
nur has quit [Ping timeout: 272 seconds]
<kazinsal> hmm. if the CPU on that thing had more PCIe lanes it'd be pretty solid
<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
<kazinsal> which is... odd for that design because there's two GbE MACs on the SoC
<kazinsal> so one of those MACs on the SoC is completely unused on that board
<kazinsal> ???
<kazinsal> ah okay it looks like it's attached on the R68s
chartreus has quit [Remote host closed the connection]
Likorn has quit [Quit: WeeChat 3.4.1]
<geist> and there's a lane for the m.3
<geist> m.2
<geist> i guess that.s the 2.1
mykernel has joined #osdev
<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
<geist> actually looks like on the r5s it has a rtl8211F for the GbE
<geist> oh wait, that's the PHY. okay
_xor has quit [Quit: brb]
<mrvn> The standard setup for such routers is one MAC for an uplink port and the other connected to a switch chip.
mykernel has quit [Quit: leaving]
mahmutov has joined #osdev
srjek has quit [Ping timeout: 255 seconds]
_xor has joined #osdev
nj0rd has quit [Ping timeout: 246 seconds]
Burgundy has joined #osdev
Likorn has joined #osdev
<zid> I put 5 more minutes of effort in, my freelist is empty. That is very strange.
GeDaMo has joined #osdev
jafarlihi has joined #osdev
<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
<bslsk05> ​github.com: protura/boot_multiboot.S at c6d6371a23220e4b8e9ce2cfbd598680c34cbfbe · mkilgore/protura · GitHub
<mrvn> because there are 4 pg0dir?
Likorn has quit [Quit: WeeChat 3.4.1]
<jafarlihi> But that represents the address, if you multiply by 4 you are looking at addresses over 12GB
Likorn has joined #osdev
<mrvn> No, it's 16k of page tables.
<mrvn> it's just the begin() and end() used in the loop later.
<mrvn> no, wait, it's 2 tables liek I thought first.
<mrvn> jafarlihi: what's 16k after initial_pgdir?
<zid> This is how you're supposed to debug things right?
<jafarlihi> No idea
<mrvn> check yout elf file
<zid> jafarlihi: do you know what a page table entry looks like?
<zid> and do you know the relationship between multiplication by powers of the number base and place value
<mrvn> What's KMEM_KPAGE? Maybe that isn't the page size?
<jafarlihi> It's C0000000
<zid> I didn't ask you what value it had
<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.
<mrvn> jafarlihi: no, it overflows and becomes 0
<mrvn> jafarlihi: when are you going to stop reading other peoples broken code and write your own?
<jafarlihi> Soonish
nj0rd has joined #osdev
Likorn has quit [Quit: WeeChat 3.4.1]
nyah has joined #osdev
arch-angel has joined #osdev
<jafarlihi> I made a script to git clone literally everything from projects page so I can grep through everyones' projects
gildasio has joined #osdev
<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?
Ali_A has joined #osdev
<\Test_User> Andrew: "your SSD now has 0 write cycles left"
<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
<j`ey> so youre storing data there.. does data including files from a user?
<\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
<j`ey> where is the metadata stored to know where the 'data' on the disk is?
<Andrew> "There are no files"
blockhead has quit []
<Andrew> \Test_User: Treated "like", as in it's used with pointers and stuff, miswrote
<j`ey> Andrew: how is users data stored?
<\Test_User> then that's just a weird filesystem type
<j`ey> or is there no user data?
<Andrew> \Test_User: Well, kind-of
<Andrew> j`ey: Basically like how user data is stored in memory
<Andrew> Note that I'm still planning this new idea
<\Test_User> "storing this new idea in memory" :P
<j`ey> Andrew: and when you turn the machine off, and want to persist the data, what happens?
_73 has quit [Remote host closed the connection]
<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
<Andrew> yeah, finding where data is where is annoying
<GeDaMo> How is the user going to refer to data?
<Andrew> Tags
<Andrew> Ugh
<Andrew> Tags for searching
<j`ey> Andrew: so yes, you want a file system ;)
<Andrew> Literal position in disk for reference
<Andrew> Yup, I seem to be making a filesystem :)
<j`ey> why dont you want a file system?
<Andrew> Nah, what I didn't want was a directory hierachy, alternatively that's called "normal filesystem"
<Andrew> (But I won't call them files, just like how I don't call random data in memory files)
<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
<bslsk05> ​en.wikipedia.org: Burroughs MCP - Wikipedia
<Andrew> Hmm
<j`ey> folders seems like a good way to represent structure, I feel like tags dont work as well
<GeDaMo> No reason you can't have both
<j`ey> (for me)
<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
<GeDaMo> You could see a folder name as a special form of tag
<GeDaMo> Maybe have a way of marking it as 'primary' or something
<Andrew> That's not how my brain works, so nah
<Andrew> There would be different types of metadata though
<Andrew> tags = general for-human representation of categoreis
<Andrew> and filetype
<Andrew> etc
<GeDaMo> Full text search is also pretty good :P
<bslsk05> ​www.tbray.org: ongoing by Tim Bray · On Search, the Series
<j`ey> with folders, a file can for example only be in 'photos' or 'source-code', with tags it can be in both
<j`ey> what good example do you need for something to be in two major tags?
<GeDaMo> Also, the same tag can apply to many 'files', how do you uniquely specify a 'file'
<GeDaMo> ?
<Andrew> The only way to uniquely specify a file is to use its pointer
<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
<GeDaMo> And maybe a date
<j`ey> hm
<psykose> definitely no dates
<GeDaMo> What if you have the same file on more than one machine?
<j`ey> could easily be school/essays/bruhos.txt or whatever
<j`ey> guess you might forget its there
<Andrew> j`ey: There can be essays that are not for school, and I would have other bruhOS stuff that I would organize together
<Andrew> GeDaMo: Don't know
<Andrew> Maybe hostname:pointer or something
<GeDaMo> URLs aren't perfect but they're pretty good :P
<Andrew> URLs assume hierachical data
Oshawott has joined #osdev
archenoth has quit [Ping timeout: 246 seconds]
<GeDaMo> I suppose you could use the hash of the file as an identifier which is what Bittorrent does
<Andrew> Hash collisions will *always* exist
zaquest has quit [Remote host closed the connection]
zaquest has joined #osdev
qubasa has quit [Ping timeout: 260 seconds]
the_lanetly_052 has joined #osdev
gog has joined #osdev
the_lanetly_052_ has quit [Ping timeout: 246 seconds]
mahmutov has quit [Ping timeout: 255 seconds]
jafarlihi has quit [Quit: WeeChat 3.5]
_eryjus has joined #osdev
eryjus has quit [Ping timeout: 246 seconds]
jafarlihi has joined #osdev
Vercas9 has joined #osdev
foudfou_ has joined #osdev
Vercas has quit [Quit: Ping timeout (120 seconds)]
foudfou has quit [Quit: Bye]
Vercas9 is now known as Vercas
jafarlihi has quit [Quit: WeeChat 3.5]
wootehfoot has joined #osdev
eryjus has joined #osdev
_eryjus has quit [Ping timeout: 276 seconds]
Oshawott has quit [Ping timeout: 276 seconds]
blockhead has joined #osdev
srjek has joined #osdev
foudfou_ has quit [Remote host closed the connection]
foudfou has joined #osdev
Likorn has joined #osdev
kingoffrance has quit [Ping timeout: 265 seconds]
* geist yawns
<geist> good morning folks
nur has joined #osdev
<GeDaMo> Ahoy hoy :P
zaquest has quit [Ping timeout: 240 seconds]
atrapa has joined #osdev
zaquest has joined #osdev
wootehfoot has quit [Quit: Leaving]
<bslsk05> ​'Spyro the Dragon Soundtrack - Gnasty's Loot' by FlippyAndSpyro (00:03:24)
wootehfoot has joined #osdev
wootehfoot has quit [Read error: Connection reset by peer]
wootehfoot has joined #osdev
atrapa has left #osdev [#osdev]
srjek has quit [Ping timeout: 240 seconds]
azu has joined #osdev
katek has joined #osdev
GeDaMo has quit [Quit: There is as yet insufficient data for a meaningful answer.]
mahmutov has joined #osdev
gog has quit [Ping timeout: 276 seconds]
terminalpusher has joined #osdev
azu has quit [Quit: leaving]
gog has joined #osdev
Ali_A has quit [Quit: Connection closed]
jafarlihi has joined #osdev
<jafarlihi> Hey. How do I convert this to GAS?: mov [page_table0+kernel_virt2phys+eax*4], ecx
<klys> mov %ecx, $4(page_table0+kernel_virt2phys+$eax) ;work?
<klys> oh
<klys> mov %ecx, $4(page_table0+kernel_virt2phys+%eax) ;work?
<geist> generally would recommend assembling it and then disassembling it in the other form
<jafarlihi> mov [page_table0+kernel_virt2phys+eax*4], ecx
<geist> but really page_table0 and kernel_virt2_phys are a single offset
<klys> 0: 67 89 0c 85 00 00 00 mov %ecx,0x0(,%eax,4)
<geist> yah there it is
<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.
shikhin is now known as ass
ass is now known as shikhin
shikhin is now known as arsch
arsch is now known as buttocks
buttocks is now known as shikhin
<mrvn> can't you write it in C and objdump?
<mrvn> Andrew: do you know of a sha256 hash collision?
jafarlihi has quit [Remote host closed the connection]
<geist> hmm, wonder if there are any known sha256 collisions
<geist> internet says probably not
psykose has quit [Remote host closed the connection]
psykose has joined #osdev
SGautam has joined #osdev
<\Test_User> mrvn: take the length of a sha256sum, add 1, and I can guarantee you'll get many of them
<zid> sha256's not common enough even if the keyspace were smaller :p
<zid> even birthday paradox can't really help you
<mjg_> people say memory barriers are difficult, try probability
<mjg_> :>
<zid> memory barriers are easy, put your sparc in the bin and buy an x86
<zid> solved
<mjg_> is sparc that bad?
<mjg_> i know ppc to be atrocious in that regard
<bslsk05> ​en.wikipedia.org: Memory ordering - Wikipedia
<zid> I meant alpha more than sparc
<zid> but that table is funny
<mjg_> alpha is the obvious pick, so kind of cheating
<mjg_> ok mofos, poll time
terminalpusher has quit [Remote host closed the connection]
<mjg_> should this create a warning https://dpaste.com/CFQA86U6L
<bslsk05> ​dpaste.com <no title>
<mjg_> clang says all good, gcc says warning: control reaches end of non-void function
<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
<mjg_> that's what i happen to be doing
<mjg_> so thanks for nothing!
<mjg_> well, not in default:
<moon-child> because I can imagine cases where a warning would be useful
<mjg_> after the switch
<moon-child> mjg_: what's the difference?
<mjg_> specifically so that the compiler still can tell me i got a new num i did not account for
<mjg_> in the switch
<moon-child> right
eryjus has quit [Quit: eryjus]
<zid> -Wswitch-enum is neat
<zid> -Wswitch is silenced by the default:
Burgundy has quit [Ping timeout: 255 seconds]
dude12312414 has joined #osdev
<mrvn> \Test_User: You can guarantee there are some, but the chance of getting even one is miniscule
<\Test_User> ye
<mrvn> The chance of it being 2 useful files is even less
<\Test_User> but as far as hashing stuff for indexing goes - you don't need a secure hash, you want a fast one
<mrvn> you want both
<\Test_User> there's no need at all for it to be secure if you're using it for indexing
<mrvn> just collision free
<\Test_User> yes
<mrvn> which pretty much comes down to the same functions
<mrvn> I would even say that if you can't force a collion then it's going to be secure.
_xor has quit [Quit: brb]
<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"