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
<clever> output '/nix/store/yrgc7l63dq8n235myz9pj48pj2s5fi7n-system-path' of '/nix/store/2xmanfhyvgq378arnv2y5vfz5hqz0dwh-system-path.drv' differs from previous round
<clever> by default, it only says this
<clever> output '/nix/store/yrgc7l63dq8n235myz9pj48pj2s5fi7n-system-path' of '/nix/store/2xmanfhyvgq378arnv2y5vfz5hqz0dwh-system-path.drv' differs from '/nix/store/yrgc7l63dq8n235myz9pj48pj2s5fi7n-system-path.check' from previous round
<clever> but it says this, if i say to keep the failure
<clever> Binary files /nix/store/yrgc7l63dq8n235myz9pj48pj2s5fi7n-system-path/share/icons/hicolor/icon-theme.cache and /nix/store/yrgc7l63dq8n235myz9pj48pj2s5fi7n-system-path.check/share/icons/hicolor/icon-theme.cache differ
<clever> and diff -r then says this
<clever> sortie: but all of the differences are in the binary portion of the file, so id need to dive into the source and figure out what they mean, and how they are generated
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
Matt|home has joined #osdev
zoey has quit [Ping timeout: 250 seconds]
jjuran has quit [Ping timeout: 265 seconds]
jjuran has joined #osdev
ElectronApps has joined #osdev
tacco has quit []
ElectronApps has quit [Ping timeout: 258 seconds]
heat has joined #osdev
Skyz has joined #osdev
<Skyz> Anyone here?
<Mutabah> Yep
<Skyz> "Alas, as digital technologies have become increasingly more complex, this clarity is all but lost: the most fundamental ideas and techniques in computer science --- The very essense of the field --- are now hidden under many layers of obscure interfaces and proprietary implementations."
<Skyz> Nand to tetris teaches how to build a spartan 16-bit computer
<Skyz> At it's core the "Jack OS" it has can be extended anyway you want
<Mutabah> Oh, you were just wondering if there's someone here to hear you ramble
<Skyz> Is this rambling?
<Skyz> I'm wondering if people want to contribute
<Mutabah> Well, I wasn't seeing any coherent link between your statements above
<Skyz> The nand to tetris course is something every os developer should know if they want to build a modern computer
<Skyz> and not recreate unix
<Skyz> Basically the interfaces and proprietary implementations part is what could be improved
<Skyz> Fine, I'm rambling
<Skyz> There is a goal though
<Skyz> Mutabah, how is your OS coming along?
<Skyz> You say you want simplicity in your OS?
<Mutabah> I'm on other projects currently
<Skyz> What kind?
<Mutabah> compiler
<Skyz> You should take a look at the compiler in "Elements of Computing Systems"
<Skyz> It's a barebones compiler for the "Jack" language and works fully to extend the language
<Skyz> Fully extensible*
<Mutabah> You seem to be assuming I'm only just starting
<Skyz> What kind of a compiler?
<Skyz> Language
<bslsk05> ​thepowersgang/mrustc - Alternative rust compiler (re-implementation) (74 forks/1450 stargazers/MIT)
<Skyz> rust seems popular these days
<pony> Skyz: I ordered the 2nd edition of that book, still waiting for delivery
<zid> Mutabah: Oh if they merge that can we not have rust bootstrap itself as awkwardly and take 20GB of diskspace to install?
<bslsk05> ​ifunny.co: When you're out of RAM: HAVEN MEMORV - )
<Mutabah> zid: It's not really something to "merge"
<zid> git submodule it then
<zid> whatever they wanna do
<Mutabah> (... why did I quote that)
<Mutabah> What sort of awkward are you worried about?
<zid> idk, I built it the other day, and I think it built itself a couple of times, probably why it takes >20GB
<Mutabah> A full rebuild takes two/three builds
<zid> and rust binaries are huge af
<zid> I recommend a 1TB ssd :P
<Mutabah> first builds with the downloaded (old) compiler, second with the newly build (new) compiler,
<Mutabah> and then an optional verification build
sts-q has quit [Ping timeout: 258 seconds]
<zid> I think I actually built that first compiler, not sure it's allowed to download binaries
<heat> how do you build the compiler without a rust compiler?
<heat> magic?
<zid> with a real compiler
<zid> like mrustc
<Mutabah> With a bootstrap compiler
<Mutabah> same as with gcc
<heat> yes exactly
<zid> (with gcc)
<heat> gcc doesn't compile rust
<Mutabah> originally, that compiler was ocaml
<zid> it doesn't have to
<heat> (yet)
<heat> rust does have a gcc backend now or whatever that's called
<zid> have you never considered bootstrapping before heat?
<heat> i have
<zid> You write a crappy compiler in C, and compile that, then compile the compiler with it
<zid> then recompile the compiler with itself for codegen
<heat> except that only works if rustc isn't written with newer features of the language in mind
<heat> (which it probably is)
<zid> you can check out an older tag
<zid> and do yet another build
<zid> where the compiler supported it but wasn't yet written with it
<zid> you have to do that with gcc now because of C++
<heat> from what I know bootstrapping rustc is way harder
<heat> that's why mrustc is a thing
<zid> yea, that's why I asked if bootstrapping rust would use "not 20GB of diskspace now"
gog has quit [Ping timeout: 258 seconds]
<zid> mrustc*
<Mutabah> building with mrustc won't change disk space or time much over doing a standard download+build
<heat> i highly doubt you bootstrapped the whole way
<zid> idk I'd have to check
<heat> the standard rust build just has two stages
<Mutabah> what it does is break the bootstrap chain from being from ocaml through ~300 versions
<kingoffrance> young innocent naive Skyz " the most fundamental ideas and techniques in computer science --- The very essense of the field " technology was never its own field, use a dictionary to confirm. </rant>
<heat> Mutabah, can't you skip like most versions with mrustc?
<Mutabah> heat: That's the idea
<heat> should be faster no?
<zid> okay looks like it binary depends on rust for certain combos of upgrade paths
<Mutabah> Faster than a first principles sure
<Mutabah> but not faster than the suggested approach of downloading the previous beta as a bootstrap
<heat> yeah
<zid> this ebuild has a super complicated script for figuring out required disk space heh
<zid> It starts at 8GB then adds various amounts for various flags, plus anything it needs for bootstrapping etc
<zid> This might be the longest ebuild I've seen
<Mutabah> Just download rustup
<bslsk05> ​gitweb.gentoo.org: rust-1.53.0.ebuild « rust « dev-lang - repo/gentoo.git - Official Gentoo ebuild repository
<heat> the rust toolchain is not that large lol
<heat> the arch package is 500MB installed
<zid> bin-rust != rust
pwng has joined #osdev
<heat> do you keep the object files?
<zid> you need them while you're building it
<zid> gcc ^$ -o @$; rm @$ doesn't get you very far
<heat> judging software on the amount of .o size they output is not the greatest thing in the world
<zid> It is when your build ends up i/o limited because of it lol
<heat> how often do you build packages?
<zid> all of them
<heat> well, case closed
<zid> and, when I decide to
Skyz has quit [Quit: Skyz]
mctpyt has joined #osdev
<geist2> yah rust likes to compile everything from scratch most of the time
<geist2> i've been fiddling with it this weekend too, starting to get ahandle on it
<klysm> gcc $^ -o $@; rm $@; ...no?
<heat> heads up for anyone using bleeding edge distros: the last mtools update broke grub-mkrescue
<heat> (or at least mtools is broken, probably this)
justyb11 has joined #osdev
freakazoid334 has quit [Read error: Connection reset by peer]
freakazoid333 has joined #osdev
Robbe has quit [Ping timeout: 268 seconds]
nyah has quit [Ping timeout: 268 seconds]
justyb11 has quit [Quit: Leaving]
<geist> a little surprising that mtools has changed that much, but maybe its one of those new compiler old code problems
heat has quit [Ping timeout: 255 seconds]
ChanServ has quit [shutting down]
mctpyt has quit [Remote host closed the connection]
ChanServ has joined #osdev
<klange> ... appropriate host...
<klange> I am apparently connected `zirconium.libera.chat`
janemba has quit [Ping timeout: 256 seconds]
<klange> I have the whole week off between some local holidays, a company holiday, and regular ol' vacation time for the gap.
<klange> And it is quite hot out, so my usual distraction of spending time out on the road on one of my bikes or in my car is less appealing.
<klange> So I might make some solid progress on my TODO list for 2.0
<Mutabah> Positively balmy</aussie>
<moon-child> my
<klange> For being a giant island, you Aussies don't get the humidity we have here in animeland.
<geist> do you get the cicadas? in animes that's always a 'it's summer' trope
<klange> Come to think of it, I haven't heard many this season.
<klange> Hm, would this panel widget look better with the full month name...
<klange> Wait, didn't I used to show the full month name in the Python one...
<klange> It's not like I don't have %B, why did I switch... did I write this in May or something...
<klange> "July" totally used the full month name in the Python version
<klange> Oh the original C version used the abbreviated month names, and when I replaced the Python version I worked from that, so it reverted. Oops.
wille has joined #osdev
<klange> Needs a bit more space to fit longer month names...
<klange> Maybe should dynamically space that, but for now I'll just bump the macro'd size to 92 pixels, that should fit September 29th okay.
<moon-child> hey, that's my birthday!
srjek has quit [Ping timeout: 255 seconds]
pwng has quit [Ping timeout: 252 seconds]
pwng has joined #osdev
MarchHare has quit [Ping timeout: 255 seconds]
ElectronApps has joined #osdev
lucf117 has quit [Remote host closed the connection]
<pwng> for the 8259 in the brokenthorn manual; its said that on an interrupt generation by a device connected to the PIC:
<pwng> 4. The PIC signals the processor through the INTA pin to inform the processor an interrupt has been fired.
<pwng> is that true tho?
<pwng> in the 8259 datasheet, what I understand is that it's an input pin that makes the PIC output vectoring info on its data pins
<pwng> and what exactly does it even mean that the PIC "informs the processot an interrupt has been fired"? :/
<pwng> also it's said that "The PIC recieves the acnowledgment signal through INTR" (which i guess the definition of the INTA pin?)
<geist> basically yes
<geist> of course that was physically what it looked like forever ago
<geist> now it's all virtual, but on the original 8086 + 8259 there was a particular way you wired it up, and though new cpus dont look anything like that, they emulate the behavior
<pwng> geist: Thank you so much; so the usage of INTR and INTA in the two statements I mentioned is right and not interchanged?
yuriks_ is now known as yuriks
gareppa has joined #osdev
tenshi has joined #osdev
gareppa has quit [Remote host closed the connection]
ElectronApps has quit [Remote host closed the connection]
ElectronApps has joined #osdev
pwng has quit [Ping timeout: 265 seconds]
pwng has joined #osdev
xtexChooser has joined #osdev
<geist> pwng: probably. i guess my point is it really shouldn't matter
<geist> the model is 'the PIC signals to the cpu that an interrupt is pending'
<geist> well, i guess it doens't matter *now*
<geist> i dont know what level you're interested in. if you're interested in how it used to work in the 8086 days then it's pretty important
<pwng> geist: probably not so about the 8086 days; It's just that I was reading about that PIC model and I found it peculiar that it's not strictly what the datasheet of it say
<pwng> probably sticking to the higher-level model is fine
zoey has joined #osdev
freakazoid333 has quit [Ping timeout: 252 seconds]
GeDaMo has joined #osdev
tacco has joined #osdev
xtexChooser has quit [Ping timeout: 268 seconds]
dennis95 has joined #osdev
dormito has quit [Ping timeout: 255 seconds]
mhall has joined #osdev
lava has joined #osdev
dormito has joined #osdev
Matt|home has quit [Ping timeout: 268 seconds]
xtexChooser has joined #osdev
xtexChooser has quit [Client Quit]
xtexChooser has joined #osdev
xtexChooser has quit [Quit: Konversation terminated!]
xtexChooser has joined #osdev
pg12 has quit [Ping timeout: 246 seconds]
happy-dude has quit [Quit: Bridge terminating on SIGTERM]
paulusASol has quit [Quit: Bridge terminating on SIGTERM]
hgoel[m] has quit [Quit: Bridge terminating on SIGTERM]
ElectronApps has quit [Read error: Connection reset by peer]
ElectronApps has joined #osdev
paulusASol has joined #osdev
happy-dude has joined #osdev
hgoel[m] has joined #osdev
pg12 has joined #osdev
xtexChooser has quit [Quit: Konversation terminated!]
<dzwdz> do interrupts bypass paging? or do the ISRs have to be always present in the virtual memory
<j`ey> latter
<dzwdz> is that the only reason why kernels are mapped in user processes in most systems?
johnjay has quit [Ping timeout: 240 seconds]
johnjay has joined #osdev
<zid> and syscalls
<zid> when you syscall your program essentially becomes the kernel for a while
<zid> I think with the whole spectre etc stuff though people are only mapping the 'landing' pages for the irqs/syscalls and then swapping page tables
dennis95 has quit [Quit: Leaving]
ahalaney has joined #osdev
<klange> how about a fresh beta release to start the week right <https://github.com/klange/toaruos/releases/tag/v1.99.3>
<bslsk05> ​github.com: Release ToaruOS v1.99.3 · klange/toaruos · GitHub
<zid> when is the nakiri ayame theme pack though
pwng has quit [Ping timeout: 256 seconds]
isaacwoods has joined #osdev
nyah has joined #osdev
Skyz has joined #osdev
<Skyz> Klange: wondering when your gonna get some users on your OS
heat has joined #osdev
pwng has joined #osdev
<pwng> Before PIC driver double fault interrupts always occur (I understood why, timer interrupt IRQ0 mapped to 0x08)... However, after PIC driver, I get a page fault exception
<pwng> I still have not defined ISRs to PIC-remapped interrupts; may this be the problem?
<zid> why not just check what caused it?
<zid> seems easier than guessing
<pwng> I don't think I can check whether it's a timer interrupt or not probably right?
<zid> You can check what caused the page fault
<zid> are you using qemu? That's easiest
<pwng> I can guess that its a timer thing since it doesn't always happen at the same place :/
<zid> -d int -no-reboot -no-shutdown
<pwng> zid: Yes I'm using QEMU
<zid> will log interrupts, including your pf
<zid> and give you a stack trace etc for each one
<pwng> zid: Thank you so much; I'll give this a try!
<zid> you'll want like old 0xff new 0xe or whatever page fault is, I forget
<zid> then the stuff below that
<zid> 14, yea, 0xe
<zid> (Then if pf faults it'll go old 0xe new 0xd or whatever double fault is, ignore that one)
<heat> pwng, note that you need to have KVM disabled(and it's disabled by default)
Skyz has quit [Quit: Client closed]
MarchHare has joined #osdev
pwng has quit [Ping timeout: 268 seconds]
dennis95 has joined #osdev
<dzwdz> i only need to set cr0 and cr3 to enable paging, right?
<dzwdz> i have a bit of code which sets those up and accesses some unmapped memory - bochs page faults (as it should), but qemu acts as if paging wasn't enabled
ecs has quit [Changing host]
ecs has joined #osdev
<zid> x86 or amd64?
<dzwdz> x86
<zid> yea just need to set bit 0 of cr0
ElectronApps has quit [Read error: Connection reset by peer]
<dzwdz> yup, that's what i'm doing
<dzwdz> even if i use an empty page directory, qemu executes the rest of the code just as if paging wasn't enabled
<dzwdz> bochs triple faults
<zid> how are you testing for this in qemu?
<dzwdz> wdym?
<heat> show us the code
<zid> how do you know the thing you are saying
<dzwdz> because there's a bunch of code after the part which enables paging
<dzwdz> which works just as it did before i've enabled paging
<heat> show cod
<dzwdz> wait a sec
<zid> that is always true :P
<zid> if you enable paging and your addresses are all different it's not going to work regardless
<dzwdz> no but i mean
<dzwdz> wait what do you mean by my addresses being all different
<zid> paging is what does virtual memory
<zid> you'll need EIP to point to the same place with and without that, for your code to run right after enabling paging
<dzwdz> yup
<zid> i.e identity map the page containing the enable paging code
<dzwdz> and if the page directory has no valid pages
<dzwdz> then the cpu should triple fault
<dzwdz> right
<zid> so I'm not sure how you're measuring "acts like paging isn't enabled", because.. that's what it's supposed to act like
<dzwdz> i mean that the code is working
<dzwdz> when it should break
<bslsk05> ​github.com: temporary commit for #osdev · dzwdz/camellia@7771331 · GitHub
<zid> heh okay then
<zid> ..a diff is an interesting pick
<heat> nitpick: I highly recommend you dont use bitfields for paging structures
<dzwdz> zid: i thought that i'd be easier, all the files are in the same place
<heat> you can't change them atomically and the way they're layed out in memory is implementation defined iirc
<zid> I'd shove a breakpoint on pagedir_use at least
<dzwdz> that's exactly what i was doing
<dzwdz> in bochs, not qemu
<dzwdz> should i try that in qemu too?
<zid> "or 0x80000001, %%eax;" What's the 8 flag do?
<heat> protected mode I think
<dzwdz> enables protected mode
<dzwdz> yes, protected mode already is enabled
<heat> which was already enabled btw
<zid> ah so that does nothing then
<zid> its just or eax, 1
<dzwdz> i had that at the beginning, but i've changed it to this when i was trying to solve an unrelated issue
<heat> wayt no, the other way around
<dzwdz> i mean i had 0x8000000
<heat> paging is bit 31, protected mode is 00
<zid> paging is bit 0
<heat> no its not
<zid> lemme check then
<dzwdz> paging is 31
<dzwdz> brb
<zid> this is not documented in a trivial way in the manual
<zid> yea pg is bit 31 though
<zid> so bit 0 is the pmode bit then, as a collorarlarly?
<heat> bit 0 is protected mode yeah
<zid> page 2880 found it, thanks intel
<zid> It mentions CR0 like 100 times before documenting it
<heat> : "%eax"); <-- is it just me or it this clobber wrong?
gmacd has joined #osdev
<heat> should just be "eax" I think
<zid> not sure, I only use intel syntax
<zid> lemme check
<dzwdz> i think i've checked it and it should be this way
<dzwdz> not sure
<dzwdz> but the generated binary is fine
<heat> I have ::: "rax" somewhere in my code and it's correct
<zid> yea it should be "eax"
<zid> dzwdz: because functions themselves destroy eax, probably
<zid> and it can't see "into" the function even if it inlines it it must assume eax is dead
<zid> unless it's void I guess? hmm
<heat> well for one you're missing the volatile in the asm volatile
<zid> anyway, gcc manual does "or %%rdx, %0" ... "rdx"
<dzwdz> ok right, there should be no %
<heat> that may make gcc do funny stuff
<zid> asm blocks without inputs/outputs are always volatile
<zid> not sure about clobbers
<heat> that has an input
<zid> okay yea needs a volatile then
<zid> (I'm in the gcc manual not the diff atm)
<heat> the or also looks wrong
<zid> "Using the volatile qualifier disables these optimizations. asm statements that have no output operands and asm goto statements, are implicitly volatile. "
<heat> it should be or $0x80........
<zid> it's just outputs
<heat> you're accessing memory at 0x80.... instead of or-ing with the literal
<dzwdz> right, fuck
<zid> so no volatile needed until you add an output
<zid> AT&T is hard
<dzwdz> how did i not notice that
<zid> which is why qemu thinks no paging got enabled, and bochs faults :P
<zid> I objdumped all my asm blocks with -Mintel because.. paranoia
<heat> because it's hard to notice lol
<dzwdz> this code was expected to fault, so i thought that bochs was doing the correct thing
<zid> weird faults like this are about inspecting your assumptions
<zid> which is why I was asking things like, how do you know that
<heat> AT&T is the chaotic good of the assembly dialects
<dzwdz> i didn't even notice this in the intel disassembly, in bochs
<dzwdz> well, thanks! i'd probably never notice that
<heat> np
freakazoid333 has joined #osdev
<mjg> is there an equivalent of agner fog's tables for arm? specifically cortex-a9
Arthuria has joined #osdev
<Bitweasil> Nothing I know of.
gmacd has quit [Remote host closed the connection]
heat has quit [Read error: Connection reset by peer]
Arthuria has quit [Ping timeout: 252 seconds]
gioyik has joined #osdev
Skyz has joined #osdev
<Skyz> Is this a good channel to talk about FOSS?
gog has joined #osdev
<Skyz> Do you people actually like GPL?
<Skyz> #OSdev
<gog> meh
<bslsk05> ​en.wikipedia.org: Fjölnir (programming language) - Wikipedia
<klysm> giving os code to newbies is easier when you have it available in a public domain style license. some developers here have been talking for a while about their proprietary projects, with relatively little to no disrespect. gpl2 projects like linux are easier to pass off as free to others here than someone's agpl3 ideas. it just depends on how much support you need.
<Skyz> I guess it's ingrained in the community through Linux
<j`ey> i dont think anyone here talks about proprietary projects, unless stuff like bsd/mit counts
<klysm> that said, coding for one of the above licenses just because you want participation still isn't likely to get you much participation. nothing really short of extending someone's kernel project would get you much participatory support.
<Skyz> Well I'm a newb at coding
<Skyz> All I know is some Racket and Python
<Skyz> So it's not really feasible for me to do much in the way of coding unless I give it time to work on my own OS project
<klysm> skyz, I would recommend a c or c++ reference document so you don't get lost trying to follow someone else's code.
<Skyz> I see, yeah C / C++ are complicated languages I've been trying to learn them for ages
<klysm> I have been meaning to compile my riscv hobby into something other than c, though I still haven't got beyond the ability to output a simple mov instruction. the effort to compile c to something else is still on my github account, though I have been sequestered with work lately.
<klysm> skyz, if you don't mind, I think you should look at something like this: https://www.amazon.com/Annotated-C-Reference-Manual/dp/0201514591
<bslsk05> ​www.amazon.com: Amazon.com: The Annotated C++ Reference Manual (9780201514599): Ellis, Margaret A., Stroustrup, Bjarne: Books
<j`ey> learning C++ from a reference manual sounds like a bad idea
<klysm> j`ey may have another recommendation
<j`ey> i dont, but random tutorials or something will be better
<Skyz> I'm gonna do CS50 online at somepoint
<klysm> the advantage to a reference manual is that the book always has the answer to your question, so you don't end up confused drawing from multiple sources and getting varied explanations of the same thing from different perspectives.
<jimbzy> C++ is a tough language to learn because it's not a language, it's a suite of languages that share a common syntax and compiler :p
<jimbzy> The trick is understanding which subset you need.
<gog> more-or-less common syntax
<j`ey> klysm: if youre just starting out, youre not going to understand the spec
<klysm> the first chapter explains sime things like arithmetic operators which you are likely to understand right away.
<jimbzy> I mostly use C++ "the wrong way" as a sort of Power C :p
<gog> i discovered gcc's cleanup attribute
<gog> it's nudging me away from the temptation of power c
dennis95 has quit [Quit: Leaving]
<Skyz> I'm highly interested in reflection
<Skyz> C/C++ don't support it
<nshp> compiled languages typically don't (can't?), so it's not something you can do towards the lower level end of OS dev
<GeDaMo> You'd have to do it manually
<nshp> the osdev wiki claims people have used smalltalk (the "original" OO language with reflection) for osdev, but I don't know of an example
<nshp> that would certainly be much less supported by documentation and whatnot
<klysm> reflection is just get-method-by-name;?
<nshp> and get-attribute-by-name and so forth, yes
<klysm> so it's useful for, self-modifying code?
<nshp> or very dynamic code
<nshp> it also extends to being able to rewrite the AST of your own code, so yeah, self-modifying or otherwise introspective
<nshp> java is where most people hear of reflection though, I think that's just the get-x-by-name stuff there
<klysm> places where I'd seen self-modifying code don't often approach beyond self-relocating (eg, rewriting a branch); that is unless you're playing corewars.
<j`ey> linux does branch rewriting
<Skyz> It's kind of like making it proprietary software open-source
<nshp> ^ this is the primary java use case
<nshp> you can dynamically hack up your minecraft or whatever
<kazinsal> I've done some reflection stuff in C# in the past for similar reasons
gmacd has joined #osdev
<Skyz> Open source is a big breakthrough in coding
<Skyz> I remember the world of code without github
<gog> yeh we had sourceforge
<Skyz> I remember there being freeware and shareware on there
<Skyz> free and open-source usually go hand in hand
theruran has quit [Quit: Connection closed for inactivity]
<Skyz> But open-source proprietary is pretty much unheard of
<Skyz> I guess that would be an oxymoron
<Skyz> What if some parts are open source and other parts closed sourced, like a partial blackbox
<sortie> Partial open source is fairly common with corporate stuff
<Skyz> I mention reflection because this allows people to modify the code and it's still a blackbox
<sortie> It is a bit of a contradiction of values yeah
<sortie> I mean there's corporate projects where the non-open stuff is fairly strictly an addition or a branding layer, imagine something like chrome and chromium
<sortie> And then there's things like macOS technically having a lot of open source projects at its core, but good luck putting it together into a functional system
<sortie> I absolutely adore that my whole hobby OS is fully free software and all of the sources are readily available for everything
<geist> mjg: re: ager fog, ARM does have optimization guides for a lot of their cores
<geist> though cortex-a9 is pretty old, maybe 12-14 years old at this point, and i dont think they were as good at documenting that
<geist> but the newer stuff, yes. there's a manual per core that has all the istruction tables, etc
<mjg> i really need that sucker right now :(
<geist> well go look on arms page
<geist> documentation, they might have it
<HeTo> with macOS, there's not that much incentives for putting together the open-source bits. it's just yet another Unix, and there are enough of those already. almost everything that makes it interesting is proprietary. yeah it's based on Mach and that could enable some interesting things but I suppose those alone aren't interesting enough - and if they were, you could just put together your own FreeBSD + Mach OS,
<HeTo> which some people tried a few years ago I think
<mjg> geist: thanks man :-P
<HeTo> https://en.wikipedia.org/wiki/NextBSD didn't go far though
<bslsk05> ​en.wikipedia.org: NextBSD - Wikipedia
<geist> mjg: anything in particular you'tr trying to optimize?
gmacd has quit [Remote host closed the connection]
<mjg> geist: someone slapped code doing 64-bit atomics for statistic counters
<mjg> geist: as you can imagine it sucks big time
gioyik has quit [Remote host closed the connection]
<mjg> so the question is what will not only suck less, but will be reasonable
gioyik has joined #osdev
<Skyz> The most successful non-commercial os project I think is replicant
<bslsk05> ​www.replicant.us: Replicant
pyzozord has joined #osdev
<pyzozord> hey, I'm thinking about ways to recover from program crashes like segv or memory corruptions, or UB in c. It seems that moest robust solution is to just run the unsafe code in a separate process and IPC to the main process. But I'm curious if there are any alternatives and how good they are?
<sortie> pyzozord, the problem is that you can't determine what the *intent* was
<sortie> The condition means that there's a bug in the program, and that's of course bad, but what do you do to fix it?
<j`ey> use rust!!11!
<sortie> Programming languages like Java and I suppose C++ too have exceptions that could be used to let the program continue in the safe manner
<sortie> pyzozord, generally the best practice is not to write unsafe code, but totally makes sense to use subprocesses for untrusted inputs in secure applications
<sortie> Lots of stuff do that, it was pioneered a lot by OpenSSH and widely done now in lots of stuff as a minimum safe practice
<sortie> Still.. if the untrusted process crashes? It can be dangerous to blindly restart it.
<sortie> After all it means there's a bug.. maybe it's exploitable. And you're giving the attacker another try.
<graphitemaster> Once your address space is hosed there's not much you can do after that to ensure your code runs as intended to even do the handling.
<sortie> E.g. a server that re-forks means the same stack protector secret and address space layout and malloc layout gets used, so an attacker can keep guessing (maybe even doing a 256-nary search for secrets)
<sortie> So you definitely at least always want to re-exec a subprocess
<mjg> that's a very XY question
<sortie> graphitemaster, absolutely you're right, although in a managed language you could throw an exception and unwind
<sortie> pyzozord, anyways not quite sure what you're asking, but those are a bunch of tangential thoughts :) What direction are you interested in?
<pyzozord> sortie: it's somewhat hard for me to follow, I'll just explain the example I had in min
<kazinsal> comedy option: the crash handler checks if the user has a valid support license and auto-uploads case data to the call-home server if so
<kazinsal> the process still crashes, but at least the devs can take a look if it's first party code
<sortie> kazinsal lol
<pyzozord> I want to write a MUD game with scripts. I want to write the scripts in C and compile as .so objects that can be dynamically loaded to the main program. That way I can modify the game without restarting it. I don't want those "plugins" to accidentally take down the entire game because I one of them segvs
<zid> I did that once
<pyzozord> (or corrupts memory, or divides by 0, etc)
<zid> I didn't pretend they could be safe though
<GeDaMo> Why do you want to write the scripts in C?
<Skyz> Write them in python
<Skyz> I kind of have a similar idea
<pyzozord> Just don't want to involve any interpreting languages. I could use python, but I'm just exploring what is possible without it
<sortie> If this is a performance thing, then consider a JIT'd language that's managed
<sortie> E.g. Java, Javascript, Dart, Go (?), etc.
<GeDaMo> LuaJIT?
scaleww has joined #osdev
archenoth has quit [Quit: Leaving]
<pyzozord> no no, not really about performance. It's more of a thought experiment to understand what is possible better
<sortie> pyzozord, but your requirements sound a lot like wanting a nice scripting language that's safe. I mean there are ways of trying to do these things with C, but a proper language is the best solution
<pyzozord> maybe a bit about simplicty, adding an interpreted language on top is like pulling in a whole world of complexity as a dependency
<sortie> I rather see it as using a proper tool for the job
<pyzozord> I know I know
<sortie> And mind you, the language doesn't need to be interpreted. It can also be JIT'd, or AOT'd
<sortie> The best way to do this with C is to use safe functions
<pyzozord> safe functions?
<sortie> Write a collection of utility functions that are always safe, use the type system heavily, etc., lots of bounds checks automatically, and so on
<sortie> pyzozord, like instead of using C arrays through pointers, you have a struct that manages it, which also have a bound. Instead of deferencing it directly, you call a array_get function, which does a bounds check.
<sortie> Same with strings
<sortie> pyzozord, basically it will boil down to all the runtime checks and safeties provided by a language such as Java
<pyzozord> oh I see, so instead of using a managed language, this is just managing the language yourself kindof?
<clever> sortie: std::string exists
<j`ey> not in C
<sortie> clever, exactly
<sortie> C++'s standard library have some of these things that are safer to use, but you can emulate the style in C too
<sortie> That's kinda what I meant by safe C, if you really must use it
Matt|home has joined #osdev
<pyzozord> I see or that brutforce solution of running another process
<sortie> The C type system is quite weak though. You want to make sure you don't confuse types as well.
<sortie> pyzozord, oh you probably want to do both
<pyzozord> I was curious maybe there were some posix/linux facilities for making part of your program "safe" like a separate process is
<sortie> Independent module processes that communicate, but each is written in a very safe manner
<sortie> Or instead of inventing the wheel, simply get an existing solution for this :)
<pyzozord> yep sounds like that would be reinventing the wheel
<sortie> pyzozord, processes are basically the simplest unit of trust. There's a reason why the whole process crashes and not only a thread
<pyzozord> so do I understand that rust achieves that complexity by having a very strict typing system so the language is "managed" during the compilation time?
<j`ey> and some runtime parts
<j`ey> like bounds checked arrays
<sortie> Yeah
<sortie> If the type system is safe and strong, then the types of things can be trusted at runtime, and it can omit some checks that you might need to do manually in C, and insert other ones like bound checks automatically
<pyzozord> ok so there is no "reactive" way to this problem, it seems that everything that can be done is "preventing" by additional logic and checks
<sortie> Yep exactly
<sortie> Well exceptions are a reactive way
<pyzozord> and once it slipped through the prevention mechanism the program is pretty much busted
* Bitweasil faults pyzozord's CPU such that the checks fail some small percentage of the time.
<zid> It's a fundamental CS issue, you can only attempt to limit it
<pyzozord> from what I understand exceptions are just a syntax suger on top of those preventive checks
<sortie> But generally, there's no recovering from a bug except aborting to some handler that decides whether to retry, abort, or ignore. Most effort is spent not having the bug in the first place
<sortie> Or detecting when the bug happens
<pyzozord> that exception logic happens in runtime in userspace in the process, like if the programmer would have written it
<zid> like, if your C program crashed because you fucked up your logic and overwrote all of an array instead of just 1 element or whatever, catching the segfault isn't going to fix I just corrupted that array
<pyzozord> (instead the compiler/language injected it but that's a detail)
<sortie> The exception handler can't go back in time though and fix the original problem
<zid> logic bugs are still logic bugs in any language
<sortie> (It can fix the problem and retry though)
<zid> and you can't trust things that have crashed even if you tried to prevent them from doing naughty things
<zid> (The main issue with C in practice is that they can do naughty things and NOT crash)
<zid> like int a[10], b, c; can silently corrupt 'b' via an off by one logic error, etc
<clever> zid: i load a file into a void*, cast it to a function pointer, and then just call it
<zid> a void (*) I hope
<clever> #define KERNEL_LOAD_ADDRESS 0x2000000 // 32mb from start
<clever> uint8_t* zImage = reinterpret_cast<uint8_t*>(KERNEL_LOAD_ADDRESS);
<clever> then it loads to that addr
<clever> typedef void __attribute__((noreturn)) (*linux_t)(uint32_t, uint32_t, void*);
<clever> linux_t kernel = reinterpret_cast<linux_t>(zImage);
<clever> kernel(0, ~0, fdt);
<geist> i'm so glad you pasted that clever
<zid> okay thanks
<clever> then i just run it
<zid> ty for letting me know
<geist> it really clears up all the questions that are flying around
archenoth has joined #osdev
<clever> forgot how long it was
<geist> you rascal you!
<zid> now I just need to find out what the question was, now that we have the answer
<clever> zid: turns out, there is no void* in there! :D
<pyzozord> so if separate process are the only guaranteed way, why aren't more programs using multiple processes?
<geist> pyzozord: to separate things? lots are
<clever> chrome rendering processes
<zid> My entire OS is lots of separate programs
<geist> but motsly it takes effort/time/overhead
<pyzozord> hmm well I guess I saw apatche had worker processes
<zid> calc isn't inside the kernel
<zid> grep isn't inside gcc
<clever> pyzozord: each of those processes, handles a single connection at a time
<clever> but the state often isnt cleared when the handling is done
<clever> so it will persist in the virtual addr space, during the handling of the next connection
<geist> it's a tradeoff. you can keep subdividing a program into more processes but at some point it's diminishing returns
<geist> especially for a possible security breach
<geist> but it's not unheard of, for example, to put complicated rendering or decompression or decoding logic into a separate process. things that operate on external input
<geist> and since the amount of cpu time on the work is probably nonzero the overhead of the process creation/teardown is probably not as important
<pyzozord> because I see now if I cross the line and allow more then one process in my game, I could as well go all the way in, have multiple "unsafe code server" proceses, have a process responsible for state and data, have a process for each connection
<zid> like obs using x264.exe to encode
<geist> ie, if it takes 100ms to set it up and then it goes and spends 10 seconds on it, etc
<pyzozord> isn't having a process for each connection an overkill?
<geist> well, it's all subjective. how much risk do you want to take
<zid> It's better for a lot of different reasons to do that
<clever> pyzozord: apache isnt creating and tearing down the processes in that case
<geist> classic simple http servers sure you fork off a process every connection
<zid> the main one being that a stray while(1) in your PHP script doesn't bring down the webserver
<clever> pyzozord: its more of a worker pool, of pre-made processes, and a random proc will serve each ocnnection
<geist> yah and iirc apache in that mode will do something like serve N connections before it tears down that process and creates a new one
<geist> sort of a hybrid between one per and no processes
<pyzozord> I heard about those crazy things where people experimented with 10k connections on their http server on a single laptop. They couldn't possibly have 10k processes could they?
<clever> yeah, that can help to clean up leaks
<zid> 10k on a laptop is a problem from the 90s
<bslsk05> ​en.wikipedia.org: C10k problem - Wikipedia
<geist> sure, you could have 10k processes if you wanted, but yes that's probably overkill
<clever> pyzozord: http servers like nginx, are entirely event driven, and generally dont allow any in-process scripting, so they can avoid that while(1) issue zid mentioned
<geist> OTOH 10k threads is not that far off even for the average desktop
<clever> and that lets one process serve insane numbers at once
<geist> so it's mostly the address space overhead
<zid> we're into C10M now :P
<clever> i have also seen a site that was stress testing things, and they ran into problems with 65k connections
<zid> 10k is about where you start hitting issues on modern hardware doing it naively
<zid> like forking or epoll or whatever
<clever> basically, the load balancer was making connections to a backend machine, all from the same source ip, and the same dest ip/port
<clever> so it ran out of source ports, lol
<geist> that'd be my guess. though obviosly a large server probably blows past that just fine
<geist> OTOH it's likely the kernel is tweaked or so for those kinda cases
<clever> they had to begin load-balancing over multiple dest ports i think
<zid> once you start trying to make it *perform* it isn't too bad
<geist> in the old days with BSD or whatnot, you'd tweak MAXUSERS or whatever the variable is
<zid> thread pools blah blah
<geist> to tune all the internal hash tables, etc
<clever> another problem i heard of, if you share a single listening tcp socket between every proc, and you have all of them block on accept()
<zid> side note, nothing supports fastcgi and I am mad about it
<clever> then you get weird cpu usage problems
<clever> but if you instead create a new socket in each proc, and listen() on the same ip/port (SOREUSE), then it wont do that
<clever> linux specific bugs you need to be aware of, and work around
<pyzozord> so 10k processes is perfectly fine?
<zid> thundering herd is another term to care about
<zid> lots of threads waiting on i/o, i/o becomes thread, 10k threads wake up and all try to take the same lock
<clever> zid: one day i came home from a trip, and the instant i turned my laptop on, the server crashed to a thundering herd
<zid> i/o becomes available*
<geist> pyzozord: well, i dunno. it's subjective. 10k is perfectly fine in some cases, sure
<zid> is this related to your void * or not clever?
<clever> the laptop was an nfs server, with the "server" being an nfs client
<clever> taking the laptop with me on a trip, caused nfs to hang, and the `df -h`'s running in cron, all hung, and silently went into swap
<geist> pyzozord: there's not a black and white answer here
<clever> when the laptop (nfs server returned), 10000 df -h's all woke up at once
<clever> and all demanded the ram and cpu
<geist> using multiple processes is a tool that may or may not be the best solution in some cases
<zid> 10k threads using 1GB of memory each is not going to work well :P
<clever> zid: 128mb of ram....
<clever> single core
<zid> what is
<geist> but in general nowadays with security/safety in mind, using multiple sandbox processes for various complicated tasks is more in vogue
<zid> your void *?
<clever> zid: the thundering herd of df -h's
<zid> okay, I was talking about the thing we were talking about
<zid> the c10k problem
<geist> what is the c10k problem?
dutch has quit [Quit: WeeChat 3.0.1]
<pyzozord> geist: thanks for laying it down for me, so it sounds like there is no clear answer but doing more processes is more popular nowadays?
<zid> The name for the problem of serving 10k clints on 90s hw
<geist> pyzozord: within reason, sure
<geist> zid: got it
<zid> https://en.wikipedia.org/wiki/C10k_problem I linked it a few mins ago
<geist> got it
<pyzozord> zid: how is C10M handled today?
<pyzozord> in layman terms
<zid> Usually multiple machines
<Bitweasil> Teh Cloudz!
<geist> it looks like a generic term for a class of scaling problems nowadays
<zid> If not, pools.
<zid> Same as apache does
<clever> dedicated load balancer hardware, to route the connection to multiple backend machines
<pyzozord> ah ok, then we talk about the web stuff
<pyzozord> like kubernetes, microservices the cloud and what not
<zid> everything is web stuff these days ;)
<pyzozord> not interested in that, just single machine stuff
<clever> pyzozord: those are more about spinning up a service on many machines at once
<zid> Good job I gave the single machine answer too then
<geist> sure, but the answer remains the same. at some poont a single machine can't scale
<clever> which you might do, behind the load balancer
<geist> and that's good to know
<geist> even if you're only interested in the single machine part
<zid> 1000 very light threads running per process on a bunch of processes, as an example of pooling
<zid> software switching not hw to reduce syscalls etc
<clever> another question, is what kind of handling you want to do
<clever> nginx reverse proxy, is far more light weight, and can act as a load balancer
Arthuria has joined #osdev
<pyzozord> oh interesting, I coul create a "connection" process with 100 threads, and just 100 of those threads
<clever> pyzozord: event driven programming also allows 1 thread to handle >1 connections
GeDaMo has quit [Quit: Leaving.]
<pyzozord> then if one of them dies, 100 people loose connection, but that's 1% of the system
<zid> It stops epoll and select losing a shit load of performance if you keep them under a thousand
<zid> which is a nice benefit
<geist> yah and whatever internal locking you might need to do in the process, etc
<zid> but nothing supports fastcgi so you'd have to hack the webserver
<clever> zid: i use fastcgi on a number of things, lighttpd and i think nginx
<zid> (fastcgi supports this natively but nothing implements it, I am salty)
<pyzozord> I used poll recently for the first time, I liked it
<zid> clever: it says fastcgi, it doesn't mean it
<zid> it means the part of fastcgi that is exactly the same as the old cgi, but with the new spec
<zid> not the part where it does multiplexed connections over a special protocol
<clever> ahh
<zid> apache outright refuses because they won't do more than 1 connection per worker
<zid> as is dogmatic for apache's design
janemba has joined #osdev
<zid> I designed a MUD using fastcgi then nothing supported it so it never left paper :D
<pyzozord> ok cool, very interesting. I never thought that my program can be multiple processes and have a kind of "microservice" or "microprocess" architecture
<zid> Where it'd hand off connections from the login daemon to the world server and stuff
<pyzozord> but that sounds interesting
<zid> pyzozord: I mean, think of SQL
<zid> a *lot* of applications just open sockets to a sql database running on the same machine
<zid> that's basically the exact same concept
archenoth has quit [Ping timeout: 268 seconds]
<clever> in the case of php, it will clear most state, but it can cache a sql connection behind the curtain
<zid> dbus on modern linux desktops is also the way graphical stuff talks to each other
<pyzozord> I need to write my own http server to learn about multiple processes/threads and epolls and things like that, do you guys have any recommendations? I am after K&R with all exercises done, so I am familiar with C the language
<clever> and if the same worker proc asks for the same connection, it can just whip out an old one
<pyzozord> but less with os or things that weren't mentioned in the book, including threads
<zid> You could run through beej's socket guide, and then run apache bench (ab) against what you write ;)
<zid> ab's designed to stress test webservers it's a fun tool
<clever> pyzozord: ive even used epoll for a basic serial terminal program
archenoth has joined #osdev
<clever> it lets me monitor stdin and the uart, at the same time
<pyzozord> zid: mind sharing the link, can't find what you mean
<clever> and with signalfd, i can capture ctrl+c via epoll too!
<pyzozord> clever: I recently used poll to write this https://imgur.com/a/nabmHMN it was fun
<bslsk05> ​imgur.com: Imgur: The magic of the Internet
dutch has joined #osdev
<clever> pyzozord: heh!
<clever> the main difference between epoll and select, is that select is using a bit-mask, where each bit represents an fd, and you have to re-create that bitmask on every call
<clever> but epoll is using dedicated syscalls, to add/remove an fd
<clever> so you can monitor far more sockets, without the overhead of telling the kernel a list every time
<clever> i'm fuzzy on how select and poll differ
<zid> good news, MAX_FDS on windows is 32
<pyzozord> zid: sorry I know ab, I was referring to that socket guide you mentioned
<zid> so you can do up to 31 clients
<zid> just google beej
<zid> it's what basically everybody learns networking from
<pyzozord> this one https://beej.us/guide/bgnet/?
<bslsk05> ​beej.us: Beej's Guide to Network Programming
<pyzozord> oh wow, it's an entire book
<Skyz> This may be a super simple book to look through as an intro
<pyzozord> that will tkae few months
<pyzozord> Skyz: thanks
<pyzozord> I guess no shortcuts, I should learn some basic networking anyway
<pyzozord> ok I got more then I asked for, thanks everyone for help!
<pyzozord> that multiprocess architecture is very interesting and liberating, I'll think more about that
pyzozord has left #osdev [#osdev]
raggi has quit [Quit: upgrades]
raggi has joined #osdev
ckie is now known as cookie
Arthuria has quit [Ping timeout: 255 seconds]
gog has quit [Ping timeout: 268 seconds]
<Skyz> FPGA and RPI are similar?
<j`ey> no
<Skyz> I suppose that's because it uses verilog
<graphitemaster> <sortie> graphitemaster, absolutely you're right, although in a managed language you could throw an exception and unwind
<graphitemaster> Can't unwind either if your address space is hosed
<graphitemaster> Unless the managed runtime is isolated from the runtime address space of the managed runtime
<Skyz> I made a newbie app
<Skyz> It generates monsters on the screen
<Skyz> Kind of similar to the MUD idea
<bslsk05> ​redirect -> accounts.google.com: Meet Google Drive – One place for all your files
dormito has quit [Ping timeout: 255 seconds]
Izem has joined #osdev
<Skyz> Are data sheets common in OSdev?
<bslsk05> ​gitlab.com: datasheets · master · Michael Schröder / nand2tetris-FPGA · GitLab
Izem has quit [Quit: Lost terminal]
<j`ey> theyre usually called reference manuals, but yes
lucf117 has joined #osdev
<Bitweasil> Depends on what you're doing, I stare at datasheets a lot when I'm writing either a driver to poke certain bits of hardware, or (more usually) writing the hardware for emulation.
dormito has joined #osdev
sortie has quit [Remote host closed the connection]
sortie has joined #osdev
<clever> zid: *skims over extensible-host-controler-interface-usb-xhci.pdf*
<clever> zid: page 381 section 5.3, details what you can find in its MMIO window
<clever> zid: nearly all communication with an xhci controller, is done via ring buffers held in system ram, the card will use dma to either populate the slots, or read them, and then your cpu just has to do the same
<clever> zid: page 401, the command ring control register, is the main entry point i believe, and from there, you can give it commands
<zid> okay?
<clever> from our convo in #qemu
<zid> did we?
<clever> 2021-07-19 18:52:14 < zid> Time to write a USB stack I guess
<clever> or do you have an impersonator?
<zid> Wouldn't exactly call that a conversation
<clever> we talked about absolute pointing devices
<zid> yes, not about usb
<clever> and i didnt want to spam qemu with osdev related info
<zid> I'm not sure why you mentioned it at all
<clever> to save you wasted time on older api's
<Bitweasil> clever, do you happen to know if the Rpi2 implements the ARM Generic Timers? I'm pretty sure it does, though I've *no* idea where the MMIO interface to them is...
<zid> also not sure why you get to decide my poor Q35 machine is a waste of time
<zid> or that usb 2 isn't usb
<clever> Bitweasil: it does, and its in the official docs
<clever> zid: xhci can also do usb2
<zid> but my usb2 machine
<zid> cannot
<Bitweasil> And this is *separate* from the timers in the bcm2836 interrupt controller, correct?
<clever> Bitweasil: yeah
<Bitweasil> Ok. That's what I thought, just sanity checking. Thanks!
<clever> [clever@amd-nixos:~/apps/rpi/documentation/hardware/raspberrypi/bcm2836]$ evince QA7_rev3.4.pdf
<clever> Bitweasil: this path in the official documentation repo
<zid> this is like saying I should write an AHCI driver because it's better. That's true, AHCI is better, but you need *ahci capable hardware first*
<clever> Bitweasil: all in the 0x4000_0000 window
<clever> zid: i assumed that if your using qemu, you can pick any usb controller you want
<zid> I am not *targetting* qemu, I am *using* qemu
<zid> big difference
<Bitweasil> That's not the Arm Generic Timer, though. That's the 2836 interrupt controller timers. CNTFRQ/CNTVOFF/etc are the ARM Generic ones.
<clever> Bitweasil: pretty sure ive had the arm one work on a pi2...
<Bitweasil> And it's got controls for their outputs in the interrupt controller - the CNTVIRQ, CNTHPIRQ, CNTPNSIRQ, CNTPSIRQ.
<Bitweasil> Ok.
<Bitweasil> I'm fairly convinced it exists, or at least is intended to.
<clever> checking sources
<Bitweasil> And that it's separate from the bcm2836 timer documented there, though perhaps off the same oscillator.
<bslsk05> ​github.com: lk/platform.c at vc4 · librerpi/lk · GitHub
<geist> yah the arm generic stuff is even defined in the armv8 spec
<clever> Bitweasil: this is for the pi2, and is using names like you just pasted
<Bitweasil> If you look at the interrupt routing on page 4, those signals come back from the core to the interrupt controller.
<Bitweasil> Yes.
<Bitweasil> But they describe, in that doc, the interrupt controller timer, not the core local generic timers.
<Bitweasil> geist, it's in the v7 spec, which I'm working on, just want to make sure it's actually present in the hardware.
<Bitweasil> I mean, I need it anyway.
<Bitweasil> :)
<Bitweasil> Easy enough to diff against the hardware, just wasn't sure if anyone had really messed with it.
<clever> the pi2 docs i think are the most spotty
<Bitweasil> The Pi docs, in general, /suck/ :p
<clever> they just assume you know how the pi1 and armv7l work
<Bitweasil> Yeah.
<Bitweasil> And then don't mention a ton of stuf.
<clever> the pi1 docs explain a lot more, that is common across the whole range
<clever> pi2 doesnt bother repeated things
<Bitweasil> The 1/2/3, yes.
<Bitweasil> And the 3 is... mostly the Pi2, with faster cores and guaranteed 64-bit, IIRC?
<clever> yeah
<Bitweasil> And the 4 is basically totally new.
<clever> there is also the pi2b+ i believe
<clever> which i consider more of a pi3b-
<Bitweasil> The SoC there shares very little with the older ones.
<Bitweasil> Hm, not sure I've run into that one.
<clever> they sold pi3b's without the wifi chip, and called it a pi2
<Bitweasil> The 1 is single core, the 2 is quad core but may not have 64-bit, the 3 is quad core with guaranteed 64-bit, the 3B+ is a faster 3, the 4 is a new SoC.
<Bitweasil> Huh, ok.
<Bitweasil> forgot they added wifi on the 3.
<clever> the maskrom of the pi3, also added netboot and usb boot
<Bitweasil> I think I'd call that the "64-bit Pi2," but not with any strength of conviction there.
<Bitweasil> Ah, ok.
<Bitweasil> I've not used either. :)
<clever> its also disabled by default
<Bitweasil> Cheap SD cards and pivoting root to USB SSD work fine for me.
<clever> you have to burn an OTP fuse to enable it
<Bitweasil> I looked at the USB boot stuff briefly and it had such a long list of "Well, might not work, if...." footnotes I never tried.
<clever> also, if you have ONLY bootcode.bin on an SD card, it can load /boot from usb just fine
<clever> so you dont need any special pivoting stuff
<Bitweasil> Oh, didn't know that! Cool.
<clever> the bootcode.bin only route, also fixes maskrom bugs, and even enables usb boot on a pi1
<clever> and netboot
<Bitweasil> Last I looked at it, there were tons of timing issues on the USB boot path, so I never bothered.
<Bitweasil> And I use my SD card for swap. >:-D
ahalaney has quit [Remote host closed the connection]
<Bitweasil> (zswap means very little touches the backing block device)
<clever> bootcode.bin only, gives you the ability to patch things in the field, so those bugs are probably fixed by now
<Bitweasil> yeah, I'm still /boot on sd, / on USB
<Bitweasil> Works fine for now.
<clever> the pi4 basically made "bootcode.bin only" the official option, by putting it on dedicated SPI flash
<Bitweasil> I'll have to look at that down the road.
<Bitweasil> Next time I have to rebuild the OS.
<Bitweasil> Man, I want a cigar. :/ Got a bunch of new ones in, but the air is "more smoke than you'd pull from the other end of a cigar," so don't care to smoke it outside. :(
<clever> when doing usb boot, it also supports GPT, because of >2tb disks
<Bitweasil> *nods*
<clever> your /boot must be flagged as the efi sys partition or microsoft basic data, i believe
<clever> not entirely sure that goes back to pi1 era, but pi4 definitely
<sortie> Your /boot has been flagged with the relevant authorities.
* Bitweasil shoves the SD card in, puts /boot on it, puts / on the USB SSD adapter, and doesn't care about the details.
<Bitweasil> Wait, boot? sudo? Is there something I need to know here?
<clever> Bitweasil: with the "bootcode.bin only" route, you make one fat32 on SD with only bootcode.bin, then you put a 2nd fat32 + rootfs on usb (can even just be the official .img), and it boots
<clever> start(4).elf and kernel.img need to be on the usb fat32
<Bitweasil> Huh.
<Bitweasil> So you could flash the "generic Pi image" to the USB SSD directly, make your SD with bootcode.bin, and it'll work?
<clever> yep
<Bitweasil> Slick.
<Bitweasil> Ok, that's an actual improvement, I'll have to try that next time I frag an install.
<clever> as long as the root= is right (uuid/label helps)
<Bitweasil> root=/dev/clever-repo-on-github ;)
<clever> root=/dev/mmcblk0p2 will obviously fail
<Bitweasil> root=magnet:?
<Bitweasil> "Screw NFS! I boot over bittorrent!"
<Bitweasil> ...
<Bitweasil> actually.
<clever> :D
<Bitweasil> Damn, that sounds nice, really.
<clever> i have made custom initrd's before, that fetch the rootfs over http
<Bitweasil> Local torrent swarm for a bunch of netboot boxes?
<Skyz> That reminds me, I wonder what's happening with ipfs
Izem has joined #osdev
<clever> Bitweasil: ipfs feels better then torrent, depends on how fast of a boot you want, and how big the rootfs is
<Bitweasil> Not familiar with ipfs.
<bslsk05> ​docs.ipfs.io: IPFS Documentation | IPFS Docs
<Bitweasil> I've left the realm of "At all practical" here, FWIW.
<clever> Bitweasil: torrents describe the entire layout of all files in the .torrent, and the main download just treats it as one solid uint8_t[], that gets partitioned up latter
<Skyz> there also is https://www.ethswarm.org/
<bslsk05> ​www.ethswarm.org: Swarm
<clever> Bitweasil: but ipfs describes files as a tree of objects, each can be downloaded seperately
<Bitweasil> Oh, nm, I've seen the concept for that, at least.
<Bitweasil> Huh.
<clever> the objects dont even have to be hosted on the same machine
<Bitweasil> I should host my websight on it.
<Bitweasil> Complete with "under construction" jiffs.
<Bitweasil> :D
<Bitweasil> I have a colo'd box, I just don't care to do that much with computers and the internet lately. :(
<Bitweasil> I probably should, half the reason the box is a diskfull is that I wanted to host a bunch of decentralized stuff.
<Bitweasil> ... storage heavy box.
<Bitweasil> Definitely not a diskfull.
<Skyz> I haven't tried ipfs in a long time
<Izem> is ipfs a blockchain? :P
<Bitweasil> There's a ton of stuff on my "Oh, XYZ is neat, I should play with it..." list that I haven't.
<Bitweasil> Mostly because it's computer related and I increasingly hate the things.
<Skyz> I think I need to try it, I'm going online now
<clever> ive also noticed that ipfs has some downsides, in terms of privacy right now
<clever> (with the current design/implementation)
<clever> when you first launch it, a pub/priv key pair are created, and on every startup, it will post your pubip and pubkey into a DHT
<clever> and the DHT also lists every file you are sharing
<clever> so i could track your pubip, if i knew your pubkey
<Bitweasil> Huh.
<Izem> how do you follow the DHT here? pubkey?
<Bitweasil> Wait, you need a public IP to host? Aw. :(
<Bitweasil> I'd have to run it out of the colo then.
<Bitweasil> I'm behind a massive CGNAT at home.
<Bitweasil> At least on one of my ISPs.
<Bitweasil> The space one. ;)
<clever> Bitweasil: i think it has some nat punching too, i dont remember having to forward ports
<Bitweasil> Won't punch this NAT, likely... but I should try.
<Bitweasil> Not that the connection is reliable yet.
<kazinsal> and probably will continue to not be as temperatures increase and dishy mcdishface (christ I want to waterboard elon musk) overheats several weeks of the year
<Bitweasil> I've not seen mine overheat yet.
<Bitweasil> I'm aware of the issues.
<Bitweasil> There's a reason it's not my only connection and I have a hardcore IRC habit. ;)
<kazinsal> yeah I got a bouncer when my cable connection started getting horrendously crap
<Bitweasil> clever, is CNTFRQ global to the system, or per-CPU?
<Bitweasil> Oh, I've used bouncers for years.
<kazinsal> now I have fibre and it Just Works (tm) but I still have the bouncer because it's fun to have a domain on my whois
<Bitweasil> Crap connections are my especiality!
<clever> Bitweasil: i think the freq is hard-wired, and that register has zero real effect
<Bitweasil> armstub sets it.
<clever> Bitweasil: that reg is more for the bootloader to tell the os what freq is setup
<clever> yep
<kazinsal> also because being able to just SSH into it from anywhere and `tmux a` to get back into IRC from any device is handy
<clever> Bitweasil: if the armstub doesnt set it, linux will divide by zero!!
<clever> i learned that the hard way :P
<Bitweasil> If I set it on core 0, will core 3 read the same thing? ;)
<clever> not sure
<Bitweasil> SCRs are otherwise per-core.
<Bitweasil> ok.
<Bitweasil> Heh.
<clever> i suspect its just a general-purpose reg, that has zero impact on anything
<Bitweasil> Trade you for "The undefined instruction handler doesn't exist and touching SCRs that don't exist is an undefined instruction." :/
<clever> but the specs say that the bootloader should put a freq there, and the os should assume it has a freq
<Bitweasil> I know it has zero impact, just wondering if one core writes it for the whole system or if it's per-core.
<clever> *looks*
<clever> Bitweasil: i believe the arm stub sets it, before checking the core#
<clever> that implies its core-local
<Bitweasil> Yeah, I think you're right.
<Bitweasil> armstub runs on all the cores, primary core boots Linux, rest sit in the wfe loop?
<Bitweasil> Alright, core local it is. :D
<Bitweasil> ... and people wonder why I don't talk about work much.
<clever> on pi2, the arm stub also turns on SMP
<clever> if SMP is off, the mutex opcodes are fatal, and coherency between L1's wont work
<Bitweasil> "Oh, yeah, I spent my week trying to hammer out poorly documented details of ARM cores."
<Bitweasil> *nods*
<clever> also discovered that the hard way :P
<Skyz> apparently there are OSs that ipfs is partnered with that I've never heard of
<Bitweasil> Except I don't implement multiple cores yet.
<Bitweasil> So Linux is a bit weird.
<clever> printk in linux, uses mutex opcodes if SMP is enabled
<Bitweasil> "uh... ok, sure, we'll use single core Rpi2 stuff?"
<Bitweasil> (I set maxcpus=1 in the kernel command line)
<clever> and it tries to print, before it sets up the exception table
<Bitweasil> Indeed.
<Bitweasil> The exception table is really very, very late in the kernel setup process.
<clever> so the first printk, causes the PC to jump off into undefined data
<clever> on pi3, the same bit that enables SMP, will instead enable a lower priv level to do L2 operations
<Bitweasil> Prefetch abort, data abort... you'll end up in the same loop either way.
<clever> if THAT isnt set, then linux will just not bother trying to flush the L2
<clever> and dma on the pi isnt coherent, so things get nasty
<Bitweasil> Oh man.
<Bitweasil> We're literally attacking the same problem space from opposite sides. :D
<clever> in my case, i'm replacing the official firmware
<Bitweasil> You're trying to understand the hardware for the open source bootloader, I'm trying to understand the hardware to write a copy of it.
<clever> so i have my own arm stubs, and everything before that
<bslsk05> ​www.actyx.com: A factory software platform—built for busy developers | Actyx
<clever> ahh
<Bitweasil> :p I know.
<Bitweasil> I reference your crap regularly.
<clever> :D
<Bitweasil> I just happen to be writing an ARMv7 emulator, with the current target for no particular reason being the rpi2.
<clever> Bitweasil: for extra points, emulate the VPU too!!
<Bitweasil> *barf*
<Bitweasil> No.
<Bitweasil> I'll end up with a virtio interface at some point, though.
<bslsk05> ​github.com: rpi-open-firmware/main.c at master · librerpi/rpi-open-firmware · GitHub
<Bitweasil> but this is a "Ok, this is a public target, make it work" thing.
<clever> Bitweasil: this is my implementation of the arm stubs
<clever> c_entry gets ran on all 4 cores at once
<Bitweasil> Actual targets are ARMv7 but I don't work in certain facilities, so I don't know what they are.
<clever> arm_lowlevel_setup deals with figuring out what the heck its running on, and doing the right thing at runtime
<Bitweasil> *nods*
<Bitweasil> ... so, I don't know what timezone you're in, but I'll just send a preemption interrupt here, I'm about end of day, winding up and heading home soon. :)
<clever> ~8pm here
<Bitweasil> Ok. Newfoundland area?
<clever> NB
<Bitweasil> Cool. More west here.
<Bitweasil> In the smokelands.
<geist> mmm hsn't gotten smoky here yet, but only a matter of time
<bslsk05> ​anytype.io: Anytype.io
<Skyz> Look at this OS
<Skyz> It's different
lucf117 has quit [Quit: Leaving]
sortie has quit [Quit: Leaving]
<Bitweasil> geist, it ranges from "unhealthy for sensitive groups" to "unhealthy" here, and I'm sure worse is coming. :(
<Bitweasil> This is about 2 months early.
<Bitweasil> And we're not at the start of it, either.
<geist> yah i got a brand new PM2.5 sensor the other day, though not like it matters that much
<bslsk05> ​www.multiverse-vcs.com: Multiverse
<geist> but it's nice to know what it is precisely at your house
<Skyz> IPFS is awesome!
<kazinsal> yeah, at a certain point you're going to go, hmm, yep, smells like campfire
<geist> well and there are other online PM2.5 sensors nearby
<Bitweasil> Heh. I ordered one too. :(
<geist> purpleair?
<Bitweasil> "Wow, this sucks."
<Bitweasil> No.
<Bitweasil> Temtop.
<clever> kazinsal: at least in my case, whenever it smells like a camp fire, its because the neighbors have a camp fire!
<Bitweasil> I wanted CO2 as well, for my office.
<geist> ah yeah i was thinking about getting one for the inside. will check into that one
<Skyz> The thing we get here is tropical storms
<Skyz> There was one last week
<kazinsal> clever: we've had a fire ban in place since the weekend with 40+ C days, continuing until I think September 31
<Bitweasil> I didn't want a damned IOT piece of crap you could only read via an App(TM).
Izem has quit [Ping timeout: 268 seconds]
<clever> kazinsal: its rained often here, and the neighbors have a fairly large lawn
<Bitweasil> Since at this point, "IOT" means "We're selling your data. You don't know why, or to who, but we are, and you're going to suffer for it eventually."
<geist> yah the purpleair thing is great, but it's pricey and is wifi only
<kazinsal> yeah, we haven't seen rain in about a month
<geist> but on a positive note you dont *havE* to hook it up to the cloud, and you can access it directly via ip if you want
<Bitweasil> That's better than some...
<geist> hmm, which temtop did you get? one of the desktop ones?
archenoth has quit [Ping timeout: 268 seconds]
<clever> kazinsal: infact, the rain has tried to start fires here!, thunder&lightning! lol
<Bitweasil> Actually, I think I got the p1000, CO2 sensor.
<geist> yah seems they have some big sale
<Bitweasil> Just sits there and displays data, doesn't log it to the intarblags.
<Bitweasil> I run a lantern and such in the winter, interested as to the impact.
<geist> INTERBLAGS
<geist> yah i did the purpleair so i could add it to the purpleair map, etc
<geist> but... really didn't need to, there's good coverage already
<Bitweasil> I'm just so, so burned out on "Hey, get this internet connected thing! ... ... oh, wait, it's evil."
<Bitweasil> Not that I've had many in the first place.
<Bitweasil> Apparently nVidia's Shield TV things are now getting ads and recommendations on the homescreen.
<geist> yah i get it. i generally dont trust anything, and i have a whole separate vlan for IoT shit
<Bitweasil> Despite being a paid product that isn't cheap.
<Bitweasil> "Ohhhh... your indoor air quality drops substantially at 6PM every day. Clearly, you cook a lot of bacon. Hey, health insurance company, you want this juicy tidbit?"
<clever> Bitweasil: or your smoke regularly?
<Bitweasil> The whole tech industry has turned into a "Ok, wait, how is this product horrible to me?" game.
<Bitweasil> clever, that would be more throughout the day.
<clever> let me grab you another meme...
<Bitweasil> Random PM2.5/PM10 spikes would probably be a smoker.
<Bitweasil> If it's just the evening, you probably fry stuff.
<Bitweasil> And it doesn't matter if you don't, that's the assumption, so that's the truth, so you get to deal with that shadow fact.
<Bitweasil> "I guess, with my little algorithm!" is the truth, regardless of what's actually happening.
<Skyz> lmao
<Bitweasil> :(
<Bitweasil> Yeah.
<Bitweasil> That too.
<bslsk05> ​www.hummingfluff.com: www.hummingfluff.com | 520: Web server is returning an unknown error
<Bitweasil> Alright, I'm out!
<Bitweasil> ... brave the toxic air between filtered air places.
<Bitweasil> Like living on Mars.
<Bitweasil> :/
<Skyz> "Decentralized OS"
<Skyz> Bitcoin and ethereum are taking off
<Skyz> Later bitweasil
<Skyz> Technically you can have an OS for just about anything
<Skyz> Look at ethOS
<bslsk05> ​ethereansos.eth.link: Ξthereans OS - The New Ethereum Order
<Skyz> It's not really a system software os i don't think
gog has joined #osdev
<Skyz> I wonder if Web3 can be built into system applications
alexander has quit [Remote host closed the connection]
<Skyz> They can be imported in Go
<geist> funny i remember at the very start of the book Ubik, the guy wakes up and has something similar
<geist> his whole apartment is pay as you go. you have to stick a quarter in to buy a cup of coffee, etc
<geist> and eventually has to stick a quarter in to unlock his apartment door to leave
<Skyz> Sounds like a good plot
<geist> it goes much further with the concept. great book
<geist> it's one of the few great philip k dick books thats never been made into a movie or a show
<gog> probably because the anticapitalist angle is a bit obvious
<geist> indeed
<geist> though actually i thought i read it's been in production hell forever. the rights have been acquried, etc
alexander has joined #osdev
<gog> ah like fantastic four
<Skyz> Would you consider GPL anti-capitalist?
<gog> it would consider that it denies the conversion of labor into capital
<gog> to an extent
<gog> you can do value-added stuff, but the software itself that you sell as a commercial product ceases to become private property
<Skyz> Yeah because it seems like a good idea for sharing ideas but on the front of capital not really
<gog> if i wrote any code i thought was commercially useful, i'd GPL it
<gog> otherwise i just leave no copyright on my code at all
<gog> that's the only issue i have with the BSD/MIT/Apache-style licenses is that they're commercially permissive
<Skyz> I'm looking for a middle ground because GPL doesn't work with my work-ethic-philosophy
<kingoffrance> gpl relies on copyright aka private property to enforce its terms. you can reject gpl, then you just get normal copyright. and some ppl have claimed that with no copyright, then everything is "free software" (which is true to a point, but if theres no unfree software, its a twisting of terms)
<kingoffrance> gpl does not require acceptance to use software
<kingoffrance> you see this many times quoted in installers for binaries, which then require you to cilck "accept" like they didnt even read it lol
<gog> right, the terms are for developers
<Skyz> I've accepted the terms to some extent, but I started reading it
<kingoffrance> this maybe is not the place, but its a questin of "does private property exist without a state/courts/"the law" to enforce it?"
<gog> the end-user is really only concerned with "this software is provided without warranty with no implied claims of fitness for a particular purpose" or smth
<Skyz> GPL license for the development of my work, maybe useful maybe not but I can't live on no capital
<gog> kingoffrance: the answer is no
<gog> :p
<kingoffrance> so i mean, copyright doesnt exist without a state/law/courts. like most things, its a hybrid, public + private
* gog hefts her copy of Kapital vol 3
<Skyz> GPL is often lower quality software
<kingoffrance> all i would say, is most thigns are hybrid and multidimensional, getting trapped into single dimensions will lead to GIGO
<Skyz> Yeah, I'm trying to get out of the zone
<gog> license doesn't have anything to do with quality
<gog> that's on the authors
<kazinsal> arguably authors focused on GPL software over any other practical type of license are often more interested in creating GPL software than quality software
<gog> i
<gog> what?
<Skyz> I think people make free software for the sake of it being free aswell
<kazinsal> in my experience the Free (tm) software types often do it because of some nebulous idea that making their software Free (tm) inherently makes it good
<Skyz> But where is my free food?
<gog> oh ok
<clever> kazinsal: my general problem with closed software, is that its much harder for me to improve it
<clever> kazinsal: open at least gives me the option to fix things
<kazinsal> when in fact you can slap the GPL on any trash piece of code that you want and the only thing it makes it is difficult to improve other software with
<clever> kazinsal: for example, there are bugs in the rpi firmware, and they only get fixed if you can convince an engineer that something is wrong, and then wait for them to get around to that task
<Skyz> Maybe the warranty is important
<clever> and there is a limited amount of manpower with access to the source
<clever> so you cant donate your own manpower
<kazinsal> yeah my issue with rpi stuff is that it's basically a stack of lies
<kazinsal> "it's an open educational platform!"
<kazinsal> it's barely any of those things
<clever> there are things broadcom and synopsys wont let them document
<clever> and they only document things they think a beginner dev can find useful
<clever> how many developers can understand dram init sequences?
<clever> what do they gain by sharing those docs?
<kazinsal> I like that AMD opens up a lot of their low level docs etc
<clever> how many users can actually make use of it?
<kazinsal> they've been doing some great stuff on the graphics side recently as well, though unfortunately nothing super detailed about shader cores etc
<kazinsal> their new edge-biased spatial upscaler is on github now, MIT licensed I thinkk
<clever> rpi has also been weird in the shader region
<clever> they released docs for the whole 3d core, back in the pi1 days
<clever> the pi4 then changes things, but they havent released proper docs on what changed
scaleww has quit [Quit: Leaving]
<clever> kazinsal: also, parts like the usb core, the vpu, and others, are things broadcom licensed from synopsys
<clever> so broadcom doesnt even have permission to share those docs