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
Affliction has quit [Remote host closed the connection]
Affliction has joined #osdev
<doug16k> klange, you don't add up mAh. current is equal in all cells, Kirchhoff current law
<doug16k> because they are in series
<doug16k> the voltage is increased, so the overall Wh increases, but mAh stays the same
<doug16k> in parallel you add up mAh though
<doug16k> then voltage doesn't increase and it makes sense
<klange> Ah, yeah, I goofed. There's 3 parallel sets of 3 cells, so 8400/3 = 2400mAh per cell. Still, can get 3600mAh cells and see a big boost overall.
<klange> Nominal 11V output, 3.7V from an 18650 → 3 in a series to get nominal voltage, 9 cells total / 3 series sets = 3 parallel sets...
<klange> This third-party battery has slightly better cells, since it's a decade newer but still cheap; two parallel sets giving 5200mAh, so 2600mAh to a set.
Sos has quit [Quit: Leaving]
pretty_dumm_guy has quit [Quit: WeeChat 3.3-dev]
<doug16k> be careful when reading battery specs. lithium polymer batteries technically have more energy, but they also have more internal resistance than lithium ion, so a lower mAh lithium-ion can end up providing more energy then a higher Ah lithium polymer
<doug16k> lithium ion will win under heavy load. lithium polymer will win under light load
<doug16k> polymer has higher mAh specs
<klange> These are all lithium ion anyway.
<doug16k> ok. was worried you might be being misled by polymer high Ah number
<klange> I only poke polymer cells for airsoft.
iorem has quit [Quit: Connection closed]
<geist> random thing i watched on youtube yesterday: some guy popping at 5000A fuse
<geist> vaguely entertaining
<klange> [Anakin and Padme meme with Padme saying "You mean 5000mA?"]
<doug16k> good point. isn't it 5kA
<doug16k> odd how we don't do the full metric thing for certain units, like distance
<doug16k> nobody went on a megametre trip, it was thousand km
<klange> While the metric scales are nice for consistency, humans like distinct, identifiable units and aren't very good at adapting to the different prefixes.
<geist> reminds me, i keep meaning to loo up what the original scene was with taht
<geist> that anakin padme one comes up constantly
<bslsk05> ​'Anakin and Padme: Dictatorship and Democracy' by Nathanael Gratias (00:01:25)
<geist> oh god i forgot how terrible these movies were
<klange> the original incarnation of the image macro has nothing to do with the actual dialogue, but it is relevant to the franchise ("I'm going to change the world." "For the bettery, right?" x2)
<geist> yeah
<geist> i'm not entirely sure you can have less chemistry between two characters
warlock has joined #osdev
<warlock> guess who's back, back again, with another uefi question, has anyone had uefi boot on hyper-v?
<warlock> reason I ask, in qemu I have no problem booting a uefi app, just everytime I copy the same file to hyper-v it resets so fast
<warlock> it's a gen 2 image with secure boot disabled btw
<warlock> and all I'm doing is clearing is calling 2 functions on ConOut, ClearScreen and OutputString
<Mutabah> warlock: Fast reboot usually means triple fault
freakazoid333 has joined #osdev
<warlock> yea I figured that, I just don't know how to really debug it on hyper-v
<Mutabah> infinite loop binary searching might be an idea
<Mutabah> stick an infinite loop at your entrypoint, check if it still reboots (or freezes)
<Mutabah> then start moving it forwards until you get the reboot
<warlock> I've done that, it'll just hang
<warlock> basicly it happens anytime I call anything on ConOut
<Mutabah> Well, there's the answer - something is wrong about you working with ConOut
<Mutabah> are you trying to access it after ExitBootServices?
<warlock> no I never called it
<moon-child> what happens if you call other functions, like try to get the memory map?
<Mutabah> Are you manipulating segment registers and/or paging before exiting?
<warlock> really I'm hanging after both calls
<warlock> with the boot loop
<warlock> infinite loop I mean
<Mutabah> With infinite loop debugging, a hang is what you want
<Mutabah> that means that the loop was reached
<warlock> yea I'm aware of that, anyway, if I put the loop after the call, it just triple faults
<warlock> no hang at all
<warlock> at least that's what I'm guessing, cause it just spins up and stops right away
<Mutabah> Something is wrong with the call then
<Mutabah> Do other calls crash similarly?
<warlock> I haven't tried other calls yet, to be honest, just started learning uefi
<warlock> lastnight my stuctures weren't right but I got that correct now, at least it boots in qemu
<warlock> some efi file on a hyperv just stops on clicking start
<warlock> same
<warlock> I've only done ConOut calls, let me try a few things, and see what happens
isaacwoods has quit [Quit: WeeChat 3.2]
warlock has quit [Quit: leaving]
<doug16k> I wonder if he's calling it with ms_abi
<Mutabah> I'd expect that to break similary on qemu
<Mutabah> and at best just not work
<doug16k> oh it works on qemu? I missed the beginning part
<Mutabah> (iirc the first two arguments are swappwed with ms64 vs sysv64
gog has quit [Ping timeout: 268 seconds]
<doug16k> no. huge differences
<doug16k> rdi and rsi are callee saved on ms. not on sysv. there are only 4 register parameters on msabi
<doug16k> msabi has callee saved sse regs too
<doug16k> msabi requires spill space
<Mutabah> Oh yeah, lots of differences
<Mutabah> but a huge one is that the args are swapped
<Mutabah> so the output would be completely wrong (then it'd crash/do strange things)
<doug16k> first parameter is critical, it's the "this" pointer
<doug16k> if that is messed up, toast
<doug16k> hard to imagine how it can work in qemu and not hv, assuming it is a correct disk image
<doug16k> should be kvm vs hyperv to make a legit comparison
freakazoid333 has quit [Read error: Connection reset by peer]
<doug16k> going to clip my geometry properly for once. I always clipped in viewspace, not taking advantage of homogeneous coordinates
<moon-child> unless hyperv efi impl is not to spec
<doug16k> they created the spec and don't implement it to spec?
<moon-child> ¯\_(ツ)_/¯
<doug16k> that would be funny
<moon-child> (which is why I suggested trying to get the memory map, because there's no way in hell they can call it an efi implementation and not give you memory map)
<gorgonical> Is there some reference of exceptions for qemu with arm64? I'm trying to bypass using u-boot and passing my kernel.bin as -kernel, but I get a black screen. When I do info registers I get this: https://pastebin.com/YQ3d150n But I don't really know how to read this. Is there some format I can check?
<bslsk05> ​pastebin.com: R00=00000000 R01=ffffffff R02=44000000 R03=00000000R04=00000000 R05=00000000 R - Pastebin.com
<doug16k> gorgonical, they are just register values
<doug16k> what do you mean "how to read it"
<gorgonical> PSR is a platform-specific register, right?
<gorgonical> Or is it a control register where each bit is meaningful?
<doug16k> arm32? I'm clueless there
<gorgonical> This is supposed to be arm64 emulation
<doug16k> where are the rest of the registers?
<doug16k> you probably need -cpu max
<gorgonical> But this is what happens when I try to pass my kernel with the -kernel option. Something my advisor says works flawlessly for him
<doug16k> it's a 32 bit cpu right now
<doug16k> doesn't matter that you ran -aarch64. it defaults to 32 bit without a heavy dose of -cpu
<gorgonical> What's max vs e.g. the cortex-a53?
<gorgonical> As in, why do you suggest max
<doug16k> because max one way to be sure it is arm64
<doug16k> try max and check info registers. suddenly ten miles of registers?
<gorgonical> not ten miles, I would even say fewer lol
<doug16k> you have r31
<doug16k> x30
<bslsk05> ​pastebin.com: PC=0000000040080044 X00=0000000044000000 X01=0000000000000000X02=000000000000 - Pastebin.com
<gorgonical> But this at least has a PC that points into the kernel
<gorgonical> Man I feel dumb
<doug16k> that is 64 bit now
<gorgonical> it's at least now stuck on the same thing it was before
<gorgonical> I don't have to muck around with uboot
<doug16k> ah right. in gdb it's ten miles
<doug16k> try it for a laugh
<gorgonical> That reminds me: how can I tell gdb where the offset is? When I load my kernel to get the debug symbols gdb complains it doesn't know what the bounds of the current function are
<gorgonical> Is this something I can find in the manual?
<doug16k> you tell it the base address of .text in add-symbol-file filename 0x234234234
<gorgonical> got it
freakazoid333 has joined #osdev
freakazoid333 has quit [Write error: Connection reset by peer]
freakazoid333 has joined #osdev
nyah has quit [Ping timeout: 268 seconds]
<gorgonical> It works! Turns out the serial port was literally the only problem
<gorgonical> And not even a problem because I was using the wrong, identically named repo
<gorgonical> I appreciate all your help doug16k
freakazoid333 has quit [Read error: Connection reset by peer]
<doug16k> nice
<doug16k> glad to help
warlock has joined #osdev
<warlock> back again, anyway I haven't been able to figure it out yet, what's wrong with console on hyperv, but I have called bootservice functions and runtimeservices with no problem
<kazinsal> hyper-v's console kinda sucks tbh
<kazinsal> it's a bit wonky on account of it technically being an RDP session.
<warlock> yea
<doug16k> you could debug it with windbg
<warlock> anyway qemu is ok with me calling conout functions, I guess it triple faults on hyperv, would be nice if I got it to work, just so I could print stuff
<doug16k> no symbols, but at least you can see if your program is even in ram
<doug16k> wait no nevermind
<doug16k> what am I thinking, I am thinking windows kernel debugger lol
<warlock> yea, I did see the windbg stuff on the hyperv docs, to be honest I've tried to get it working before
<doug16k> I debugged that in hyperv
<doug16k> long ago
freakazoid333 has joined #osdev
<warlock> yea, I seen the instructions, I was just trying todo serial, but it windbg wasn't connecting
<warlock> who knows, what was really wrong though
<doug16k> yeah because there is nobody listening in the guest
<doug16k> no kernel debugger exists
<doug16k> that is the real kernel debugger you access from hyperv. you could be doing that on a real machine over real serial
<warlock> I was trying to do serial myself
<warlock> by in out ports
<doug16k> you can do that, you implement a gdbstub
<doug16k> then you could use gdb with hyperv and gcc tools
<doug16k> total chicken and egg problem though
<doug16k> you need to be able to run stuff successfully to create a gdbstub
<doug16k> gdbstub is more for debugging panic in display driver or something, where you would be blind and logging would flood really hard
<warlock> well I was doing it with the bios boot sectors, I'm just now doing uefi, it kept giving me greif
<doug16k> uefi is the easiest, depending how you look at it
<doug16k> uefi is little or no assembly, then all compiled code
<warlock> well I'm doing assembler, haha
<doug16k> uefi in assembly?
<warlock> yea
srjek_ has quit [Ping timeout: 268 seconds]
<doug16k> why
<warlock> I just like doing it, who knows
<doug16k> no I mean, why assembly. why not compiled language. just wondering
<warlock> I just fell like I'm being more explicit
<warlock> I probably should, but to be honest, I just been playing around with boot loaders and stuff, not really the os stuff yet
<doug16k> mostly you would be passing parameters and trying to follow the abi, a tiny bit of other code would be sprinkled into that
<warlock> I just like the idea of taking control from the start I guess
<doug16k> ms x64 abi is not one you want to do by hand. very annoying
<doug16k> they banned __asm on x64 compiler
<doug16k> it's frame based exceptions
<warlock> well see that's the thing, I'm using fasmg
<doug16k> totally intended for machine generated code
<warlock> yea, I get it, I do code in c++ also using visual studio
<doug16k> I guess I am just saying reasons why I am wondering why you would do that in assembly
<doug16k> in my efi code, I don't even use ms abi. it's elf. all my efi function pointers are tagged ms_abi though
<doug16k> because of that, my startup code has to preserve rsi, rdi, and store those global systab and image handle, then call the sysv main
<warlock> to me, elf, pe, coff... they are just file formats
<doug16k> normally you can clobber rsi, rdi
<doug16k> normally == sysv
<warlock> I do it basicly, cause I like to have a good understanding of all the details
<doug16k> the efi reference headers have EFIAPI, which I #define to __attribute__((__ms_abi__))
<warlock> that's it
<warlock> yea I seen that
<warlock> seems easy enough though, just pass stuff, basicly on rcx, rdx, r8, r9 and rest on stack
<doug16k> what you are doing should work
<doug16k> all you are doing is calling things on the systab?
<warlock> yea
<warlock> basicly it works on qemu
<warlock> just for some reason, when I call ConOut on hyperv
<doug16k> is the stack aligned?
<warlock> it resets
<doug16k> the stack pointer must be aligned at a 16 byte boundary before the call
<warlock> it should
<doug16k> the last hex digit should be 0
<doug16k> rsp = xxxxxxxxxxxxxxx0
<doug16k> right at the moment when singlestep will call
<warlock> wait
<warlock> at the beginning of my code
<doug16k> beginning is useless
<doug16k> don't even care what you did at the beginning
<warlock> ok
<doug16k> *the moment you execute call instruction* rsp must be 16 byte aligned
<warlock> ok, to be honest, I only touched rsp once at the beginning, and I subbed it by 32 bytes
<doug16k> here's why I don't care: if you call something, now it is misaligned. then you push? aligned now. then call again: misaligned
<doug16k> beginning is irrelevant. what matters is right when you call
<warlock> oh
<doug16k> at your entry point, the last digit of rsp is guaranteed to be 8
<warlock> 8 or 0 right
<doug16k> no!
<doug16k> 8 only
<warlock> ok
<doug16k> why? because the caller did it correctly and rsp was aligned right before call. call pushed 8 bytes
<doug16k> if rsp last digit is zero, (default sized) push is guaranteed to make last digit of rsp 8
<doug16k> so, at entry, the stack is guaranteed to be misaligned
<doug16k> if you push one thing, it is aligned
<warlock> alright now I get it
<doug16k> two things, misaligned
<doug16k> odd number: aligned, even number: misaligned
<doug16k> however, if you have stack parameters, you need to set it up so rsp is aligned at the call point, not at the prologue
<doug16k> see why they get machines to do it? :D
<doug16k> there's a trick that compilers use though, that makes it pretty easy
<doug16k> what they do is, they figure out the most stack parameters they will ever need in this function, then they subtract that much from rsp, then and rsp with -16 to align it
<doug16k> then they store into N(%rsp) to put the parameters there, no push
<doug16k> then call has it aligned easy
<warlock> let me see if I get this write, the call isn't going to use the stack other then the return address, as long as it doesn't use 4 variables
<doug16k> then you just stick rbp back into rsp or whatever
<warlock> other than
<warlock> it pushing the call address so, I need rsp to be 8 so the call makes the return a 0
<doug16k> what?
<doug16k> you make it so rsp last digit is zero before call
<doug16k> after call executes (1st instruction of function), last digit of rsp is 8
<doug16k> you get that guarantee as a callee - efi called you like a function. you can return!
<doug16k> you are a function
<warlock> are you basicly saying it doesn't pop it's address?
<doug16k> when they return ya it comes back to your original rsp before the call
<doug16k> is that what you mean?
<warlock> yea
<doug16k> yeah
<doug16k> ok I misunderstood. yeah their return brings it back to alignment
<warlock> ok basicly, every time I've called it, it returns, I haven't made other functions yet, so it should be aligned right
<doug16k> at your entry point, the stack is guaranteed to be misaligned
<warlock> oh ok
<warlock> I thought it would be aligned
<warlock> so just add 8 to it and I'm good
<doug16k> it seemed like you understood earlier when I explained that it has to be aligned before push, and push makes it subtract 8, so it is off-by-8
<doug16k> before call pushes return addr I mean
<warlock> yea, you call, which pushes or subs 8 off it
<doug16k> but again, it doesn't matter what it is way up there
<warlock> right it matters when I call it
<doug16k> yes. I was just making sure you understood that it is absolutely guaranteed that the stack is misaligned at the first instruction of a function
<doug16k> if it isn't, then the caller is screwing up pretty badly
<warlock> ok basicly I added a multiple of 16 to rsp at the top
<warlock> cause I thought it was aligned
<warlock> anyway
<doug16k> no
<doug16k> adding a multiple of 16 won't change whether it is 16 byte aligned or not
<doug16k> I said earlier
<doug16k> odd number of pushes, you are realigned, even number, you are misaligned again
<doug16k> imagine this:
<warlock> yea I know
<doug16k> call pushed 8 bytes. now it is off by 8
<warlock> I was saying what I did
<doug16k> now you push *one* register, now it is aligned
<doug16k> ah
<doug16k> this is the whole project you know?
<warlock> yea
<warlock> haha
<doug16k> just worrying about the stack frame and stuff
<doug16k> that's why I asked why not compiled :D
<doug16k> it is good exercise though
<doug16k> ideally, you should be able to be a human compiler
<doug16k> if you had to
<warlock> ok but just to make sure I get this
<warlock> I want the stack to be aligned, before the call instuction
<warlock> which if so, I get it now
<warlock> anyway weird that qemu hasn't complained
<warlock> if that's what hyper v is complaining about
<doug16k> abi violation is just weird behaviour, not guaranteed fail
<doug16k> that is what makes it so hard to notice
<doug16k> sometimes extremely weird
<doug16k> the codegen was certain that it knew rsp's last digit
<doug16k> because it "knew" rsp was misaligned at entry
<doug16k> it might do weird things like doing bitwise and on rsp
<doug16k> which fails catastrophically if it wasn't aligned how the compiler "knew" it was
<doug16k> because it is so obscure what code will trigger that, it shows up very weirdly
<warlock> woah woah woah
<warlock> I'm guessing you're a guy cause you're doug, and no homo, but I'm in love with you now
<warlock> it's working now haha
<doug16k> yay!
<warlock> is that the case for all 64bit code, or just uefi?
<doug16k> it's the same for sysv yeah
<doug16k> same problem for same reason
<doug16k> even i386 code needs the stack 16-byte aligned
<moon-child> depends on abi, you'll have to know what yours is, but most of them these days will want aligned stack
<doug16k> i386 code needs it the most. i386 code uses tons of autovectorization and will use movaps a lot
<doug16k> or movdqa
<doug16k> both of those throw if misaligned
<warlock> really I've been doing asm a long time, and never been checking that the return is on a 16 bit boundary
<moon-child> why i386 more than amd64?
<doug16k> moon-child, a lot more use of movdqa to zero stuff
<doug16k> or movq
<moon-child> but why?
<warlock> yea I thought it was only certian instuctions needed it
<doug16k> because it is 1 instruction 64 bits or more
<moon-child> does 64-bit have less need to zero things? Or less penalty for unaligned insns?
<warlock> like movups doesn't right
<doug16k> movups would be fine. the compiler thinks it is certain about the alignment though
<doug16k> moon-child, way more register pressure on x86
<moon-child> right
<warlock> ok well now I know, and knowing is half the battle!
X-Scale has quit [Ping timeout: 265 seconds]
<warlock> anyway I thought it always depended on the calling convention, and stuff like that
<warlock> doug16k: thank you
<doug16k> I always flip flop like that. I am like, "no! no! don't even do that man!" then two second later saying all the things you do to do that :D
<doug16k> an os project forces you to learn all about abis
<doug16k> I think exception unwind is one of the neatest things I have ever seen, so I am a bit of an abi enthusiast
<doug16k> it boils down to restoring callee saved registers pretty much
<doug16k> you use it to make stack traces work right, even if you never throw or catch
<doug16k> as in gdb bt backtrace
<doug16k> I am ecstatic that it is even possible to stack trace across an interrupt frame
<doug16k> or syscall entry
<doug16k> that's way out in "yeah right" territory
<doug16k> it needs to be that amazing for signal handler stacks to work, so we fluked out on that one
<doug16k> we just say it's a signal handler stack to gdb in the frame info and it does the right things
<doug16k> after you tell it how to get back
<doug16k> we say it is a signal frame in actual hardware interrupts or real cpu exception handlers I mean
<doug16k> it is a signal, really
<doug16k> asynchronously preempting the code and possibly switching to another stack is the description of syscall entry and cpu exception handlers
oldtopman has quit [Ping timeout: 264 seconds]
<doug16k> you could probably macro it up pretty good so it is tolerable to write assembly uefi stuff
<warlock> just read the manual, to see about it
<warlock> it seems to be ac flag is set
<moon-child> I saw an nasm macro library once, that gave you structured control flow and inline arithmetic expressions
<moon-child> at that point what's even the point of writing assembly?
<doug16k> warlock, ac flag doesn't alignment-check in cpl0
<moon-child> you've basically reimplemented c, poorly, with no register allocator
<warlock> ok
<doug16k> the only use of ac is if you enable SMAP, then ac=1 means don't fault if you touch user pages, ac=0 means please fault
<doug16k> maybe they set it to a never-smap-fault configuration? even if smap got enabled
<warlock> well I was reading call from the manual, so I was assuming it's either that, or something I called, thinking I called it aligned
<warlock> and calling an instruction that had to be aligned
<doug16k> trust me, ac never faults on misalignment in uefi
<doug16k> you can't
<warlock> to be honest, I could called BootServices and RuntimeServices, and it wasn't erroring, only when I used the console did it error
<doug16k> if you said, doug, please, I NEED alignment faults in cpl0. you can't
<warlock> If SSP in IA32_PLi_SSP (where i is the new CPL) is not 8 byte aligned.
<warlock> that's what I was reading
<warlock> who knows, doesn't really matter, I'll just make sure I'm aligned right now
<warlock> from now on
<doug16k> stack needing to be aligned has nothing to do with ac
<warlock> ok
<doug16k> it's because the compiler can generate better code if it maintains constraints on the stack frame
<warlock> alright
<doug16k> it can make a certain amount of assumptions
<doug16k> it's not all "maybe rsp is off by 1!"
<doug16k> you can kill it like that if you want if you can recompile the rom. -mrealign-stack on gcc
<doug16k> gcc will save the stack pointer in a register every time, and realign it from scratch
<doug16k> if you are alright with half a dozen instruction prologue
<moon-child> but you can't recompile the efi impl with that flag
<moon-child> sooo bit of a moot point
<doug16k> I am just mentioning that to contrast it with not using mrealign-stack. obviously it is better codegen to be able to just infer the stack alignment at a given point
<moon-child> right, yeah
theruran has joined #osdev
<clever> moon-child: that nasm macro thing you mentioned above, reminded me of bcompiler from https://web.archive.org/web/20170318033104/http://www.rano.org/bcompiler.html
<bslsk05> ​web.archive.org: Wayback Machine
<clever> moon-child: it starts out as just a dumb hex->binary program, written in bare assembly, and then incrementally builds more and more inteligent compilers
<clever> the final stage is a kind of stack machine (like lua), with somewhat high level macro's, and very little register use
<bslsk05> ​certik/bcompiler - Mirror of http://www.rano.org/bcompiler.tar.gz, with a bootstrap script (13 forks/58 stargazers)
<bslsk05> ​github.com: bcompiler/bcc.bc at master · certik/bcompiler · GitHub
<clever> an example function
<bslsk05> ​github.com: bcompiler/header.bc at master · certik/bcompiler · GitHub
<clever> a lot of that is just macro's, that insert a sequence of raw x86 asm into the output
iorem has joined #osdev
<warlock> basicly I looked at the manual, for what has to be be 16 byte aligned, seems like just sse and avx instructions, I might be wrong, but my guess is something thinks is aligned a certian way, and I obviously through it off by not being aligned, and I'm sure compilers do make sure it's always aligned
<warlock> anyway other than that I don't see it, at least not in intel manual
<moon-child> clever: ooh, neat, kind of like a proto-stage0
<bslsk05> ​oriansj/stage0 - A set of minimal dependency bootstrap binaries (33 forks/483 stargazers/GPL-3.0)
mahmutov has joined #osdev
piotr_ has quit [Ping timeout: 252 seconds]
<warlock> but I'm probably wrong, and if so, point me in the right direction to read about it
<clever> moon-child: i think the 2 biggest flaws with bcompiler, is that it never reached a point where it can compile real c, so your stuck in that custom language, and it doesnt support any other ISA
<clever> but if you understand the steps, you can reproduce them on another ISA
<clever> > This is a set of manually created hex programs in a Cthulhu Path to madness fashion. Which only have the goal of creating a bootstrapping path to a C compiler capable of compiling GCC, with only the explicit requirement of a single 1 KByte binary or less.
<clever> stage0 tacles that 1st problem as a direct goal
<clever> the first few stages of bcompiler, are mostly just getting labels and pc-relative working
<clever> so you dont have to count bytes yourself
<clever> but its never really a true assembler, it cant take nmemonics, only raw hex
<klange> bootstrapping projects are neat and all, but it's not really reflective of how... well, anything, really... works in reality.
<bslsk05> ​github.com: nixpkgs/unpack-bootstrap-tools.sh at master · NixOS/nixpkgs · GitHub
<klange> I think it would be more fun to taret something that was actually bootstrapped that way, good ol' front panel computers or something with punch cards.
<clever> in the case nix and nixpkgs, this shell script takes a pre-made toolchain (full binutils+gcc+others), and patches the elf headers, so it expects /lib in the right place
<warlock> ok ok, nevermind I found it, it's not the processor, that has those limits, it's uefi
<warlock> it's in the uefi docs
<clever> and then it uses that, to incrementally build a new toolchain
<warlock> from section 2.3.6.4 "The stack will maintain 16 byte alignment."
<kazinsal> it makes more sense to de-dependency a project than to attempt to start a project with no dependencies at all from the outset
<clever> klange: for bcompiler, it starts with a 191 byte ELF binary, that is a valid hex->binary conversion tool
<clever> klange: you COULD key that in with flip switches, but you kinda need a shell and kernel to run it.....
<kazinsal> eg. start with gcc/clang and nasm and ld etc and work your way into not needing it
<klange> kazinsal: that's one of my goals
<clever> it also lacks the ability to open anything for reading or writing, and relies on < and > to handle file io
<klange> And because I think writing another self-bootstrapping C compiler is boring, I'm going to write a C compiler in my knock-off Python clone that can build its interpreter.
<clever> so your shell needs to at least handle redirections
<kazinsal> eventually I'm going to put on my big programmer pants and switch from GCC to Clang
<kazinsal> but I don't plan on ever writing a compiler, because there are people who know how to do that better than I ever will
<klange> There are people who know how to do all the things I do better than I do them.
<clever> klange: there is this neat blog post: https://www.stephendiehl.com/llvm/
<bslsk05> ​www.stephendiehl.com: Implementing a JIT Compiler with Haskell and LLVM ( Stephen Diehl )
<klange> They're just generally a bunch of different people. Jack of all trades, master of none, but I really am aiming for a considerably large "all".
<clever> kazinsal: oops, meant that for you
<kazinsal> same, tbh. more accurately I guess it's more of a case of, compiler dev is way outside my domain
<clever> this blog post, is about how to use the llvm libraries from haskell, to write your own compiler
<clever> haskell already has a lot of good parsing libs, and often generates an AST for custom languages
<klange> Kuroko was a lot of fun and I learned a lot about parsing that somehow escaped me in my uni days.
<kazinsal> my osdev project is simply the intersection of my three main nerd domains: network engineering, systems programming, and hardware hacking
<clever> and this blog post is just about going one step further, translating that to llvm-ir, and compiling to native
<clever> it also reveals a lot of fun things you can do with llvm
<kazinsal> it's the year 2021 and I still have not learned python
<clever> you can either emit the compiled code as a .so file, or just dump it in ram, and immediately execute it
<clever> so you can use it as a JIT
<klange> Since the 2.0 goals are mostly just a matter of cleanup and polish at this point, it's time to look forward to what ToaruOS 3.0 will bring.
<kazinsal> SMP?
<klange> That's already in 2.0, and it's not completely unstable.
<kazinsal> Woohoo!
<klange> It's... not perfect, but I have a reasonable idea of where the remaining issues are and you can actually use it for a bit before it crashes.
<klange> And ideally resolving all of that is still on the 2.0 finalization list...
<klange> But it's a bit further down from things like "bring back some block drivers" and "gosh, that ext2 implementation sure could use a rewrite" ;)
<klange> 3.0 is gonna be finally taking over the world - eg. replacing gcc.
<kazinsal> Maybe my vacation week osdev goals will be "learn python" and "port kuroko to Araxes"
<klange> Shouldn't be too hard of a port with the optional stuff turned off - I built it for EFI, after all.
<klange> Hell I had a BIOS build...
<klange> The libc shim for that was a bit bigger, though.
<kazinsal> I want to try to hook it into my packet processing system
<klange> See, I can even manage to download and install quake with multiple cores running: https://klange.dev/s/Screenshot%20from%202021-06-17%2014-56-48.png
<kazinsal> Awesome!
<kazinsal> Other things on the to-do list for next week: finish the L3/L4 firewall, work on the routing mtrie code, and maybe write a better shell
<kazinsal> At the very least I'd like to rewrite how I handle commands and add command history. Possibly also add in autocomplete.
<klange> There's a pretty glaring issue with some of my synchronization and collections primitives and I have a good idea of how to fix it and it'll be helpful for the network stack.
<kazinsal> Oof, yeah, my locking primitives are really quick and dirty
<kazinsal> I'm not looking forward to seeing them fall apart at scale
mahmutov has quit [Ping timeout: 268 seconds]
Vercas has quit [Remote host closed the connection]
Vercas has joined #osdev
<klange> There's a lot of toctou issues where I have this blocking primitives that don't actually attach to any state, so you'll check if something is available and if not you'll block, and that worked okay for the most part with critical sections / non-preempting kernel and a single core... but SMP started breaking those things.
<klange> And I think I still have one that happens on the network stack even with a single core where it can start sleeping when there's already something available and it'll wake up later when a retransmit or another packet arrives.
piotr_ has joined #osdev
<doug16k> warlock, pdf page 17 https://www.uclibc.org/docs/psABI-x86_64.pdf
<doug16k> i386 and windows have the same rule
<doug16k> it has nothing to do with intel or the cpu
<moon-child> doug16k: sysv abi seems to be maintained by an intel employee ;)
<doug16k> libraries that expect to call one another normally must be using the same abi
<doug16k> for extremely small values of "maintain"
<doug16k> warlock, there is no red zone in cpl0 code, btw
sortie has joined #osdev
dennis95 has joined #osdev
Sos has joined #osdev
Giedrius has joined #osdev
<klange> wow i forgot i had a github wiki... https://github.com/klange/toaruos/wiki/2.0-TODO ← last edited four years, seems reasonably accurate, though the VFS never got a real rewrite because it didn't really need one.
<bslsk05> ​github.com: 2.0 TODO · klange/toaruos Wiki · GitHub
nur has quit [Quit: Leaving]
GeDaMo has joined #osdev
<warlock> doug16k: thanks
<warlock> you're awesome, if you didn't help, I'm sure I would still be going crazy wondering why it doesn't work
<warlock> also thnx for the pdf, and yes I did see the intel manual was saying it was in ring 3 where the exceptions happened, but I was just stating that, because I'm not sure about how uefi sets up pmode, was thinking I might be calling into something in ring3
<moon-child> efi is all ring 0; if you wanna do privsep you have to tell it to fuck off first
<warlock> anyway like I said, thank you, thank you, thank you
<warlock> yea I figured that it was
<warlock> moon-child: question, is there any reason to really exit bootservices, or to keep it around
<Mutabah> You can't do your own task and hardware management with boot services active
<moon-child> if you want to make a regular OS, you should get whatever you need from efi and exit bootservices
<moon-child> if you want to make an efi application, then keep boot services around
<klange> take what you need and gtfo, like you're pillaging a store in a disaster or robbing a bank
<warlock> ok
<klange> unrelated; random idea for a new terminal escape sequence: change a GUI terminal emulator's menubar entries with new entries that insert escaped string sequences.
gareppa has joined #osdev
<GeDaMo> Couldn't you do that with function keys?
<moon-child> why are we still layering more millstones onto the already overloaded camel that is term escape sequences
<klange> No? I mean I have an app running full-screen in a terminal, like my editor... normally the terminal has "File", "Edit", etc. - stuff for controlling the terminal.
<Mutabah> Hmm... a GUI programmed via a text channel
<klange> moon-child: Because it's actually kind of nice to have in-band communication.
<GeDaMo> Yeah, but the "insert escaped string sequences" part
<moon-child> yes, but vt 10000 is not a great way to do it
<klange> Sorry, mixing up idea and implementation detail:
<Mutabah> moon-child: Why not?
<moon-child> e.g. arcan-tui
<klange> Application says "set the menu bar to have these menus with these entries". Clicking those menu entries returns an identifiable input.
<Mutabah> (Wait, do you mean the vtXXX is a bad protocol? or that you shouldn't be extending it?)
<klange> Thinking about how the application might be in various modes, having the menu entries stuff escaped predefined strings so the app can always identify them vs. regular typing.
<moon-child> Mutabah: broadly, what you want is structured data and interaction. Vt100 and text streams don't provide that. Mind, they're still better than the gui status quo, because the latter don't compose; but that's not a fundamental limitation
<klange> Like I say [seq start]File:Open=open,Save=save;Edit:Copy=copy[seq end] and now the menu bar has those things and I click "Open" and it sends [some magic]open[end magic].
<klange> (Mostly thinking the displayed title may be localized, duplicated, etc., so it would be unsuitable as the returned input)
<moon-child> klange's proposal _adds_ structure, and structure is good, but you can't turn vt100 into a general protocol for structured data and interaction
<klange> But it already is one? It has all sorts of structured sequences, and best of all we've all managed to start agreeing on them, even Microsoft.
<Mutabah> moon-child: Oh definitely, I wasn't thinking of using vtXXX for my idea
<moon-child> klange: it's not structure. It's styling attributes of slices of text. You can't represent a tree using escape sequences, for instance
<GeDaMo> Lisp represents trees using ()
<klange> I think you're confusing one particular sequence (m) for the whole of the system...
<klange> 'm' is... rather messed up, the 24-bit color stuff kinda threw a wrench into what little structure it had to begin with.
<moon-child> Mutabah: sorry, what was your idea? I think I'm missing context. 'GUI programmed via a text channel'? I agree that's a good idea
<klange> But the other command sequences, like the ones that already drive key functionality like half of your keyboard keys or being able to interact with a tui app using a mouse, those are structured just fine.
<bslsk05> ​en.wikipedia.org: Table of keyboard shortcuts - Wikipedia
<moon-child> klange: those aren't structure; those are primitives that individual applications can use to implement structured interactions
* Mutabah vanishes for the commute home
<moon-child> and then you lose a ton of composability. I can't meaningfully pipe alpine into something, for instance
<klange> That's a completely unrelated topic, though.
<moon-child> why?
<moon-child> (I think we may be talking at cross purposes :P)
piotr_ has quit [Remote host closed the connection]
<klange> Because I'm talking about running an editor in a terminal and pipes have nothing to do with it. I gain benefits from in-band metadata because I can do that over SSH, or serial, or blatted through any of a dozen other dumb pipes and still get syntax highlighting on the other end.
gareppa has quit [Quit: Leaving]
piotr_ has joined #osdev
<moon-child> right. I agree that a vt100 texteditor + in-band menu items is superior to a vt100 texteditor without in-band menu items. But I think that a superior approach to both is a hypothetical alternate protocol which is structured at the lowest level
<klange> Terminal escape sequences were that, though, and as an improvement over dumb terminals that just printed characters to paper... the trouble is the "lowest level" moved. If all you have is the character cell terminal, then commands for "move output coordinate to here, set color to this, here's some text" _is_ the low-level. Widgets or data are a higher level abstraction. I love the idea of composable tools,
<klange> but I also want to work within the constraints of the existing ecosystem.
<klange> Hm, libera's line length limit is a lot shorter than The Old Place.
<kingoffrance> oh i dunno it sounds reflective to me, so i am in favor generally. it really just strikes me as similar to escape sequence can set title bar and extending that; although yeah, i would be weary of escape sequences getting stuff no real hardware terminal ever had. i basically already had this convo with someone :)
<klange> I actually think there were real hardware terminals that had configurable menus - there were definitely ones that had configurable titles and dedicated a line to them.
<kingoffrance> yeah, that sounds cool, that would tip me over a bit
<klange> (no clue if the remnant escape sequence for title setting derives from that or if it was invented for xterm)
<kingoffrance> its more of a "is this the right place" sort of thing
<moon-child> klange: max line length per irc spec is 512. Your message was 426 chars. Weird it got truncated...
freakazoid333 has quit [Read error: Connection reset by peer]
<moon-child> s/truncated/split/
<klange> 512 for the whole message including the command portions at the beginning, also that's a minimum.
<moon-child> yeah, I counted the command bit
<moon-child> 'IRC messages [...] shall not exceed 512 characters in length' it is a maximum
<klange> Which spec is that from? There's like five different erratas before you even get to IRC2.
<moon-child> rfc 1459. Checking updates...
<moon-child> heh, 2813 updated it to say SHALL NOT
Burgundy has joined #osdev
<moon-child> and 2812 says 'IRC messages are limited to 512 characters in length'. Can't find anything in any of the others
<klange> 1459 was experimental, the 281x series are informational, so none of them claim to describe a standard; the 281x series is mostly intended as "if you follow this, your client will work with ircd 2.10"
<kingoffrance> i guess to me the line between overengineered overkill abstraction hell and hacked to do something new beyond recognition really depends on what the features as a whole are, how much something is expected to "grow", etc.
dormito has quit [Ping timeout: 244 seconds]
<kingoffrance> its not bloat if you really want some feature :) it is to go build things without any conceivable use. re: whether that is proper place or build something else
<warlock> doesn't it also include PRIVMSG #CHANNEL and the CRLF at the end as part of the 512 limit
<moon-child> 512 is for any command, not just a privmsg. It does mention that the actual length of a given command will be <=510 because of the terminator
<warlock> yea
gareppa has joined #osdev
gareppa has quit [Remote host closed the connection]
mctpyt has quit [Ping timeout: 272 seconds]
<klange> I think a major problem holding back a lot of command line utilities is actually this idea that your output is probably going to end up on a terminal. Terminal escape sequences are actually great - if you're writing something that you know _absolutely_ will end up a terminal. Colorful prompts, syntax highlighted editors, mouse input, bold, italic, underline, scroll regions, it's all fantastic and the
<klange> format's really not too bad and it's a testament to its viability that we've landed on such a large common subset that you can throw ncurses/terminfo out the window and just blat most of this stuff out with confidence that it will work...
<klange> But the problem of utilities that try to cater to both a human reader and a machine reader dates back to before glass terminals, before escapes of any kind.
<klange> It's something that's been with unix since the beginning. I think recent attempts at building new shells are misguided, though, as the problem isn't from _pipes_ - pipes don't give a shit what you write to them, it's all just bytes in the end - nor is the problem in how the commands are composed, which is clearly evidenced by things like powershell using the same syntax as everything else.
<klange> The problem comes from that attempt to fill both roles simultaneously.
<GeDaMo> Maybe you want some kind of markup language that can be translated to the actual display device :P
<klange> That's what escape sequences are, in the end. Not a great one, but... at least they're not XML.
<immibis> xml seems okay for formatting. that's what it's designed for. no?
<klange> Some tools have gotten better. GNU coreutils implementations regularly check if the other end is a real terminal so they can offer colored output, but while it would have been totally normal end expected to pipe `ls` into something to use lists of files, the backwards-compatible-with-humans approach to output has led to massively obvious problems.
<immibis> except you'd like to have a continuous stream instead of a document
<klange> XML was not designed for _formatting_, it was designed for a combination of structure and human-writability. There's classes of data it's great at representing, and classe it's terrible at.
<immibis> html is designed for formatting, xml is generalized html, more-or-less
<klange> Absolutely not.
<immibis> that's probably not where they actually came from
<klange> They two are hardly even related, they just look similar.
<immibis> but in what way is xml not generalized html?
<kingoffrance> i thought it was other way around, html is specifized xml, but i dont know history
<klange> They share a common ancestor.
<klange> HTML is derived from HTML, specifying particular keywords for formatting documents.
<klange> SGML was a general markup language - that's literally the last three letters (the first ones Standard)
<klange> XML is derived from SGML and was intended to make parsing it more regular and straightforward. It's why XML has things like <automatically-closed-tags/> and <namespaced:elements>
<klange> But markup should not be confused with _formatting_. Formatting is a subset or an aside to markup. Markup is about attaching additional semantic data. Formatting hints can be one such thing - HTML was originally focused on markup with presentation semantics, though it's moved heavily away from that to structural semantics with HTML5.
<klange> (CSS took over the application of presentation semantics to structural elements)
<klange> But that debate is somewhat moot. I don't care much for what the language in the middle is, the real problem is in standardizing what is represented in it.
dormito has joined #osdev
<kingoffrance> yeah, thats why color in unicode scares me
<klange> PowerShell skipped that step and cheated and I think it solves the problem poorly because of it - PowerShell "pipes" actually pass around objects, not serialized data that can be generally processed.
<klange> Be it XML, JSON, protobufs, the actual representation doesn't matter, and I think a lot of projects have the right _idea_. The power of the classic Unix pipeline was composability, and we can still use that pipeline - it's the stuff that gets thrown through it that needs to change.
<klange> Imagine a unix pipeline where every command was built like `jq` - JSON in, JSON out - combined with a large corpus of data types so an "ls.json" can output a known format for a "list of files" and a "sort.json" can understanda myriad of structured inputs...
<klange> The true pain of classic Unix utilties is that we have to build this structure from text meant for human eyes, using 'cut' and 'sed'...
<klange> I don't think it helps that so many otherwise-computer-literate people conflate the concepts of a terminal, shell, and utilities.
<HeTo> sort wouldn't have to understand a myriad of structured inputs as such, it should be enough if it understands arrays and if it's arrays of objects, the user can specify the attribute by which they should be sorted
<klange> Yes, but like Make it would be nice to have a bunch of default rules.
<klange> so that you don't say "of course i wanted to sort by file name by default, isn't that obvious?" :)
iorem has quit [Quit: Connection closed]
<klange> (in this example you can even just replace a bunch of commands with jq magic!)
Arthuria has joined #osdev
nur has joined #osdev
amanita_ has joined #osdev
<clever> klange: ive heard that powershell tries to do more structured data over pipes
amanita has quit [Ping timeout: 244 seconds]
<klange> It does not. It doesn't do anything over pipes. It steals pipe syntax and sends unserialized objects "through" them.
<klange> PowerShell solves the wrong problem. Bash is not the enemy. Zsh is not the enemy. Even POSIX sh is not the enemy.
<klange> The enemy is 'cut' and 'sed'. The enemy is 'ls', the space character, columns of human-readable text.
<klange> Hell, scratch that last line, 'cut' isn't even the enemy, it's not cut fault you had to use it because your data was garbage.
<klange> We're trying to metaphorically parse HTML with regex here and it needs to stop. We're building the equivalent of page scrapers when we should building APIs and clients.
Arthuria has quit [Killed (NickServ (GHOST command used by Guest684531!~user@user/arthuria))]
Arthuria has joined #osdev
<froggey> bash & sh might not be your enemies but they're definitely mine
<clever> klange: yeah, i had a feeling it was cheating behind the scenes
<mjg> :)
Arthuria has quit [Read error: Connection reset by peer]
Arthuria has joined #osdev
Giedrius has quit [Ping timeout: 268 seconds]
pretty_dumm_guy has joined #osdev
iorem has joined #osdev
dude12312414 has joined #osdev
Arthuria has quit [Ping timeout: 272 seconds]
isaacwoods has joined #osdev
ahalaney has joined #osdev
gog has joined #osdev
nyah has joined #osdev
piotr_ has quit [Ping timeout: 244 seconds]
Arthuria has joined #osdev
<immibis> what if the real enemy is '|'? quick hacks instead of actual programming
mctpyt has joined #osdev
<immibis> perhaps it made sense in 1970 when they couldn't write parsers very well
<immibis> but now you could write a little python loop in your shell
<immibis> or something akin to that anyway. doesn't have to be python. something with static types
<immibis> instead of `find | xargs grep foo` you write something like `[parallel] for(file : find(".")) {for(result : search(file, "foo")) {print(result)}}`
<immibis> more verbose but also way more accurate
<immibis> your shell is then a REPL
<kingoffrance> yes, but where is the 2021 shell/os then? i mean why is that 1970s utils fault?
<kingoffrance> why go 1/2 way?
<immibis> ?
<kingoffrance> could you rip out all the old stuff and do that?
<kingoffrance> build a whole os that way?
<immibis> me? I don't have time. Someone else? probably. But it won't be compatible
<kingoffrance> sure. it does not have to be one way or other, but i think "technical debt" of some sort build and builds
<kingoffrance> you realize the irony of dont have time and quick hacks :)
Arthuria has quit [Read error: Connection reset by peer]
Arthuria has joined #osdev
Arthuria has quit [Read error: Connection reset by peer]
Arthuria has joined #osdev
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
dennis95 has quit [Quit: Leaving]
mahmutov has joined #osdev
dennis95 has joined #osdev
X-Scale has joined #osdev
Arthuria has quit [Read error: Connection reset by peer]
Arthuria has joined #osdev
<kingoffrance> "technical debt" not necessarily that anything rots, but i mean even if its just joe average programmer familiarity with "old" things
<kingoffrance> *decreasing level of familiarity
Arthuria has quit [Read error: Connection reset by peer]
Arthuria has joined #osdev
pretty_dumm_guy has quit [Quit: WeeChat 3.3-dev]
<gog> gnu-efi has ascii strings as uint8
<gog> this is annoying
srjek_ has joined #osdev
iorem has quit [Quit: Connection closed]
gmacd has joined #osdev
Arthuria has quit [Read error: Connection reset by peer]
Arthuria has joined #osdev
piotr_ has joined #osdev
<klange> I added a silly little classic /-\| spinner to my bios loader because I have no concept of priorities and am easily amused.
<gog> same
Arthuria has quit [Read error: Connection reset by peer]
Arthuria has joined #osdev
<klange> oh no it's way too fast in qemu on my destkop, but it's just right on my surface where qemu under nested kvm in wsl2 is loading a lot slower...
<klange> but if I slow it down to a reasonable rate on the desktop it only makes one revolution, this is quite the quandry
freakazoid333 has joined #osdev
<gog> do a polling loop on the PIT
<gog> unless that's what you're already doing :p
HeTo has quit [Read error: Connection reset by peer]
vdamewood has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
HeTo has joined #osdev
immibis has quit [Read error: Connection reset by peer]
immibis_ has joined #osdev
flx has quit [Quit: Leaving]
flx has joined #osdev
Arthuria has quit [Read error: Connection reset by peer]
Arthuria has joined #osdev
vdamewood has joined #osdev
Sos has quit [Quit: Leaving]
mahmutov has quit [Read error: Connection reset by peer]
gmacd has quit [Remote host closed the connection]
pretty_dumm_guy has joined #osdev
srjek_ has quit [Ping timeout: 272 seconds]
<jeaye> Slow down your bios loader so you can show more of the animation.
piotr_ has quit [Ping timeout: 244 seconds]
<mjg> i love the spinner
<mjg> in the bsd loader the func which nudges it is called twiddle()
<johnjay> what's a simple speed test i can run to tell if virtualization is happening?
<johnjay> some kind of openssh tests or something?
Arthuria has quit [Read error: Connection reset by peer]
<johnjay> when i google i just get elaborate ways to grep for the cpu speed in /proc
Arthuria has joined #osdev
<johnjay> i guess sysbench is a thing for this
Arthuria has quit [Read error: Connection reset by peer]
<mjg> from userspace under linux?
Arthuria has joined #osdev
<mjg> i would expect the fact that you are virtualized is exposed somewhere
<mjg> i mean short of writing malware which tries to avoid reverse engineering attempts you should not be trying any trickery
<mjg> s/short of/if not/
<johnjay> the issue is virtualbox has some confusing options. it lets you present kvm virtualization to a guest even if you're host system is windows
<mjg> it's about driver support by the guest os
<johnjay> so i want to see if i enable an option in windows if it results in actually taking advantage of the virtualization
<mjg> they just implement kvm-like interface for net, disks and whatnot
freakazoid333 has quit [Read error: Connection reset by peer]
<mjg> linux should attach virtnet devices, which should be easy to verify
<mjg> whether this will be any faster on your box that's hard to say. it's probably a good idea to roll with it anyway
<johnjay> oh ok
freakazoid333 has joined #osdev
Arthuria has quit [Read error: Connection reset by peer]
Arthuria has joined #osdev
freakazoid333 has quit [Read error: Connection reset by peer]
vdamewood has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
piotr_ has joined #osdev
immibis_ has quit [Remote host closed the connection]
<sortie> PSA: I have coffee and bugles.
<sortie> It's also the wrong channel but I am not bugless
mahmutov has joined #osdev
<johnjay> maybe i'm overthinking this. is the easiest way to get more performance out of virtualbox just to allocate a fixed disk?
<johnjay> either that or go with LXDE desktop
immibis_ has joined #osdev
sortiecat has joined #osdev
Arthuria has quit [Read error: Connection reset by peer]
Arthuria has joined #osdev
sortie has quit [Ping timeout: 268 seconds]
sortiecat is now known as sortie
<GeDaMo> When I had a low powered machine, I used ratpoison as my window manager
simpl_e has quit [Remote host closed the connection]
Arthuria has quit [Read error: Connection reset by peer]
Arthuria has joined #osdev
simpl_e has joined #osdev
asymptotically has joined #osdev
<johnjay> that sounds like a terrible name.
<GeDaMo> I think it's mainly because it didn't use a mouse :P
<johnjay> well. the name didn't suggest that to me at all
<johnjay> it was more like... this window manager will slowly degrade your experience over time
<bslsk05> ​www.nongnu.org: ratpoison: Say good-bye to the rodent
<kazinsal> the phrase "the virtual terminal market" is doing weird things to my brain
Arthuria has quit [Read error: Connection reset by peer]
Arthuria has joined #osdev
sortie has quit [Ping timeout: 268 seconds]
Arthuria has quit [Read error: Connection reset by peer]
Arthuria has joined #osdev
Arthuria has quit [Read error: Connection reset by peer]
Arthuria has joined #osdev
mahmutov has quit [Ping timeout: 268 seconds]
mahmutov has joined #osdev
sortie has joined #osdev
piotr_ has quit [Ping timeout: 272 seconds]
dennis95 has quit [Quit: Leaving]
tacco has joined #osdev
Arthuria has quit [Read error: Connection reset by peer]
Arthuria has joined #osdev
xenos1984 has quit [Ping timeout: 272 seconds]
xenos1984 has joined #osdev
freakazoid333 has joined #osdev
Arthuria has quit [Read error: Connection reset by peer]
Arthuria has joined #osdev
netbsduser` has quit [Remote host closed the connection]
Arthuria has quit [Read error: Connection reset by peer]
Arthuria has joined #osdev
Sos has joined #osdev
GeDaMo has quit [Quit: Leaving.]
NieDzejkob_ has joined #osdev
NieDzejkob has quit [Ping timeout: 272 seconds]
travisg_ has joined #osdev
PotatoGim_ has joined #osdev
<sortie> The MBR is defined in terms of sectors. How do I know the sector size that it uses?
<sortie> Is it _always_ 512 bytes in practice?
nshp has quit [Killed (NickServ (GHOST command used by n_shp))]
<sortie> I got e.g. CD-ROMs with a 2048 byte sector size with a MBR measured in 512 bytes
nshp has joined #osdev
Arthuria has quit [Ping timeout: 268 seconds]
travisg has quit [*.net *.split]
PotatoGim has quit [*.net *.split]
travisg_ is now known as travisg
PotatoGim_ is now known as PotatoGim
<geist> sortie: probably a more realistic case is encountering one on a 4K hard sectored device like an nvme
<geist> and i guess the answer is: yeah it's still 512, even if the underlying sector is larger
<geist> side note, in case you want to experience a 4K hard sectored drive, looks like the relatiely cheapo western digial blue NVMEs can be reformatted as 4K
<sortie> Super duper, geist :)
<sortie> I do support other block sizes for GPT where it's unambiguous
<sortie> The neat thing about GPT is that it's at sector 1 rather than 0, so you implicitly know the size if you find it
<sortie> (and you can confirm with the footer if you want)
<sortie> I had a commit fixing it to be always 512 bytes but I needed to be sure before I could merge it
<sortie> Forward thinking me put in support for other sector sizes but little did I know MBR didn't support that in practice
<warlock> I should check into that, but this is how I thought it worked, basicly everything is 512 for the size, but you're allowed to read multiple sectors as long as the head or cylinder doesn't change
<warlock> so they divide that up, to make the blocks bigger
<warlock> anyway it's usually stored in the format of the file system, what the block size is
<sortie> Mind you that this is the sector size :)
<sortie> Needed to even know where the partitions are without guesswork
<sortie> My system will handle if the filesystem has an inefficient block size that at least one real sector, but it will degrade performance of course
catern has joined #osdev
<sortie> But of course MBR Sector Size != Drive Logical Sector Size != Drive Actual Preferred Sector Size
<warlock> yea, I was just saying I belive it's just for example, writing 8 sectors at a time for 4096 block size
<sortie> :)
<sortie> But geist helped me merge a commit, so geist gets a gold star
tacco has quit []
<geist> yay
thinkpol has quit [Remote host closed the connection]
thinkpol has joined #osdev
thinkpol has quit [Remote host closed the connection]
thinkpol has joined #osdev
thinkpol has quit [Remote host closed the connection]
thinkpol has joined #osdev
asymptotically has quit [Quit: Leaving]
warlock has quit [Quit: Lost terminal]
<doug16k> warlock, there is no such thing as heads and cylinders anymore. it's LBA
<kc8apf> except it's still heads and cylinders inside the drive
<doug16k> why is it that people can't resist arguing
<doug16k> the counterexample olympics
<doug16k> no such thing as spanning cylinders like warlock said
<doug16k> no boundaries
doug16k has quit [Quit: Leaving]
Sos has quit [Ping timeout: 240 seconds]
srjek_ has joined #osdev
<hgoel[m]> finally figured out the issue that was leading to my rtl8169/rtl8168 series driver to not work on one machine but work on others
<hgoel[m]> found that freebsd had a similar issue, where it was almost as if the NIC never received the correct rx descriptor address, their fix was to change when the rx/tx rings were enabled, that didn't work for me
<hgoel[m]> so on a hunch I tried splitting the address write into two 32-bit writes
<hgoel[m]> and that did the trick!
<hgoel[m]> a bit odd since my much older laptop didn't mind the 64-bit write, but the newer chip in the atomic pi did
dormito has quit [Ping timeout: 252 seconds]
<hgoel[m]> I think I'll update the article on the chip on the wiki, since I feel the article doesn't make it obvious how many of realtek's current NICs are essentially versions of the 8169
Arthuria has joined #osdev
Arthuria has quit [Read error: Connection reset by peer]
Arthuria has joined #osdev
pretty_dumm_guy has quit [Quit: WeeChat 3.3-dev]
Arthuria has quit [Read error: Connection reset by peer]
Arthuria has joined #osdev
Arthuria has quit [Read error: Connection reset by peer]
Arthuria has joined #osdev
richbridger has joined #osdev
Burgundy has quit [Ping timeout: 268 seconds]
amanita_ has quit [Ping timeout: 252 seconds]
dormito has joined #osdev
amanita has joined #osdev
ahalaney has quit [Remote host closed the connection]
freakazoid333 has quit [Read error: Connection reset by peer]
mahmutov has quit [Ping timeout: 268 seconds]
NieDzejkob_ has quit [Ping timeout: 264 seconds]
freakazoid333 has joined #osdev
<kazinsal> hgoel[m]: Good find! I wonder if the datasheet has some tiny fine print asterisked disclaimer somewhere that says "please don't do 64-bit writes, do two 32-bit ones instead".
NieDzejkob has joined #osdev