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
wolfshappen has quit [Quit: later]
<kazinsal> nice
isaacwoods has quit [Quit: WeeChat 3.2]
<NieDzejkob> gaah, my bios doesn't want to boot my disk if i don't have something vaguely resembling an MBR partition table. I wonder, what on earth is it trying to do that yields this behavior. After all, I'm in legacy mode...
<kazinsal> let me check the documentation for the bios boot spec, which is almost as old as I am
<clever> last i read the specs, you just need a 16bit magic number in the right spot
<clever> but some bios's may be adding their own rules
<kazinsal> huh, this doc doesn't actually say anything about boot sector format
heat has joined #osdev
<NieDzejkob> kazinsal: what document are you referring to, exactly?
<heat> great trivia: firefox apparently doesn't handle 418 i'm a teapot
<NieDzejkob> I've never actually seen a spec, as in a normative document, just descriptions of what the ibm pc implements
<kazinsal> NieDzejkob: BIOS Boot Specification
<kazinsal> it's from 1996, so, quite legacy indeed
<heat> *breathe in*
<heat> USE UEFI ITS GREAT
<heat> *breathe out*
<kazinsal> comedy option: write your own option ROM as a boot device
<klange> s/GREAT/LESS SHIT/
<moon-child> ^
<moon-child> clover has an efi implementation that runs on top of bios
<heat> hey i've grown to really like UEFI
<kazinsal> eventually I'm going to try to fleece some seed money^W^W^W^W find a few grand of startup money and grab some whitebox network appliances and see if I can build a nice signature verifying boot chain for them
<heat> uefi even supports the BIOS, it's great
<heat> Comedy option 2: put your bootloader as a PCI option ROM
<heat> flash storage bad EEPROM good
tacco has quit []
freakazoid333 has quit [Read error: Connection reset by peer]
<moon-child> kazinsal: ooh, that's a cool idea
freakazoid333 has joined #osdev
<kazinsal> yeah ideally I'd like to one day attempt to make network hardware and software a business but in the meantime I'm fine doing it as a hobbu
<kazinsal> hobby*
nyah has quit [Quit: leaving]
gog has quit [Quit: bye]
YuutaW has quit [Read error: Connection reset by peer]
sts-q has quit [Ping timeout: 265 seconds]
YuutaW has joined #osdev
heat has quit [Ping timeout: 255 seconds]
sts-q has joined #osdev
<bslsk05> ​liam-on-linux.livejournal.com: The historical significance of DEC and the PDP-7, -8, -11 & VAX - Liam on Linux — LiveJournal
CryptoDavid has quit [Quit: Connection closed for inactivity]
woky has quit [Quit: Nothing in this world is hopeless!]
woky has joined #osdev
<kazinsal> geist: possibly of interest to you, someone's doing up a vax in verilog: https://mail-index.netbsd.org/port-vax/2021/07/03/msg003899.html
<bslsk05> ​mail-index.netbsd.org: First new vax in ...30 years? :-)
<geist> saw that
<geist> the vax community is all aflutter about it
<geist> seems to be well implemented as well
<geist> amazing too that it fits in about 6k LUTS
<kazinsal> yeah, super neat
<geist> i woulda expected something much larger
<geist> reading the discussion about it, it starts to boggle the mind the complexity of a fast pipelined implementation
<geist> specifically since all of the operands of most instructions can have full addressing modes
<geist> ie, mov (r0)+,(r0)+ sort of stuff
<geist> there's a very specific order that vax instructions process the operands, because that's totally legit
<kazinsal> yeah, the word "complex" in cisc does a lot of heavy lifting in vax
<moon-child> hey even x86 has that kinda
<moon-child> movsb
<geist> apparently PDP-11 was similar, but the mistake DEC made there was to declare most of that as IMPLEMENTATION DEFINED
<moon-child> owait, no
<moon-child> geist: oof
<geist> and across all of the implementations of pdp-11 it was all over the place
<moon-child> oy
<geist> so when they designed VAX they learned from their mistakes and very strictly specified the order things are done in and precisely how things like page faults occur/etc
<geist> cpu has to effectively 'pre flight' all of the addressing modes and resolve faults in them first
<geist> and the (r0)+ is a simple one, like 68k there are a few double indirects
<geist> take address in r0, look up address, increment r0, then read what is in the address you looked up, etc
<geist> i forget how it's written but looks something like ((r0)+) kinda stuff, or even 8((r0)+,r2)
<moon-child> sounds like something that would come up when doing vtbls
<geist> anyway so you can simply microcode it and take it one step at a time, but even then you still have to i think hold off any writebacks to any registers until you've resolved all the addressing modes
<geist> since a later indirect could page fault and you have to unwind the entire instruction
<geist> moon-child: oh totally, and since vax is very regular you end up with basically call (some complex addressing mode) that handles layers of vtables and whatnot
<geist> what's whacky is the opcode layout is pretty clean: lots of opcodes are single byte, and then the next word describes the first operand, repeat. it's like a recursive descriptor
ElectronApps has joined #osdev
<geist> the only implictness is the opcode byte implicitly encodes the number of operands
<geist> my take is yes it's cisc, but it's also highly regular. it's cisc in a 'clean' way, unlike x86 cisc where it's a dumpster fire of layers of hacks
<kazinsal> yeah, the isa is complex but at least it's organized
<geist> i've been meaning to write a decoder for it for luls. looks at lot more fun than x86
<geist> of courtse later on they added escape opcodes and multi byte stuff, etc
<kazinsal> no smattering of prefix bytes leading to a dozen bytes of opcode
<geist> plus there are the few famous completely batshit instructions
<geist> and some really complex things like the whole function call microcode stuff, which i think in the end turns out to be not useful
<geist> kinda like ENTER/LEAVE on x86
<kazinsal> oh that reminds me, apparently some researchers found that in red unlock mode on intel processors, 0F 0E and 0F 0F aren't undefined
<kazinsal> they're microcode interfaces
<moon-child> 0f 0f was the 3dnow prefix on amd
<kazinsal> think it's the same guys who discovered the whole red unlock thing in the first place
riposte has quit [Quit: Quitting]
riposte has joined #osdev
froggey has quit [Ping timeout: 252 seconds]
froggey has joined #osdev
ElectronApps has quit [Remote host closed the connection]
Robbe has quit [*.net *.split]
drewlander has quit [*.net *.split]
j00ru has quit [*.net *.split]
moon-child has quit [*.net *.split]
koon has quit [*.net *.split]
JerryXiao has quit [*.net *.split]
Geertiebear has quit [*.net *.split]
bradd has quit [*.net *.split]
eschaton has quit [*.net *.split]
nshp has quit [*.net *.split]
maurer has quit [*.net *.split]
PapaFrog has quit [*.net *.split]
nanovad has quit [*.net *.split]
Beato has quit [*.net *.split]
warlock has quit [*.net *.split]
Mutabah has quit [*.net *.split]
aquijoule__ has quit [*.net *.split]
CompanionCube has quit [*.net *.split]
LittleFox has quit [*.net *.split]
springb0k has quit [*.net *.split]
mjg has quit [*.net *.split]
cultpony has quit [*.net *.split]
Mikaku has quit [*.net *.split]
LambdaComplex has quit [*.net *.split]
gmodena has quit [*.net *.split]
sahibatko has quit [*.net *.split]
Ar0n has quit [*.net *.split]
Celelibi has quit [*.net *.split]
Retr0id has quit [*.net *.split]
ornitorrincos has quit [*.net *.split]
gmodena has joined #osdev
aquijoule__ has joined #osdev
LittleFox has joined #osdev
Robbe has joined #osdev
JerryXiao has joined #osdev
moon-child has joined #osdev
mjg has joined #osdev
drewlander has joined #osdev
Mikaku has joined #osdev
j00ru has joined #osdev
springb0k has joined #osdev
koon has joined #osdev
CompanionCube has joined #osdev
nshp has joined #osdev
Geertiebear has joined #osdev
bradd has joined #osdev
cultpony has joined #osdev
LambdaComplex has joined #osdev
nanovad has joined #osdev
eschaton has joined #osdev
ornitorrincos has joined #osdev
Ar0n has joined #osdev
PapaFrog has joined #osdev
maurer has joined #osdev
Celelibi has joined #osdev
sahibatko has joined #osdev
Beato has joined #osdev
warlock has joined #osdev
Mutabah has joined #osdev
Retr0id has joined #osdev
elastic_dog has joined #osdev
mahmutov has quit [Ping timeout: 268 seconds]
dennis95 has joined #osdev
ElectronApps has joined #osdev
MarchHare has quit [Ping timeout: 255 seconds]
nick8325 has quit [Quit: Leaving.]
jjuran has quit [Quit: Killing Colloquy first, before it kills me…]
jjuran has joined #osdev
<immibis> a pinephone success - I wrote some assembly code, assembled it, wrote it to memory, executed it, returned to the bootloader, and read a result from memory, all using the USB flashing interface
<j`ey> immibis: nice!
<immibis> spent a while looking for ways to reset the device but then realized I could just return from the code block because it's a call not a jump
elastic_dog has quit [Ping timeout: 252 seconds]
<FireFly> oh sweet
<immibis> useless fact: no matter how fast you can unplug and replug the power cable, it's not fast enough to prevent SRAM from resetting
<geist> yah generally sram goes to zero fast
elastic_dog has joined #osdev
<immibis> well, random values
<immibis> maybe the bootloader is using this particular block of sram
<immibis> or maybe it just initializes to unpredictable values
<immibis> which would make sense since sram has no particular preference for 1 or 0
<immibis> didn't try DRAM because I know DRAM needs some initialization. But the boot ROM probably initializes it so I should try it
<moon-child> I wonder if there are security considerations there
<geist> probably not
<moon-child> if memory controllers always zero-initialized ram when powered on, cold boot attacks would become more annoying to carry out
<geist> i've only ever seen one SOC explicitly wipe out internal sram
<moon-child> would need to get a special-purpose memory controller
<geist> xilinx fpga ZYNQ
<geist> it has a whole anti-glitch boot sequence thingy, including zeroing SRAM. kinda neat
<geist> but it really had to go out of its way to do it
<geist> most socs just yolo it
<geist> but... SRAM i think instantly loses its state when you drop power on it. i think
<geist> DRAM however can hold its state for some period of time. many seconds
<geist> it's the nature of the technology
<geist> but also on the same note, the default state of SRAM is basically random
<geist> different bits may have a slight bias towards one or the other maybe
GeDaMo has joined #osdev
<immibis> does the arm-none-eabi target support hardfloat?
tacco has joined #osdev
Arthuria has joined #osdev
sortie has joined #osdev
larkfisherman has joined #osdev
asymptotically has joined #osdev
Skyz has joined #osdev
larkfisherman has quit [Quit: Konversation terminated!]
mahmutov has joined #osdev
ElectronApps has quit [Read error: Connection reset by peer]
ElectronApps has joined #osdev
Arthuria has quit [Read error: Connection reset by peer]
Arthuria has joined #osdev
<immibis> how long is the timeout after too many failed logins on the wiki?
<klange> Likely whatever the mediawiki default was twelve years ago...
scaleww has joined #osdev
Arthuria has quit [Read error: Connection reset by peer]
Arthuria has joined #osdev
dennis95 has quit [Quit: Leaving]
<immibis> I wonder if SRAM initial state can help you sense magnetic fields or something like that
<immibis> you know, if the current has a very slight bias towards going in one direction on the chip
<clever> immibis: i would think that which side of the sram cell the vcc line comes in on, would also play a role
<clever> the timing for one gate to gain power, vs another
<Skyz> Why are there so many services in the os api?
<immibis> clever: well yes. you'd have to look for a tiny correlation separately on each bit
<immibis> Skyz: what do you mean?
<immibis> it might even take millions of power cycles to detect such correlations. quite impractical
<Skyz> Like there is so much to learn if your gonna learn the documentation
<j`ey> Skyz: you dont memorise it all
<j`ey> you learn the basics, and learn how to use the documentation
isaacwoods has joined #osdev
<immibis> there are so many services because the world has lots of services. They can either be in the OS, or somewhere else
<Skyz> Like what is a com object
<Skyz> COM (Component Object Model)
<Skyz> That's so abstract
<immibis> It's an object. You know Object-Oriented Programming? It's that
<immibis> windows had OOP before it had C++
<immibis> Word can create an Excel spreadsheet object and place it in a Word document *even though Word and Excel are separate processes*
<immibis> and it even worked with third-party software. I remember placing a Crocodile Physics electric circuit in a PowerPoint presentation
<Skyz> That's impressive for microsoft
<immibis> that is a system called OLE, but after they invented OLE, they realized the OOP part of OLE didn't need to be stuck onto the actual OLE part, so they split it up, and that part was COM
<immibis> COM is also used for stuff like shell extensions (Windows Explorer plugins); Windows Explorer can create an instance of your plugin and then ask it "do you want to add any items to this menu?"
<clever> there was also activex .....
<immibis> ever used VBA? Almost every VBA object is a COM object. So all that scripting stuff you can do with Excel, you can also do from C++, from a separate process, etc
<Skyz> Turing Complete
<immibis> well yeah, scripting languages are turing complete on purpose
<immibis> (COM is not a scripting language, it's a system that defines the things you can script)
<immibis> Skyz: you can have an OS without COM, though. COM isn't part of the kernel. It's a higher level, like DBus on Linux
<immibis> Linux doesn't care about DBus. From Linux's point of view, DBus is just some program that someone wrote
<immibis> same with COM on Windows
<clever> immibis: i have heard of plans to integrate dbus into the kernel more...
<immibis> I have also heard of those, but for now, dbus is something that runs on linux, not part of linux
<clever> yeah
<immibis> even if they integrate it more, they will probably integrate the bare minimum - the "how to send messages between processes" part - and the rest will be built on top
<Skyz> Worth achiving tbh
<immibis> Skyz: it's worth keeping the kernel simple
<immibis> you may think linux is big but most of it is just device drivers
<Skyz> For publishers to use an OS there needs to be something to it
<Skyz> But if it's just a toy os it doesn't matter
<Skyz> Simple is best
<immibis> every OS is a toy OS except for Linux, Windows, L4, and Fuschia
<Skyz> So if it can run an application it's a good os
<immibis> oh and Darwin
<j`ey> bsd?
<immibis> (BSD fans fite me irl)
<immibis> fuschia might also end up being a toy OS
<j`ey> its in products!
<immibis> at a previous job i saw software with support for vxworks. So maybe there are more non-toy OSes than I think. But for desktop it's Linux, Windows, OSX
<immibis> If you're designing an embedded product you might choose something like VxWorks
<immibis> you won't if it doesn't come with a hefty support contract or something
<Skyz> QNX too
<immibis> if you want to sell your OS to a business, you need a reasonably good product, and an army of salespeople and marketing people and lawyering people
<Skyz> Somehow the whole free-software movement avoided that without giving warranty
<Skyz> it's good for developers but for computer users i diagree that it's been useful
<immibis> linux has a reputation. vxworks doesn't (really)
<immibis> nor L4 nor QNX nor Fuschia nor ...
<immibis> developers know linux the way they know javascript
<clever> immibis: ive seen people mess up basic security on so many levels
<clever> ever heard about that car radio exploit?
<immibis> I've heard of the concept of car radio exploits
<clever> the radio had dbus listening on tcp, bound to the any addr
<clever> so if you could connect to it (both wifi, and over BLOODY CELLULAR), you could issue dbus calls
<immibis> internet that your car doesn't need --> modem that your car doesn't need --> smart radio that your car doesn't need --> CAN bus --> fuel injection system
<immibis> congratulations your engine is now running at 100% all the time and your accelerator pedal does nothing
<clever> the dbus service also had a function call, to execute code as root, WHY??
<clever> but they did plan for exactly what you said
<clever> there is an MCU acting as a firewall on the CAN bus
<clever> only approved commands can flow thru it
<clever> re-flashing that MCU requires putting the entire radio into an update mode
<clever> its supposed to only execute an update from a usb stick
<immibis> but the update was mediated by the main processor?
<clever> they missed one shell script that is writable when in normal mode
<clever> the MCU can only be updated if the whole system reboots into an updating mode
<clever> and the main processor should then only execute code from the usb stick
<clever> which requires physical interaction
<clever> but they missed one file on the internal FS
<clever> also, the wifi itself was its own nightmare
<clever> the WPA key, was based on the unix timestamp of the first boot
<clever> before ntp has had a chance to fix the time.....
<clever> what is the unix timestamp at that point?
<clever> the number of seconds it took to boot
<Skyz> It looks like technology is all getting connected to the internet, IT is useful in every domain
<Skyz> I guess the reason why system programming isn't seen so useful today is because everything has gone to the cloud
<Skyz> Internet speeds are reaching 5G
<j`ey> who says system programming isnt useful?
<Skyz> I am
<Skyz> it is useful
<Skyz> just a lot is being solved
<Skyz> and this
<Skyz> The last page sums it up
<Skyz> From Rob pike
<immibis> oh i remember reading that, and yes, it's true
<Skyz> Basically says that systems projects won't be developed more because of lack of funding ant a lack of new ideas
<immibis> do you have some new ideas?
<Skyz> Yes
<Skyz> On the software side
gog has joined #osdev
<Skyz> AI could be embedded with computers
<j`ey> immibis said new ideas :P
<Skyz> Well if you think about it it can change the OS API
<Skyz> I haven't looked at it but there is ROS https://www.ros.org/
<bslsk05> ​www.ros.org: ROS.org | Powering the world's robots
<klange> ROS is a system for running industrial arms. Robotics is not AI.
<clever> there is a major difference between control and thought
<klange> Real life robotics is far more boring than the kind in an Asimov short.
<Skyz> I'm more interested in the between of the two, Computers and Robots
<klange> Then you will find that operating systems have nothing to do with your interests and most robotics platforms in the real world run Linux or a barebones RTOS.
<klange> If you want to get into robotics, real robotics, it's all mathematics and mechanical engineering - inverse kinematics, physics simulation.
<klange> Closest it gets to any modern AI topics is object recognition, but you'd be surprised just how solved that problem is in industrial settings - most of the research now is on universal object recognition, and a factory has little need for that.
<Skyz> I disagree, a computer can be smart without moving in the world
<klange> You disagree with what?
<Skyz> Universal object detection is something I'm interested in
<klange> Robotics is _entirely about moving in the world_. That is _all_ robotics is about.
<Skyz> I just wanted to do universal object detection within a game or a computer
<gog> why do you need it in a game
<gog> a game has a limited scope of objects
<gog> except scribblenauts i guess
<Skyz> It just seems doable
<gog> right but to what end
<Skyz> Making a new OS
<j`ey> ..
<gog> ...what
<j`ey> Skyz: youre not making any sense
<klange> _What_
Arthuria has quit [Read error: Connection reset by peer]
<Skyz> To make an OS API that's new
<j`ey> Skyz: you want to add objection detection in a game, to make a new os?
Arthuria has joined #osdev
<immibis> object detection would be considered application software rather than system software
<Skyz> That allows for it to use the new api in the computer to detect objects
Arthuria has quit [Read error: Connection reset by peer]
<j`ey> Skyz: not needed at the OS level
Arthuria has joined #osdev
<Skyz> Maybe redesign the OS model and see if novel ideas come from it
<klange> Do you even _know_ what object recognition is?
<Skyz> It's just reading pixels on the screen
<klange> It has nothing at all to do with screens.
<klange> Or necessarily pixels.
<Skyz> Well it does come down to pixels but there is math involved, i don't know how all that works
<Skyz> You don't necessarily need to make it at the OS level
<Skyz> I had something in mind that would use the os
<immibis> when you consider system software as a communication framework for application software, there is plenty of room to redesign it, but apparently none of that room is interesting enough
<immibis> Skyz: why does it need to use the OS?
<Skyz> Performance, maybe self-awareness
<klange> That doesn't make sense.
<immibis> and what are you considering as "the OS"? If Microsoft puts an object recognition library on their install CD, it becomes part of "Windows", but the kernel team might have a different opinion
<klange> You don't seem to understand what an OS is.
<immibis> the kernel team wouldn't consider it part of the OS, but the marketing team would
<klange> Which is odd because on the one hand you keep parroting Pike's famous quote, but on the other you don't seem to get why he said that.
<Skyz> I include the task bar as part of the OS
<Skyz> So I learn towards the marketing end of the os definition
<immibis> sure. But the task bar is something you could buy on a separate CD and then install. And then it wouldn't be part of the OS
<immibis> even though it would be the exact same code
<Skyz> In the end the OS is for the USER
<immibis> if you want to make a linux distribution with some custom software on it, this may be the wrong channel
<Skyz> I want to make something that is not a linux distribution
<immibis> why not?
<Skyz> I wanted to redesign the os
<immibis> If you take a copy of (for example) debian, and you put your object recognition library on the CD, and you make it so that when I install it the object recognition library is on my hard drive, then the object recognition library is part of the OS
* j`ey puts #osdev on ignore for a bit
<gog> Skyz: maybe you should set your sights on more short-term goals
<Skyz> gog: I'm just learning programming
<immibis> It sounds like your redesign just means it has more libraries. Am I missing something?
<Skyz> immibis: probably not
<gog> focus on that instead of grandiose ideas then
<gog> your efforts will feel more rewarding
<immibis> usually when someone writes a library we don't call it "a redesigned OS". If the library is important, Linux distributions start distributing it, and then it's unofficially part of "the Linux OS"
<Skyz> immibis: I'm gonna think about that
<Skyz> it is kind of grandiose
<Skyz> Maybe AI could make your computer experience more enjoyable
<Skyz> I'll brb
<gog> frankly i don't want AI running in my computer watching everything i do
mcfrdy has joined #osdev
<immibis> Skyz: "System software" / "operating systems" are the glue that keeps all the programs on your computer running; the actual programs that you run (such as an AI) are "application software"
<immibis> You can call the programs included on the install CD (like Internet Explorer) "part of the operating system" - it's kind of ambiguous (as we've said before)
<immibis> but you don't need any special skills to put a program on an install CD
<immibis> you could write Internet Explorer without ever learning about "operating system development"
<immibis> Skyz: how is your learning to program going?
wootehfoot has joined #osdev
<Skyz> back, I'm starting to use version control for my program
<Skyz> Basically.. It could go either way
<Skyz> Either make it using current api or see if new api can be written into the os
<Skyz> maybe all the api is already there in windows
<immibis> all the API is already there in windows
<immibis> I guarantee it
<gog> you want APIs? windows has APIs
<gog> in fact aren't a lot of win32 functions doubled up for ascii and ucs2
<Skyz> Immibis: by your definition just the core components are the os
<bslsk05> ​en.wikipedia.org: List of Microsoft Windows components - Wikipedia
<immibis> it's a fuzzy boundary
<immibis> a very fuzzy boundary
<immibis> I think here in #osdev most of us are interested in the core components
<immibis> rather than, say, hte photo viewer
<immibis> rather than, say, the* photo viewer
Robbe has quit [Quit: Ping timeout (120 seconds)]
<immibis> but there may be interest in making sure your OS *can* display photos. there probably is not interest in using AI to detect the faces in those photos.
heat has joined #osdev
<gog> yes. an OS is not a rigidly-defined thing
<Skyz> like I said it can go either way
<immibis> perhaps we should include a photo viewer inside "an operating system", but not inside "operating system development"
<heat> osdev is a lot more focused on the kernel than anything else
<Skyz> I would say that the boundary is at the application level,
<Skyz> Some applications are fuzzy
mahmutov_ has joined #osdev
<immibis> the kernel is where the special stuff is. Applications are just applications
<immibis> device drivers too; filesystems; network protocols (in case any of these aren't part of your kernel)
<immibis> i've now written some code to control the LED and found that the RGB colours are labelled incorrectly in the schematic
<immibis> maybe next i will try to get a white screen
<immibis> or whatever is in the framebuffer by default. instead of the screen being turned off
<immibis> oh I should test that the DRAM has been initialized by the boot ROM. Probably has
<heat> what are you working on?
<klange> Generally black.
mahmutov has quit [Ping timeout: 272 seconds]
<immibis> heat: pinephone
<immibis> there are released operating systems for the pinephone (based on linux), but I wanted to make one!
<immibis> generally. either black or garbage would be my guesses. and no! reading from DRAM hangs. So I guess I do have to do something to make it work
<immibis> the display system is probably going to want a framebuffer in DRAM
<clever> immibis: for the rpi display system, it should be possible to drive a framebuffer from the L2 cache-as-ram
<heat> immibis, oooh nice!
<clever> but the rpi L2 cache, behaves fairly differently from other systems
<immibis> heat: the boot ROM contains a fallback that lets you directly read and write memory and execute code over some proprietary USB protocol that's been reverse-engineered
<immibis> if no bootloader is found, or you install a stub bootloader that jumps to this part of the ROM (which I did)
<heat> this might be useful
<heat> since you seem to be writing firmware for the damn thing lol
<immibis> i guess dram initialization is proprietary, fiddly, and the best way to do it is to just copy it from u-boot or boot from u-boot
<clever> immibis: i still havent been able to RE the ddr4 init on the pi4, thats been a major blocker for me
<clever> and there is no u-boot to copy from either
<heat> isn't the pinephone supposed to be open lol
<immibis> * Unfortunately the only documentation we have on the sun7i DRAM controller is Allwinner boot0 + boot1 code, and that code uses <- but this comment seems to imply the boot code should do it for me
<immibis> heat: as much as possible, but it does need to have a CPU in it...
<immibis> heat: they have published a bunch of CPU specs that are marked CONFIDENTIAL, and being allowed to do this is probably why they use a 6-year-old CPU, so it's not like it's fully closed, either.
<bslsk05> ​www.crowdsupply.com: MNT Reform - Re-Introducing Reform | Crowd Supply
<clever> heat: this laptop is also "open", yet it relies on a blob to initialize the ddr4 controller
<clever> > Unfortunately, during the boot process, i.MX8M requires a closed-source firmware for an embedded ARCompact processor in the Synopsys DDR4 PHY. This firmware, which is only a few kilobytes in size, is responsible for regulating the physical connection to the DDR chips in the face of changing temperatures.
Skyz has quit [Quit: Ping timeout (120 seconds)]
<immibis> firmware that goes on hardware devices is debatably "open" or "closed". For free software purposes, would we have a problem if that code had been embedded in ROM?
<immibis> because that would be even less open, yet somehow, less of a problem
<clever> i think the line is generally drawn at firmware held on the motherboard?
<clever> so the bios doesnt really count, in most cases
<clever> and the rpi is "not open" because that firmware has to live on the SD card in /boot/
<clever> i have RE'd the boot rom for all 4 models of rpi, and can explain exactly what its capable of
<immibis> but that is still *more* open than if it was held on the motherboard, which is strange
<clever> based on what the fuses are set to, i can confirm what your specific chip is capable of doing, which can then give you garantees about its security
<clever> i could also make utils to confirm your rom is what i RE'd
<clever> immibis: in the case of the RPI boot rom, it can basically only do 1 thing, load bootcode.bin into the L2 cache, and execute it, with an optional hmac-sha1 check
<clever> the only real flexibility, is that it can load that file from ~10 different sources
<clever> depending on fuses and model
<clever> one of them is a usb device protocol, like what you mentioned above
scaleww has quit [Quit: Leaving]
nyah has joined #osdev
Arthuria has quit [Read error: Connection reset by peer]
Arthuria has joined #osdev
gareppa has joined #osdev
gareppa has quit [Remote host closed the connection]
Arthuria has quit [Ping timeout: 255 seconds]
immibis has quit [Remote host closed the connection]
MarchHare has joined #osdev
immibis has joined #osdev
mahmutov_ has quit [Ping timeout: 258 seconds]
zoey has joined #osdev
ElectronApps has quit [Ping timeout: 272 seconds]
solar_sea_ has quit [Quit: Leaving]
solar_sea has joined #osdev
mahmutov_ has joined #osdev
<nur> okay so uh, I found the culprit for stack clobbering in my ISR
<nur> it's code that only appears when I do an -O2
<nur> but works when I do -O0
<heat> red zone?
<nur> what's a red zone
<heat> sys v abi stuff on x86_64
<nur> oh this is x86_32
<nur> what is red zone?
<bslsk05> ​en.wikipedia.org: x86 calling conventions - Wikipedia
<heat> it's a 128 byte sized location under the stack pointer that you can access without moving the stack pointer
<GeDaMo> "For leaf-node functions (functions which do not call any other function(s)), a 128-byte space is stored just beneath the stack pointer of the function. The space is called the red zone. This zone will not be clobbered by any signal or interrupt handlers."
<heat> essentially you need to disable it in kernel code or any code that may be straight up interrupted by the CPU in the same stack since it's not red-zone-aware
<nur> does this apply to x86-32
<heat> (signal handlers get away with it by skipping the first 128 bytes under the stack)
<heat> no.
<nur> hrm
<heat> what's the code?
<nur> okay I will paste it in pastebin
<nur> do you also want the surrounding asm?
<heat> yes
<bslsk05> ​pastebin.ubuntu.com: Ubuntu Pastebin
<nur> ok so that is the wrapper
<bslsk05> ​pastebin.ubuntu.com: Ubuntu Pastebin
<nur> and that is the C function and disassembly
<nur> 1009a0: c7 45 08 f4 09 10 00 movl $0x1009f4,0x8(%ebp)
<nur> this overwrites the top of the stack
<heat> ok, the wrapper looks good as far as I can see
<heat> although I'd recommend you do iretd/iretl(not sure which is valid in x86_32 GAS)
<nur> okay but that's not where it's going wrong
<heat> hmm that does look weird
<heat> can you give me the registers_t?
<nur> okay hang on
<heat> i want to look at this under godbolt
<bslsk05> ​pastebin.ubuntu.com: Ubuntu Pastebin
asymptotically has quit [Quit: Leaving]
<dzwdz> i'm considering putting my stack right under the kernel, since the kernel gets loaded at 1M - is that a bad idea?
<dzwdz> assuming that i'll set up paging so that the kernel isn't writeable after boot
<heat> dzwdz: doen't matter since that stack will be unused after bootstrapping
<heat> doesn't*
<heat> nur: gcc version?
<heat> (also I'm assuming printk is something like "int printk(const char *format, ...);")
<dzwdz> who says that it won't?
<heat> dzwdz: you'll need a separate kernel stack per thread
<immibis> dzwdz: presumably you'll have a memory allocator later that can allocate stacks wherever they fit
<dzwdz> heat: don't you mean per core?
<heat> dzwdz: no
<dzwdz> if so, then since the amount of cores is static i could just divide that 1mb up
<dzwdz> ah
<heat> generally, each thread has a separate kernel stack because each thread can be preempted inside the kernel
<heat> even usermode threads
<immibis> i suppose that depends on how you do threads, aren't there multiple possible designs?
<dzwdz> this might be a dumb question, but what are threads used for in the kernel?
<immibis> one of which is a non-reentrant kernel
<dzwdz> i'm going for a microkernel-ish design, so i've assumed that i'd only need to have threads in the userspace
<heat> dzwdz: thread stuff
<immibis> in a microkernel design you might not need kernel threads
<immibis> because all the stuff that would've been a kernel thread won't be in the kernel...
<heat> anyway, even a user thread needs a separate kernel stack
<heat> for a preemptible kernel design of course(like most kernels)
<nur> heat, i686-elf-gcc (GCC) 10.2.0
<immibis> anything you can write with threads you can also write asynchronously, but maybe you don't want to
<nur> heat, also yes about printk
<bslsk05> ​nurh/treehouse - A beginner's operating system. (0 forks/0 stargazers/MIT)
<nur> this if you wanna see the rest of it
<heat> nur, this code must be correct
<heat> I just don't know how
<nur> maybe I can stick a memory barrier somewhere to stop gcc from being clever
<heat> no
<nur> that won't work?
<heat> waiit
<heat> of course
<nur> yes?
<heat> your wrapper is wrong
<nur> oh
<nur> where
<heat> the esp alignment is bogus, you can't do it there
<heat> you're also pushing a random 0 for some reason(it's not reflected in the struct)
<nur> the 0 is the error code
<nur> int no and error code
<heat> I'm talking about the pushl $0x0
<nur> oh
<nur> crap
<nur> why is that there
* nur scratches head
<nur> why is THAT there
<heat> you should only align the stack after pushing everything
<nur> oh
<nur> it's for padding
<heat> (with the and %esp, -16)
<nur> okay but
<nur> if you do that afterwards
<heat> tip: pass the structure as a pointer
<nur> won't there be like space at the end?
<nur> oh right the pointer will take care of the space problem
<heat> yes you'll use a tiny bit more space because you're aligning the stack
<heat> but that's not an issue
<nur> I still don't know why the clobbering takes place though
<nur> and doesn't when not optimised
<heat> i assume the compiler is using some tiny trick in the ABI that I don't know of
<nur> compiler is tricksy, we hates it precious
<heat> passing structures by value is tricky
<nur> well thanks heat, I'll try fixing it that way
<heat> np
<heat> i assume there's a peculiarity of i386 structure passing that I can't remember and is screwing you over that way
<heat> why is hexchat on 100% cpu usage
heat has quit [Quit: Leaving]
heat has joined #osdev
isaacwoods has quit [Read error: Connection reset by peer]
Skyz has joined #osdev
<nur> how do I get "pointer to here" in asm
<heat> here where?
<nur> the part of the stack where I am storing the registers_t struct
<nur> do I just save the stack pointer
<j`ey> yes
<nur> hrm
<nur> but where do I save it
<nur> after I push registers, the registers will _still_ hold the values it last had right
<heat> yes
<nur> cool
<heat> very
<nur> when we return from the C function back into the asm wrapper, what's the stack going to look like
<j`ey> the same as it was before
<nur> will it still have the pointer we pushed as an argument?
<doug16k> nur, yes but don't rely on it. they are allowed to write to the parameters
<nur> bugger
<doug16k> why?
heat has quit [Ping timeout: 268 seconds]
<nur> I need to find the place where the struct is again so I can pop the registers back
<doug16k> save that in a callee saved register
<doug16k> x86_64?
<nur> 32
<doug16k> C code will preserve ebx, esi, edi, ebp, esp across function calls
<nur> ah
<doug16k> it's guaranteed to still be what you put there when they return
<nur> I did not know that
<nur> thanks
freakazoid333 has quit [Read error: Connection reset by peer]
<doug16k> you also have to play along with that. if you write to one of those, you need to save it before you write it and restore it before you return
<doug16k> if this is interrupt dispatch, you probably pushed tons already
<nur> gotcha
<doug16k> if C calls you, you can overwrite eax, ecx, edx without worrying about it
<jimbzy> Ahoy!
<bslsk05> ​pastebin.ubuntu.com: Ubuntu Pastebin
<nur> revised
<doug16k> you lose the original esp right?
<doug16k> oh I see, ebx
<doug16k> line 40 just cancels out line 30
<nur> does it matter at that point?
<doug16k> what was the point of line 34 then?
<nur> it's a pointer to all the registers struct
<nur> it's a parameter for default_interrupt_handler
<doug16k> ya then you put esp back and it's not on the stack anymore?
<nur> huh?
<doug16k> look what the code does
<doug16k> dont read the comments
<doug16k> you push ebx, save esp in ebx, align esp. so far, fine, it goes off the rails after that
<doug16k> oh my bad
<doug16k> line 36
<nur> I push ebx which holds the address of the start of the struct
<nur> you missed the function call huh
<doug16k> why line 44
<doug16k> yes lol
<nur> to get the sp back to the end of the struct
<nur> so we can pop off the things we saved originally
<doug16k> you are quite careless with the stack pointer
<doug16k> here's the thing about that: you need to make sure that esp points at or below the lowest address thing on the stack
<doug16k> how does sub do that?
<doug16k> you know the stack pushes down right?
<nur> yes
<doug16k> sub allocates more stack space
<nur> no
<doug16k> add frees stack space
<nur> the sp at this point should hold the address of the beginning of the struct
<nur> and subtracting 76 bytes puts it at the end
<nur> how else would we find the end
<doug16k> you are doing it dangerously
<doug16k> easy fix though
<doug16k> lea -0x4c(%ebx),%esp
<nur> why is that safer?
<doug16k> because the cpu is allowed to push to the stack anytime it pleases
<nur> ahh
<doug16k> even if interrupts were disabled
<doug16k> interrupts disabled just makes it far less likely
<doug16k> your code should do that if at all possible, even if you could get away with not doing it
<doug16k> imho
<doug16k> do that = make sure esp is below all good data
<doug16k> ...at all times
<doug16k> you could set it up so anything interrupt that could occur there switches to another stack, so you'd get away with it, but it's a lot better to just adopt a robust style of managing the stack frame and never point esp dangerously ever
<bslsk05> ​pastebin.ubuntu.com: Ubuntu Pastebin
<nur> alright how does it look now
<doug16k> the /* comments are awful
<doug16k> you can hardly tell the code and comments apart
<doug16k> it's like you are doing that on purpose
<nur> sorry :(
<doug16k> each line I have to put my brain parser back to wtf language state?
<doug16k> normally there is a hardware accelerated // prefix detector :P
<nur> okay I'll change the comment style to that
<nur> I wonder if there's a pastebin with a syntax highlighter
<doug16k> that or just make the comment begin at the same column as code so my brain can switch the comment hardware to /* mode
<doug16k> lol
<j`ey> nur: paste.gg
<doug16k> I think the /* is triggering fear that the whole thing is commented out, so I spend inordinate time seeing if that line of code is commented out
<bslsk05> ​zerobin.net: ZeroBin.net
<nur> does that look better
<doug16k> why push 0 0x20
<nur> error code and interupt number
<doug16k> no
<doug16k> what about eax ecx edx?
<bslsk05> ​zerobin.net: ZeroBin.net
<nur> pushal?
<doug16k> oh god
<doug16k> hideous
<doug16k> never use that idiotic instruction
<doug16k> it pushes esp. how stupid is that?
<doug16k> and get this: popal throws away the esp it pushed
<doug16k> why don't you rearrange it then so pushal pushes the ebx?
<nur> I mean...it does
<doug16k> pushing esp is stupid because esp is the pointer to the context, it isn't part of the context
<nur> I mean, I don't use it
<nur> but it pushes everything so
<nur> *shrug*
<doug16k> it'll chomp through 4 individual pushes per cycle
<doug16k> in decode
<doug16k> that's all that matters, it'll queue up those stores
<doug16k> or you could generate an asinine extra store to save typing
<doug16k> so basically you are saving the 4x per cycle resource and wasting the 1x per cycle resource
<nur> so uh, I save the registers manually?
<doug16k> if pushal didn't push esp, I'd love it
<doug16k> the couldn't be bothered to make the instruction make sense
<doug16k> just conveniently iterate 0 thru 7 in dumbass microcode
<doug16k> then they realized that it crashes if popal pops esp so they made it special case esp in popal
<doug16k> you should
<doug16k> esp makes no sense in a kernel context
<doug16k> esp points to the context, what sense is it to spend memory and store bandwidth on a value you need to know to find it
<doug16k> you don't even need to push all
<doug16k> all you need is ebx right?
<doug16k> you don't even need to save esi, edi, ebp then
<doug16k> just save eax, ebx, ecx, edx
<doug16k> the C code will, if needed, save ebx/esi/edi/ebp
<doug16k> but wait though
<doug16k> if this were the context switch code, then you need to save everything
<doug16k> if this is just IRQ handler and always returns to where it was, then you can push less
<doug16k> when you say the struct, it implies your code can use it
<doug16k> why does it push ebx as the parameter?
<doug16k> that doesn't make sense
<doug16k> oh I see
<doug16k> your code doesn't care about the alignment of the struct, only the stack
Skyz has quit [Quit: Client closed]
<doug16k> that code call is guaranteed to have a misaligned stack
<doug16k> line 40 has a misaligned stack, guaranteed
<doug16k> I guarantee the last digit of esp is 0xc
<doug16k> it must be 0
<doug16k> you don't just slap an alignment of the stack somewhere and tick the box "aligned stack"
<doug16k> the stack has to be aligned right at the point you execute the `call` instruction
<doug16k> you are doing it the harder way
<doug16k> here's the easier way: sub $ size_of_all_parameters_here,%esp ; and $ -16,%esp ; mov %ebx,(%esp) ; call thing
<doug16k> do more mov to 4(%esp) 8(%esp) etc if more parameters
<doug16k> can even reuse the same argument space for multiple calls - just allocate the max you needed
<doug16k> aren't call abis fun? :P
<doug16k> stack frames can be worse than this
<nur> ouch
<nur> thanks doug16k
<nur> 2am, time to retire
<nur> talk to you tomorrow, I'll try that
<doug16k> you could also just subtract 12 from esp before that push
<doug16k> then the push would realign and you're good
<doug16k> alright
<doug16k> not sure why "ouch", I meant some architectures have more painful stack frame rules
NieDzejkob_ has joined #osdev
jeaye has quit [Remote host closed the connection]
jeaye has joined #osdev
Arthuria has joined #osdev
<NieDzejkob_> How can capability-based microkernels handle introspection? Things like listing the processes, attaching gdb (= obtaining a handle to the process)
* geist wakes up, yawns
<geist> gosh, reading the backlog last night with Skyz is headache inducing
<geist> they're still years later stuck in the same rut
<geist> it's this while loop of no progress
<kazinsal> yeah I threw them on ignore a couple weeks ago
<kazinsal> it's just not even worth reading
<geist> yah i did too, but folks keep engaging with him
<geist> but i think back on ignore it goes
Skyz has joined #osdev
<Skyz> I have made progress on finding new avenues to take an OS, that's the only thing I'm after
<j`ey> geist: lol why did you say anything :P
<kazinsal> oh no
<kazinsal> it's almost too bad znc doesn't take ignores and insert a <ignored message> line or something
<kazinsal> at least it dumps PMs as well as channel messages
<Skyz> I was just hoping OS dev could be more than a hobby
<kazinsal> it also ignores join/parts I guess
<Skyz> AI in an OS is an avenue to take it.
<geist> kazinsal: yah irssi at least does a straight up no mentions ignore
<kazinsal> yeah it's great, it means that if my IRC terminal blinks in my taskbar it's someone I actually want to talk to
<kazinsal> it's interesting, for some reason I've always thought of IRC as sort of a public communications system and not like, a platform for opening private messages
<kazinsal> two decades later I still feel weird opening a query window with someone because, realistically, I'm here for two or three channels
<geist> i generally speaking try to redirect folks back to a channel if they try to privately ask questions
<kazinsal> yeah, that's a good way to do it
<geist> if anything simply because the rest of the channel can usually benefit from a discussion
<geist> if it's an osdev question at least
<geist> so odd, i accidentally closed window 1 on irssi, which is usually the server one
<geist> didn't notice you could do that
<geist> time to reboot the server anyway
geist has quit [Quit: leaving]
nick8325 has joined #osdev
<Skyz> I wanted to make an OS (something new) but to do that requires more than me. I'm just looking for people who are interested in building an OS together
freakazoid333 has joined #osdev
<Skyz> I have figured out a way to make it financially viable (in theory)
geist has joined #osdev
<gog> maybe work on getting a grasp of programming first
<gog> as discussed before
<kazinsal> preferably not here
<Skyz> Yes, programming something takes a lot of effort, i realize this
<gog> and i want to emphasize that it's highly, astronomically, near-absolutely unlikely that you're going to make a marketable product
<gog> and hope that you take this advice to heart and focus on a smaller picture
<j`ey> gog: given the fact the same advice has been repeated multiple times, it's unlikely
<Skyz> I will
<geist> gog: it doesn't work. i can guarantee that in a few days it'll be back to the same thing
<geist> again and again. it's this endless cycle
<gog> yeah
<bslsk05> ​'ouznws6fiea71' by [idk] (--:--:--)
<gog> probably
<Skyz> I will
<j`ey> GeDaMo: meow
<kazinsal> there's only one thing that can end this cycle
<kazinsal> and it's the good ol' +b
<kazinsal> (cycle not guaranteed to end)
<GeDaMo> Either that or the heat death of the universe :P
<kazinsal> (ask your doctor if +b is right for your channel)
<gog> instant kitten is a marketable product for sure
<geist> yah i'd +b but klange i dont think was too happy with me last time i did it
<geist> so this time i'll get klange's take on it first
<Skyz> Just give me this chance to see what happens
<Skyz> I think you guys should try to write an os together to be frank
<gog> this is a collaborative effort of independent projects
<gog> we are making different things together
<geist> ah now they've switched to the 'lets all make an OS' thing? that's their second track
<j`ey> side B
<geist> *this* is what happens. when they've finished going down one thing, you give them advice and they ust switch to a differnet thing
<geist> and then that runs its course and then it's back to side C and D
<geist> think they may be an 8 track
<kazinsal> eventually they enter a locking groove where it's just bad ideas from hackernews
<geist> and it all just runs n a loop
<GeDaMo> Mobius strip
<kazinsal> oh that reminds me I haven't checked on n-gate in a while
<Skyz> This year I'm just gonna learn software development and maybe go through the nandtotetris course to build a working computer
<Skyz> So I won't be pestering you to build anything but It would be a lot more interesting if one of these os dev projects became an os people use
<Skyz> That's my only suggestion
<gog> why? why is it more interesting?
<Skyz> I would like to be a part of it but I know I'm not skilled in developing os's.
<geist> skyz: goddamnit sky you're missing the fucking point
<Skyz> I get it
<geist> THE FUCKING POINT IS ITS HOBBY OS
<gog> no, you clearly don't
<geist> you miss every single point, and you always say 'i get it' but you clearly dont. you're just saying that to try to get us to back down
<gog> we've been telling you over and over that we're not here to make products for consumption, these are academic exercises, personal fulfillment projects
<geist> you dont get it
<gog> learning experiences and the like
<geist> *this* is what is frustrating
<gog> and you keep gravitating back to the idea that you can get in on the ground floor of a lucrative opportunity but there's no such thing to be had here
<geist> furthermore we're not *interested* in it
<gog> ^
<kazinsal> you have a better chance of having an economic impact through starting an active revolution than you do from writing a hobby OS
<gog> arise ye workers from your slumber
<geist> right, it's probably the least directly lucrative large scale programming project i can think of
<geist> linus was very very lucky at the right time
<geist> that has not repeated
<kazinsal> yep
<j`ey> geist: you have been pretty lucky too..
<geist> and it's not like he's a billionaire anyway
<GeDaMo> Companies have poured money into starting a new OS and failed
<geist> j`ey: not really. just stuck with it for 20 years. working up and up to the next company
<kazinsal> most other OSes that get written and become products are started as an internal project to solve a specific problem
<gog> and that's just it though, your work got snapped up by a big company looking to change platforms. out of how many hundreds or thousands of little hobby projects
<kazinsal> then end up branching out into solving other problems
<geist> but yes the elephant in the room is some of us *are* doing professional osdev, but to me that's a completely different strategy
<geist> you dont get to call the shots, you slot into a larger project and do wha tyou can
<kazinsal> and really at that scale the person who calls the shots needs to have some kind of product management experience
<geist> j`ey: but yeah i guess i'm lucky in that regard
<dzwdz> what was j`ey referring to?
<j`ey> dzwdz: geist's "little kernel" became the basis for zircon
<kazinsal> leading a 100k sloc project that maybe half a dozen pepole tinker with is 100% different than a 10m sloc project that lives on tens of millions of smart thermometers or whatever
<j`ey> (kernel inside fuchschuhsia)
<dzwdz> wait, *that* fuchsia?
<geist> haha yeah. littlekernel (LK) has been fairly successful on its own
<dzwdz> oh huh, neat
<geist> in that there are a nonzero numer of users of it
<gog> lk also forms the basis of haiku's kernel
<geist> gog: no that was newos. my previous OS project
<gog> yes
<gog> damn it i swear ive done that a few times confusing the two
<gog> lol
<kazinsal> the neat thing though is that while many of us have done some real cool shit out there we're all just folks who like hackin' on stuff at the end of the day
<j`ey> lk is also used by bootloaders
<dzwdz> that's impressive
<geist> i'm one tracked, i dont tend to make fancy things, but i like to build fairly small, straightforwad, useful kernels
<dzwdz> are there any other projects originating from here that are actually used for stuff?
<geist> and that has been exacty the right combination (plus MIT license) for getting stuff used
<gog> and even with all that you're still wage labor :p
<geist> haha that's cause i'm working on fuchsia now
<dzwdz> i was about to ask if they've even paid you anything
<j`ey> yeah but think of all the royalties!
<geist> though i can tell you i actually didn't aggressively push for LK as the zircon kernel, we sort of independently came up with it, since we were already using LK for some other stuff
<geist> a lot of folks were like 'hey can we just take LK and make a µkernel out of it?'
<geist> sure
* kazinsal wonders if he should just start throwing the ARE kernel at the weird dev shop that his employer just bought and see what they come up with
<geist> but it worked well, took us about a week to get a smple hello world working
<geist> dzwdz: re: LK royalties? nope. most of the time i dont even know where it's being used
<geist> but it shows up time to time in various products
<geist> little birdy tells me it's in at least one of the major game consoles
<j`ey> some co-processor thing?
<geist> yah
<geist> it's perfectly suited for that
<geist> something more complex than freertos class, but less complicated than a full linux distro
<geist> it slots in that size fairly well
<gog> so skyz as you see geist actually has contributed to major products that have come to market in some form or another and still only makes regular job money.
Arthuria has quit [Read error: Connection reset by peer]
Arthuria has joined #osdev
<gog> so your vision has--charitably--unrealistic expectations of success
Arthuria has quit [Read error: Connection reset by peer]
Arthuria has joined #osdev
<geist> well, at the end of the day it's just another programming thing
<gog> coders of the world unite
<geist> i just love doing it. there's this spark about taking an empty computer and making something work on it
<geist> i think that got planted when i was a kid and had an apple 2 and you loaded it up and there was nothing running on it
<GeDaMo> Lies! There was BASIC! :P
<geist> but once you started digging into the DOS that came with it you saw how it got loaded, etc
<geist> GeDaMo: actually i had an apple II. it started by dropping you into the monitor rom
<geist> you had to actually manually start basic
<kazinsal> PR#7
<geist> they fixed that with the II plus (and a language card)
<geist> it had integer basic though (the apple II)
<GeDaMo> Ah, the one I used belonged to a teacher at school, it was a IIe Europlus
<geist> or you booted the disk with C600G
<kazinsal> ah the old days, when you sorta needed to know machine internals to play zork
<geist> but yeah, basic was basically what you were sitting in, but it's actually a kinda complicated relationship between basic, the command prompt for DOS, etc. but that's kinda the point: growing up with a machine where you could drop into assembly at any point, or lots of basic programs used POKE/PEEK to directly fiddle with hardware, etc
<dzwdz> geist: oh wow, i've looked at your github and you've even made your own cpu in verilog! that's cool as fuck
<kazinsal> verilog hackin' is neat and I need to sit down and learn it one day
<geist> that sort of stuff exposes you directly to the architecture of the machine and keeps the veneer thin between the environment you're in and the underlying hardware
<GeDaMo> Hmmm ... looks like my memory has failed me again, looks like the IIe didn't come out until 83 and I left school in 82 :P
<geist> dzwdz: yah you should check doug16k's. his is super sophisticated
<geist> GeDaMo: probably was a II plus
<j`ey> GeDaMo: ur old!
<kazinsal> ouch
<GeDaMo> Yeah, me old
<geist> j`ey: damn.
<kazinsal> yellow card
<GeDaMo> It was definitely a Europlus
<j`ey> im sure GeDaMo knows im joking :P
<geist> they made the IIplus for quite a while, since apple was off making an apple III and failing at it in the interim between 77 and 83
<geist> and the lisa
<GeDaMo> I'm usually joking too :P
<kazinsal> some time after I joined the community we more or less stopped getting young people showing up and sticking around so I've inadvertantly ended up being one of the younger folks around here :|
<gog> i'm not young or old
<kazinsal> gog is eternal
<geist> i still think we get some. hard to say if we're running out of new people here, etc
<geist> but OTOH i try not to think too much about how old someone is here
<gog> lol, one of my new jokes is that i'm the avatar of an ancient goddess projecting herself into this plane of existence
<gog> my wife looked at me funny when i told her that one
<kazinsal> the spirit of osdev future and past, who can be easily distracted by a ball of yarn
<geist> hmm, think i'll go ahead and upgrade this box to 20.04
<geist> can take a snapshot in case it's a disaster
<geist> see yas on the flip side
geist has quit [Quit: leaving]
<j`ey> geist: you might be, for all I know
<gog> hardly, though, i can't really focus on a project long enough to get anything done :p
<j`ey> err gog ^
<Skyz> My thinking has changed since I became a programmer
<gog> basically i need to be paid to focus on something or i lapse into pleasure-seeking
<gog> chasing yarn, so to speak
<kazinsal> same, though recently I'm finding it hard not to accidentally spend an hour on the 'net when I should be doing other stuff
<kazinsal> once my office re-opens I might start going back in just so I can't shitpost all day
<gog> that might be quarantinitis
<geist2> kazinsal: agreed
<geist2> the way i combat that is i have a work setup at home that is physically separate
<Skyz> I've had a hard time focusing on projects but it could be just the newness of programming
<kazinsal> ah, nice. I don't have enough room for that, or enough (modern) computers
<j`ey> kazinsal: im definitely looking forward to go back in sometimes
<j`ey> and same as geist2, managed to turn the spare room into a 2nd office
<kazinsal> the powers that be are saying they want everyone to have a work provided laptop by the end of the year but ehhhh
<gog> my wife will have to start going back to the office regularly next week and i'm like ok :')
<geist2> yah work more or less forced it by locking down the security so hard you *must* be using a corp machine to access anything
<geist2> like, even web mail
<j`ey> how does that work?
<gog> which means i'll need to find some way to keep my days slightly disciplined
<geist2> probably via TPM. i guess
<j`ey> nice
<kazinsal> the way I've been doing it is having a VM on my desktop that I use to VPN into the office and RDP to my desktop there
<j`ey> gog: i know the struggles in that
<kazinsal> so corporate assets never actually hit my network
<geist2> yah we can do that but the computer accessing the network must also be corp
<gog> i do have a new pet care client for a whole two weeks
<geist2> i also separate it by putting all the corp stuff on a separate VLAN
<gog> that should help
<kazinsal> we're also planning on finding a new office in the vancouver area Soon (tm)
<j`ey> i have a work laptop, then I VPN +ssh into my desktop
<kazinsal> as our lease at this one is up at the end of september iirc
<geist2> but anyway since i have to have a physically separate corp machine to even acess anything at work, i also take that as an opportunity to not log into any of my personal stuff on it
<j`ey> kazinsal: we just got a new office built, and it was in use for a few months before the pandemic lol
<geist2> and then that seals things off fairly well
<kazinsal> haha yeah our HQ was the same way
<Skyz> I may find something to do part time
<kazinsal> built the damn thing and then whoops covid
<gog> tourism is booming here again too so maybe i can get a barista job that i don't have to care about
<kazinsal> now they're saying "you can go back into the office! but maximum four people in the 100-person boardroom"
<gog> and MAYBE, if everything aligns, i'll be going back to school in the fall
<geist2> yah i admit i'm looking forward to getting back to the office a little bit
<j`ey> gog: ooooh
<geist2> my concern is since i moved i made a somewhat longer commute for myself
<kazinsal> "we built a giant staircase that's also a meeting area! but no hanging around on it because you'll infect people"
<geist2> but i'm going to have to figure that out
<gog> j`ey: it's a big if
<kazinsal> yeah, I'm slightly farther from the local major bus exchange now than I was. only by a mile or so though
<j`ey> gog: ALIGN_UP(stars)
<gog> money is gonna continue to be tight even if i find work because medical things
<kazinsal> it's an hour into the office by transit or 45 minutes by driving :|
<geist2> j`ey: heh tat totally remidns me, i have a todo item to spiffy up my ALIGN() macros
<geist2> among other things its non obvious if it aligns up or down
<j`ey> geist2: glad i could.. help? :P
<Skyz> Right now I'm just gonna take the metro to the New York Public Library and study
<geist2> skyz: sounds like a good idea
<kazinsal> I need to somehow get my hands on a university ID so I can use research libraries
<kazinsal> take one part time course a year just to get access to the stacks
<gog> i still have my old uni id lol
<gog> i was using it to get free bus rides before i moved
Skyz has quit [Quit: Client closed]
<gog> ok time to go
gog has quit [Quit: bye]
<GeDaMo> I'll just mention sci-hub and libgen for scientific papers
Skyz has joined #osdev
geist has joined #osdev
Arthuria has quit [Ping timeout: 268 seconds]
<geist> well, that was pretty straightforward
<Skyz> Going to someone's bbq
<GeDaMo> At the library? :|
<kazinsal> christ on a bike
<Skyz> Not sure if I'll get a chance to go today to the bbq because it's kind of late for the bbq
<Skyz> it's in connecticut.
<kazinsal> my brain needs a cigarette because it keeps getting absolutely fucked by these derails
mahmutov has joined #osdev
<Skyz> Cya
Skyz has quit [Quit: Client closed]
mahmutov_ has quit [Ping timeout: 252 seconds]
wootehfoot has quit [Ping timeout: 272 seconds]
GeDaMo has quit [Quit: Leaving.]
wootehfoot has joined #osdev
Arthuria has joined #osdev
mahmutov has quit [Ping timeout: 258 seconds]
mahmutov has joined #osdev
mahmutov has quit [Ping timeout: 252 seconds]
wootehfoot has quit [Quit: Leaving]
mahmutov has joined #osdev
<immibis> i am currently linking with their binary blob for DRAM initialization, and my implementation of printf flashes the address of the format string on the LED, one bit at a time
<immibis> to figure out why it's failing
<immibis> this may or may not be a suitable way to get DRAM initialization
heat has joined #osdev
<immibis> (at least i have disassembled the blob)
<geist> immibis: haha yeah i've had to do that before absolutely
<geist> this is also one of those cases where i guess intimately knowing morse code would be helpful
<mjg> :)
<mjg> i was trying to learn for lulz at some point, got a warning that it goes pretty fast at the start and then you run into a total clusterfuck
<mjg> also examples like watch out for "we got here" and "we go there"
Arthuria has quit [Read error: Connection reset by peer]
<mjg> morse would totally use a whitespace character
Arthuria has joined #osdev
<mjg> as in you have to get the timing right as well
<immibis> well binary addresses are faster than morse
<mjg> and it's probably not very portable, if you catch my drift
<immibis> there is some kind of sanity check that you do in fact have DRAM, and it uses a function from another module, which has other dependencies, and I don't want to deal with that because there is DRAM on this device
<immibis> I was trying to fake the result when it calls into this other module function, but instead, I think I will just return a success too far up the stack :P
<immibis> that would be easier if i could reassemble the dram init code, i could just delete the check
<heat> link with every module you need and slowly replace them if you want
<heat> sounds easier at least
<immibis> well that's going to be, like, their entire shitty implementation of u-boot
<immibis> at least I heard it's shitty. didn't check
<heat> woohooo
<heat> isn't this more like firmware code?
<immibis> you would think so, but the boot ROM is a bare minimum, possibly in case they screwed up this part of the code and had to change it later
<immibis> it would be nice if there was a chunk of nice and self-contained code saying "here, just run this to do the stuff you thought should've already happened"
<immibis> i suppose maybe people want to auto-detect the chip type and stuff like that
<immibis> and that requires some significant amount of code
<immibis> https://github.com/allwinner-zh/bootloader/blob/master/u-boot-2011.09/arch/arm/cpu/armv7/sun8iw7/efuse.c#L80 actually this is the function that second module needs from elsewhere, and it doesn't look terrible, but it's undocumented and labeled as "security" and who knows what it's actually communicating with and whether *that* thing has to be set up first
<bslsk05> ​github.com: bootloader/efuse.c at master · allwinner-zh/bootloader · GitHub
<immibis> and it's labeled as just being for a sanity check anyway, so i figured it's easier to skip the check
pphs has joined #osdev
<immibis> https://linux-sunxi.org/SID_Register_Guide ah it's just e-fuses, some kind of chip ID. not terrible. I *could* do that
<bslsk05> ​linux-sunxi.org: SID Register Guide - linux-sunxi.org
<heat> woah
<heat> my kind of documentation
<bslsk05> ​github.com: bootloader/efuse.c at master · allwinner-zh/bootloader · GitHub
<immibis> this stuff on github isn't even for the correct chip but i should have the code for this chip somewhere in this big code dump they gave pine64
<geist> mjg: yah my dad has been doing morse code for 50 years and can copy it pretty fast, 35-40WPM
<geist> it's interesting watching him just listen to it in the background like it's a conversation
<geist> you can be talking to him and there can be morse going in the background and he just follows along
<geist> note thats a different brain pathway than reading it from a light. at a particular speed i think the auditory stuff blurs together and your brain parses it a word at a time
<geist> much like how speech or reading works. you dont listen to every single sound, you listen for patterns
<geist> i bet you'd have to retrain almost completely if you wanted to read morse from a blinking light
<immibis> the question is whether you can train yourself to hear a 300-baud modem the same way
<geist> i'm guessing probably not, but older baudot maybe at i dunno 50 baud?
<mjg> ye interesting how the brain can multitask to some extent
<geist> yah i think you can process lots of stuff in parallel where ther's a dedicated path (speech, vision, etc) but i'm fairly convinced that your attention absolutely cannot be divided
<geist> even if you think you're multitasking, you're really doing a pretty bad job of it
<geist> ie, trying to program and watch TV at the same time. you think you're a boss at it, but really i dont thnk you're doing a good job at either
<mjg> hm
<mjg> well it is true that if you need to not focus on something, tings like tv or music have to be off
<geist> i mean you can obviously switch attention, but i think the context switch overhead in your brain is a lot higher than you think
<mjg> but for run of the mill coding i don't think it makes a difference
<geist> possibly. but really you're not truly paying attention to either at exactly the same point
<heat> ever since our brain got the spectre mitigations
<mjg> if i know precisely what i want to do and it's the matter of coding it up, it's just a matter of typing
<geist> you're just microswitching
<geist> right, yeah that can be true. i do that all the time when chatting, for example
<kazinsal> lo fi beats etc is the best possible programming background noise imo
<geist> you sort of figure out the sentence you're about to type, and then halfway through it you wander to some new topic
<geist> kazinsal: haha yeah, i use that channel a lot
<kazinsal> most music etc is way too engaging. especially for me, as a musician
<kazinsal> like hell yeah I'll rock out to a queensryche album but I'm 100% going to get distracted from whatever I'm supposed to be doing and grab a guitar off the wall
<geist> exactly. also why i can't listen to speech while trying to focus on something. no NPR/CBC/podcasts/etc
<geist> yah and drool over geoff tate at his peak
<geist> that happens every time Jet City Woman comes on, you just wanna sing
<kazinsal> PNW conversation mode activated
<mjg> ye i tried podcadsts while coding
<kazinsal> yeah I can't not attempt to belt out pretty much anything from Operation Mindcrime or Empire whenever it comes on
<mjg> unless i'm doing something really mindless i realize i did not cach anything from the podcast
<geist> haha i dont dare do it around anyone else. you think you're nailing it, but i'm sure it sounds terrible
<heat> i can't listen to podcasts unless i'm on the train or something
<heat> I usually catch 0% of the podcast otherwise
<kazinsal> yeah haha I know for sure my singing is acceptable if there's instrumentation going on around me but my solo vocals are consistently ever so slightly flat
<geist> books on tape are fantastic for driving, at least whne not in something complicated like driving through the city
<mjg> i do light workouts, meh books and podcasts work fine
<kazinsal> I need to maybe find a vocal coach or something, see if they have any tricks for going up about 20 cents
<geist> kazinsal: i can generally folllow along with GT, but only if i'm switching into an out of falsetto
<geist> i get the impression he's just belting it out
<geist> also see Chris Cornell
<kazinsal> oh god yeah I don't know how he managed to consistently go from that operatic chest voice into screaming
<kazinsal> similar issue I have with singing along to early Dream Theater, pre-food poisoning James LaBrie had absolutely mindblowing pipes
<geist> also two albums that for some reason work amazingly for getting into The Zone: Kid A and the Social Network Soundtrack
<geist> they work so well i only use them on occasion, so as not to spoil the magic
<kazinsal> (welcome to the operating system development and classic progressive metal IRC channel)
<geist> kazinsal: heh food poisoning as in getting fat?
<kazinsal> nah, he had some tainted shrimp in the bahamas or something in 1994
<kazinsal> literally vomited his vocal chords out of shape
<mjg> :/
<kazinsal> and then promptly went on a world tour
<kazinsal> never really fully recovered from it unfortunately
<geist> ah yeah. OTOH, Metropolis Pt 2 is still *fantastic*
<kazinsal> oh yeah, phenomenal album
<geist> still my fave of theirs
<kazinsal> I have one of the lower end models of the john petrucci signature guitar
<geist> somewhere i had the music book for that though i havent' seen it in years. dunno what happened
<geist> hah same. one of the music mans. i think the first or second gen? 2006?
<geist> it's a fantastic guitar
<kazinsal> nice!
<kazinsal> every once in a while I walk into a guitar store and fiddle around with a mesa/boogie mark v amplifier and have a really hard time not dropping three thousand bucks right then and there
<geist> yah it's a fairly distinct sound. every once in a while you hear JP guest solo on some other ban'ds album and you instantly spot it
<geist> he's definitely sat in on some Periphery stuff and i think one of the Tosin Abasi albums?
<kazinsal> totally. Alex Lifeson's another guitarist with a super distinct sound. he did a solo on a Porcupine Tree album and the first time I heard it I went "holy shit, that's Al"
<geist> yah i have one of theo Hughes and Kettner heads that he uses, i get how you can get that sound
<kazinsal> awesome! he's doing some new stuff with some folks from another smaller canadian prog rock band from the 80s that I can't remember the name of now
<kazinsal> almost has a bit of an industrial feel to it
<kazinsal> I want to say Winter Rose but it's the other canadian prog band that James LaBrie was in for all of 20 minutes in the 80s
Arthuria has quit [Read error: Connection reset by peer]
<geist> reinds me, i think i need to re-tube it
Arthuria has joined #osdev
<geist> actually haven't fired up the amp since i moved 9 months ago
<geist> but one of the channels was starting to give me trouble with a hum
Arthuria has quit [Read error: Connection reset by peer]
<kazinsal> oh yeah, probably a preamp tube on its way out
Arthuria has joined #osdev
<kazinsal> I really enjoy my boss katana, it's a seriously powerful amp for a 100W solid state modelling thing
<kazinsal> but part of me really wants those luscious boogie tones
<geist> yah i have to say since i moved i'v just been using the old line 6 floorboard i've had since forever
<kazinsal> even though I know I'll never really use it to its full potential
<geist> hadn't gotten around to even hooking up the big amps
<NieDzejkob_> so I took a look at how minix implements ps and it looks like it parses kernel memory from userspace. WTF. I guess I won't be stealing their design
<NieDzejkob_> does Zircon, for example, allow listing the running processes? I don't see any syscalls that would let you do that in the docs
<mjg> you mean it opens an equivalent of /dev/kmem?
<mjg> that's how hisorically unix systems would "export" all kinds of stuff
<NieDzejkob_> yeah, minix does.
<NieDzejkob_> I don't want to use a hack like that, though
<mjg> :)
<NieDzejkob_> I was hoping to get some inspiration as to how other microkernels solve this
<kazinsal> might be worth implementing a system call that's basically just "please transfer X set of data into this buffer"
<kazinsal> would also make it easy to roll it into something akin to io_uring
<NieDzejkob_> in general, there's many things I'd take for granted for a monolithic design, but the same solutions seem like hacks for a microkernel
<heat> /dev/kmem is the most cursed thing ever
<heat> imagine having to look for a symbol in kernel memory just to get the load average
<mjg> man old unix systems did not even have a way to shut them down
<mjg> for real
<mjg> this is partially where the actual most cursed thing came about: sync; sync; sync
<heat> ?
<heat> like they run the sync command 3 times?
<kazinsal> yeah I guess you kind of have to figure out how micro you want your kernel to be
<mjg> wait, you have not heard of sync; sync; sync?
<heat> no
<kazinsal> like, basic I/O syscalls and process calls and that's it, or do you want to provide some other useful low level kernel<->user features
<mjg> wow, lemme find it
<bslsk05> ​utcc.utoronto.ca: Chris's Wiki :: blog/unix/TheLegendOfSync
<bslsk05> ​bsdimp.blogspot.com: Warner's Random Hacking Blog: When Unix learned to reboot(2).
<kazinsal> ha
<mjg> :[
<kazinsal> yours is better, goes into more kernel detail
<mjg> my answers the following: Why not do this in reboot(2)?
<mjg> mine
<kazinsal> mine just answers "wtf"
<mjg> ye, that much is common knowledge :-P
<kazinsal> really nice day outside so I think I'm going to pack a bowl or a few and go for a nice walk. back in a while
<mjg> there is a story how swap areas on disk were hardcoded in the kernel
<mjg> then they moved the kenrel off to a new disk, repartitioned
<mjg> started getting random data corruptions
<mjg> ... traced to "swap" landing on the now bigger data partition
gorgonical has quit [Quit: ZNC 1.6.5+deb1+deb9u2 - http://znc.in]
<mjg> swap as hardcoded in the kernel that is
<geist> NieDzejkob_: ah, yes it does
<geist> it's actually kinda complicated, because this is where the capability/handle basde thing works against you
<geist> hang on, lemme finish up a couple things then i'll give you a dump
<heat> mjg: just finished. long story short, nobody in the 80s and 90s knew how to design a decent sytem
<heat> system*
<geist> but, in the interim, you can possibly figure this out from looking at the syscalls
<geist> zx_object_get_child(), zx_object_get_info()
<geist> and a right called ZX_RIGHT_ENUMERATE
<mjg> heat: well, that's unix :)
<mjg> i like it, but i'm not going to claim it's good
<heat> the reboot syscall in linux still doesn't sync
<mjg> same with C
<mjg> that would be pretty weird
<mjg> well it does not have to 'sync' per se, but i'm pretty sure the kernel pushes out all the i/o
<mjg> you can't really maintain data cnsistency otherwise
<bslsk05> ​man7.org: reboot(2) - Linux manual page
<heat> "If not preceded by a sync(2), data will be lost."
<dh`> I wonder if Warner ever posted my last comment on that
<sham1> sync ; sync ; sync ; sync
<sham1> The old mantra of the UNIX sysadmin
<immibis> I encountered this XKCD recently. https://www.explainxkcd.com/wiki/index.php/2044:_Sandboxing_Cycle
<bslsk05> ​www.explainxkcd.com: 2044: Sandboxing Cycle - explain xkcd
<dh`> nope, he didn't.
<bslsk05> ​elixir.bootlin.com: reboot.c - kernel/reboot.c - Linux source code (v5.13.1) - Bootlin
<immibis> we want to have well-defined process boundaries. Then we want admin tools that break all the boundaries. Then we want the admin tools to be written as normal processes.
<dh`> short summary was: I looked at the v7 source and it is in fact broken
<mjg> looks like there are some variants which indeed can do this, but that's not the reboot you normally call
<immibis> libreoffice shouldn't be able to list all processes and grab a handle to a random process, because that breaks encapsulation. But ps should, because that's its purpose! Oh, and libreoffice should be able to spawn subprocesses, except for ps.
<immibis> but the user should be able to write a script in libreoffice scripting language that invokes ps if they want to
<immibis> but libreoffice scripting language should have the same permissions as libreoffice because otherwise that's a way to escalate privilege
<heat> immibis: solution: child inherits capabilities and handles
<immibis> heat: great, now you can't make your admin dashboard in libreoffice, with a button that opens a command prompt. Well, you can, but ps won't work in that command prompt.
<heat> oh no!
<heat> anyway
<sham1> Another one: Why does $BROWSER have ability to read all the files in my home directory, including my ssh keys? Let's block the access to everything but the Downloads-directory
<sham1> What's what? I need to access a file somewhere other than Downloads? Oh boy
<immibis> everything that libreoffice could conceivably invoke has to deal with the possibility that it might not be able to list processes... or write files outside of the user's documents directory... or access the network. Then someone wants to write a plugin that fetches network content. What do?
Arthuria has quit [Read error: Connection reset by peer]
Arthuria has joined #osdev
<immibis> sham1: how else would the browser let you upload files? By getting a capability from the file dialog, perhaps... now you are limited because you can't write a custom file dialog
<immibis> say, one that selects directories
<immibis> unless the OS's built-in file dialog supports selecting directories
heat has quit [Remote host closed the connection]
<immibis> which it probably does
<immibis> i direct everyone again to https://xkcd.com/2044/
<bslsk05> ​xkcd - Sandboxing Cycle
<immibis> because that is a rather profound statement on how computing technology advances
<immibis> and how operating systems are not possible to do right
<sham1> Less that and more that user requirements require that things be secure and convenient, even though a lot of the time it's more like a sliding scale between the two
<immibis> a sliding scale means you suck at both
<immibis> any practical OS must necessarily be insecure or inconvenient or both
<immibis> (even theoretical OSes, too)
freakazoid333 has quit [Read error: Connection reset by peer]
<immibis> if you compromise, then your browser has to prompt you for permission to do certain things, but viruses can escape from it anyway
<immibis> you just get less permission prompts and less viruses
Arthuria has quit [Ping timeout: 252 seconds]
sortie has quit [Quit: Leaving]
gog has joined #osdev
<geist> NieDzejkob_: did you get that?
NieDzejkob_ has quit [Ping timeout: 252 seconds]
NieDzejkob_ has joined #osdev
<NieDzejkob_> geist: I looked through the various get_info requests and I don't see where you get the koids for get_child from
<geist> ZX_INFO_JOB_CHILDREN/ZX_INFO_JOB_PROCESSES
<geist> the first one gives you a list of koids for the child jobs from a job, and the second gives you a list of koids for all the processes
<geist> basically ps/top/etc iterates the job tree down
<geist> the key is a given process doesn't intrinsically have this right to do this
<geist> it has to be bequeathed a job handle to the root job (or something underneath it) with the ENUMERATE right, and probably very little rights else
<geist> so basically the entire OS job tree is not necessarily exposed to user space, just whatever its allowed
<NieDzejkob_> does it usually get passed through the process care package?
<geist> nein
<geist> or at least it *could* but generally the idea is you'd ask for it from some service
<NieDzejkob_> ah makes sense
<geist> it might get passed a handle to its own job, in which case it may have the rights on that job to create more processes/jobs/enumerate down
<geist> but that's also a runtime implementation detail
<geist> basically the design is 'runtime does what it wants' so you canc reate a very priviledged runtime, say some sort of posixy looking shell thing, where every process is handled an enumeratable root job so it can do its own ps/top, or none at all
<NieDzejkob_> i also noticed a thing where the job info has a debugger present field
<NieDzejkob_> so, you have job-wide debugger things?
<geist> yah the debugger api is somewhat priviledged. basically it gets a way to mint a handle to a process and it has the DEBUG right, which tives it more priviledge
<geist> yes
<geist> the crashlogger, for example, attaches to dead processes and digs out some info
<NieDzejkob_> mint a handle to a process? as in, given low-privilege handle, get a full one?
<geist> i honestly forget
<geist> have to dig through the docs to figure that one out
<geist> i have historically had very little to do with the debugger api
riposte has quit [Ping timeout: 255 seconds]
<NieDzejkob_> also, why a separate debugger api? wouldn't the existing thread_state_read and stuff be enough?
<geist> that's generally what it is
<geist> it's not a separate api as much as just a few places where the debugger can via one mechanism or other get a fully priviledged handle
<geist> and then it's regular api
<geist> actually may not involve a specialed kernel api at all. may be entirely in user space
<geist> as in the whole rights elevation is a user space concept because some service has sufficient rights to mint handles, and it can bequeath it to a debugger process
<geist> but yeah debuggers are a PITA
<geist> they basically break hatever model you have
mahmutov has quit [Ping timeout: 268 seconds]
NieDzejkob_ has quit [Quit: Ping timeout (120 seconds)]
jstoker has quit [Read error: Connection reset by peer]
jstoker has joined #osdev