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
<heat> good question
<heat> does linux even handle these cases?
trufas has quit [Ping timeout: 252 seconds]
<klange> ay, still up and still responding to pings 64 bytes from 192.168.11.39: icmp_seq=1 ttl=64 time=0.506 ms
trufas has joined #osdev
<kazinsal> I feel like the "oh no sda changed" problem is one that can be solved by simply not overloading the shit out of device names
<kazinsal> like that's specifically a problem of "sd" which originally meant "scsi disk" being now applied to "everything that isn't PATA or NVMe-native"
<heat> what if you have two network interfaces(eth0 and eth1) and a bunch of network configuration on eth0
<heat> imagine they switch?
<heat> oops?
<kazinsal> establishing a static mapping of hardware MAC address to interface resolves that
<kazinsal> or going with the consistent device naming scheme that some distros use
<heat> you can also get IDs for disks and partitions
<heat> such that usually fstab only uses UUIDs
<heat> doesn't make it less dumb
<kazinsal> the issue of "user left a thumb drive in and now sda is a usb disk and init is having a freakout" is a separate one from "the user fucked around with the insides of the machine and now things don't work right"
<kazinsal> the former is preventable by separating different device types
<kazinsal> the latter is *mitigated* by enumerating devices in a logical consistent way where possible, but preventing a user from mucking around inside their system and fragging their interface configs is a complex can of worms that some would argue is not actually a kernel problem
<kazinsal> to paraphrase torvalds, kernel changes should not break user space
<kazinsal> but user changes breaking user space is just a user problem
<kazinsal> if you called Cisco TAC because you moved some modules in a router around and your configs don't work anymore they're going to tell you to put the modules back where they were
<kazinsal> it's not IOS's fault that the user started unscrewing things
<kazinsal> as soon as you start yanking bits out of a machine, no matter what kind of machine it is, your known hardware configuration is invalid
<heat> and maybe the best solution is to not have such simple device names
<kazinsal> disk names definitely should be smarter
<heat> qualify them based on the bus and bus address + IDs
<heat> like windows does afaik
<kazinsal> instead of hd* and sd* it should be something like ata*/sata*/nvme*/usbdisk*
<heat> there's nvme
<kazinsal> and ethernet should enumerate starting with onboard devices and then going down the PCIe tree
<heat> yes but that's not how device enumeration works
<kazinsal> linux's device enumeration is byzantine
<kazinsal> and not in a historically fascinating demolished wonders of the world way
<heat> buses enumarate devices based on the internal bus structure and put them on a list/tree, then when drivers are initialised the bus driver dooes probe() on every compatible dev
<heat> which is sane
<kazinsal> imo USB ethernets are one of those things that should be handled as a separate and expected to be temporary component
<kazinsal> since they're designed to be removed and added on the fly, configuring them *last* makes the most sense to me
<kazinsal> and flagging them as such
<kazinsal> eg. usbeth*
<kazinsal> or because unix nerds like short incomprehensible names for everything, enu*
<heat> lol
<moon-child> I wonder what creatd that tendency
<heat> that's BSD
<heat> the intel ethernet driver is called em
<klange> In the original Unix days, it was just lack of space.
<kazinsal> the udev/consistent device naming format is all afuck
<moon-child> apparently an early c compiler limited identifiers to 5 chars or so
<moon-child> it wouldn't error if you had a longer identifier, it would just ignore the end
<kazinsal> enoX for onboards, ensX for hotplug slots, enpXsY for PCI addressed slots, ethX for anything more bizarre
<hgoel[m]> there's also the very descriptively named re driver in freeBSD
<kazinsal> so if you've got a machine with an onboard ge, a dual port ge in a PCI slot, and a 10 mbit ISA card in a PCI to ISA bridge, you've now got eno0, enp?s0, enp?s1, and eth0
<kazinsal> where ? isn't guaranteed to be 0
<heat> so that's how it works?
<heat> TIL
<klange> I took the PCI slot address approach.
<klange> I like that because stuff doesn't just randomly get pulled out or reassigned on PCI slots.
<kazinsal> yep, if someone's mucking around inside the machine, your hardware configuration is invalid and any interface config is going to need to be redone
<kazinsal> you simply cannot assume that it'll just work
<kazinsal> my approach is to do prefixX/Y, where X is the card number and Y is the port on the card
<kazinsal> 0 is the card number for the motherboard
<kazinsal> prefix changes depending on what speed the card/port is, but changing the prefix doesn't change the card numbering
<kazinsal> so eg. you can have ge0/0, ge0/1, ge0/2, ge0/3, ge1/0, te2/0, te2/1
<kazinsal> and if the user fucks around inside the machine and those change, then that's because the user fucked around inside the machine.
<hgoel[m]> I haven't decided on how I'll handle usb, but for pci I think I'll stick with scan order, matching known devices via hashing has various issues for usb
<hgoel[m]> like if a usb ethernet controller was assigned and saved as eth0, removed and another added, which would either be assigned eth0 due to it being available (thus causing an issue if the previous one was plugged in at the same time)
<hgoel[m]> I guess the labels could be exclusively owned by each device unless explicitly removed by the user, so the new one is given eth1 etc
ElectronApps has joined #osdev
andydude has joined #osdev
andydude has quit [Client Quit]
sts-q has quit [Ping timeout: 258 seconds]
<kingoffrance> eh, none of these things are issues for me as a user. ethernet has mac addresses, at least on freebsd IIRC you can make any alias you want ep0 -> lan0 if you like. disks can use partition or filesystem labels. and on an old linux i see /dev/disk/ . im not sure what the issue is -- use indirect/meta names, no different than a symlink, which point to the "real" device name, and use that in configuration files/etc.
<kingoffrance> if hardcoding stuff is a problem, "dont do that"
<kingoffrance> hardcode an alias that the destination it points to can be changed
<kingoffrance> wifi interface -> wifi0 use logical names, it is bad if an os doesn't provide that
<kingoffrance> /dev/disk {by-id,by-label,by-partuuid,by-path,by-uuid) stuff just points to sda et. al. so you use the logical names in fstab and not hardcoded driver name
<kingoffrance> there's perhaps more technicalities as to what stage of booting needs to be able to grok such and such, but as a user, these are solved IME
<kingoffrance> other types of devices....may be another story....
X-Scale has joined #osdev
isaacwoods has quit [Quit: WeeChat 3.2]
<kingoffrance> (for NICs, logical names means you dont have to update firewall configs or what daemons listen on, etc. if you change a device)
<kingoffrance> only need to make sure the new device gets the proper alias
<kingoffrance> also if you are doing interface bonding or something fancy, aliases give you a stable name despite what the underlying components might be (im not sure if that is proper term, different os might call it different things)
<geist> tradtinoally linux assigned most things in the order it discovered (eth0, hd0, etc) but more recent distros seem to be renaming things in /dev (or whatever the interface stuff is) and/or setting up symlinks
<geist> i remember for whatever reason that Solaris used to auto populate a fs called /device with long bus path names, and then create symlinks to them in /dev
<geist> the interface renaming thing (enp6s0, etc) may be a systemd feature?
<geist> iirc in dmesg you still see the kernel detect them as eth0 or whatnot, but then immediately they get renamed
<bslsk05> ​www.freedesktop.org: PredictableNetworkInterfaceNames
lava has quit [Quit: irc4sweb v0.3]
<geist> yah that's what i figured
<geist> honestly dunno how you rename a nic on linux, since they traditionally dont end up with a /dev node? but then probably deep down they do
<klange> iirc, one of the SIOC ioctls can assign a new interface name
<heat> in linux nothing ends up with a /dev node unless either userspace mknod's it or you use their devfs thingy that more or less mounts a sane /dev made by the kernel
<kingoffrance> yes, everything i say may or may not apply to modern systemd etc. i dont follow these things
<geist> heat: sure, but tradtionally you didn't hae a /dev node for nics anyway, vs most other things
<geist> ie, there was traditionally not a way to open a nic and just start reading from it like a file
<heat> woah that's true
<heat> TIL
<heat> i had no idea
<heat> never noticed network interfaces have no dev file
<geist> so my point is that renaming it must be some other mechanism than just creating a different named file, since the name (vs most of the other things) seems to be more 'baked into' the kernel side of things
<geist> though even in the old days it may have always been an ordinal somewhere for say ifconfig or other legacy utilities
<geist> i guess the idea was there was no real point exposing a nic file since the business end of the nic driver terminates inside the kernel on the net stack
<geist> and obviously you can get raw pipes to it, but it's via a different mechanism
<heat> woah, ext4 extents are sooo cool
<geist> klange: that SIOC ioctil you're talking about, what /dev or /sys file do you operate against?
<geist> there's a million ways to skin it, just curious how it works if you looked at it recently
<heat> my /var/log/pacman.log (package manager log file written since 2018) only has 169 extents, it's not even enough for a 2 tree levels!
<heat> geist: it's on the socket
<geist> heat: yeah filefrag is a super neat app
<klange> geist: socket
<geist> i use it all the time to look at fragmentation, etc
<heat> I was using e4defrag -c -v
<geist> yah check out filefrag. works on any fs that reports file layout info
pieguy128 has quit [Quit: ZNC 1.8.2 - https://znc.in]
<geist> also interesting to watch things like btfs since you can more or less live watch COW work
pieguy128 has joined #osdev
<klange> i'm shoving my interfaces in /dev/net for discoverability, `ifconfig` just readdirs over it to display everything
<geist> yah that's what i did for newos back in the day
<kingoffrance> there's stuff like /etc/networks and netgroups too, which i dont think many people use, doubly so nowadays, not arguing for or against either way, just more layers of aliases at other levels
<geist> iirc that's how you opened a new socket too, etc
<geist> something like /dev/net/socket and stuff like /dev/net/<network interface>
<heat> i'm working on a netlink-like interface
<heat> having to look at /dev is meh
<heat> could work but then you're also limited, you'd need to add a bunch of device files for routing tables, etc
<klange> toaru32 had /dev/net/{host}:{port} open TCP sockets, but I don't think I'll bring that back with the new stack
<klange> and it mostly did that because all the DNS stuff was in the kernel module and there was no exposed method for doing UDP
<heat> you could do it for IPs
<klange> If I brought it back, I think I would try to implement Bash's magic network paths.
<klange> Which I think is /dev/tcp/{host}/{port}
<heat> yup, just tried
<heat> super cool
<klange> toaru32's /dev/net was basically that but in the kernel, so it worked anywhere
<Mutabah> Heh, that's kinda how acess2's network interace worked too
heat_ has joined #osdev
heat has quit [Ping timeout: 252 seconds]
Oli_ has joined #osdev
heat_ is now known as heat
Oli_ is now known as Oli
srjek_ has quit [Ping timeout: 264 seconds]
<Oli> test
<Oli> Passed!
<Oli> My bad.
heat has quit [Ping timeout: 265 seconds]
froggey has quit [Ping timeout: 240 seconds]
froggey has joined #osdev
sortie has joined #osdev
Burgundy has joined #osdev
gareppa has joined #osdev
gareppa has quit [Remote host closed the connection]
dennis95 has joined #osdev
ElectronApps has quit [Read error: Connection reset by peer]
GeDaMo has joined #osdev
Sos has joined #osdev
zoey has quit [Ping timeout: 268 seconds]
Tackwin has joined #osdev
ElectronApps has joined #osdev
gmacd has joined #osdev
dormito has quit [Ping timeout: 258 seconds]
gmacd has quit [Remote host closed the connection]
<sortie> ... whoops
<sortie> My usleep(2) is off by (checks notes) 1000x
<froggey> msleep or nsleep?
<sortie> Miliseconds :)
<sortie> So... it ran for a while
<sortie> This happened in a pthread read/write lock test so I thought my implementation was wrong... nope it was the timer
Tackwin has quit [Quit: Client closed]
dormito has joined #osdev
Arthuria has joined #osdev
<klange> experimenting with a design refresh on my panel... https://klange.dev/s/Screenshot%20from%202021-06-23%2019-36-50.png
amanita_ has joined #osdev
amanita has quit [Ping timeout: 258 seconds]
gog has joined #osdev
* gog meows
<klange> how about bubble menu things with tails? https://klange.dev/s/Screenshot%20from%202021-06-23%2021-04-23.png
<j`ey> cute
Arthuria has quit [Ping timeout: 265 seconds]
ahalaney has joined #osdev
andydude has joined #osdev
andydude has quit [Quit: andydude]
<sortie> Sleeek screenshots
<klange> just wait until you see my new window dragging mouse cursor
<sortie> The detached panel feels wrong to me. Makes me want to reposition it to the top
<sortie> Sweet
<sortie> Now make it wobble
<sortie> You know you want to
<klange> I really, really do.
<klange> But the mesh deform is complicated...
<sortie> Just imagine showing off your OS and then having wobbly windows
<klange> this grabby hand is adorable
<sortie> It really is
<mjg> and people know it's not linux because it did not crash yet
Sos has quit [Quit: Leaving]
Sos has joined #osdev
Mikaku has quit [Ping timeout: 244 seconds]
<sortie> I'll be merging my futex(2) and true idling later :)
Mikaku has joined #osdev
andydude has joined #osdev
remexre has quit [Read error: Connection reset by peer]
smarton has quit [Quit: ZNC 1.7.2+deb3 - https://znc.in]
remexre has joined #osdev
smarton has joined #osdev
srjek_ has joined #osdev
isaacwoods has joined #osdev
Oli has quit [Quit: leaving]
ausserz has joined #osdev
austin_ has joined #osdev
ausserz has quit [Ping timeout: 258 seconds]
austin_ has quit [Ping timeout: 258 seconds]
rwb has quit [Ping timeout: 265 seconds]
srjek_ has quit [Ping timeout: 264 seconds]
rwb has joined #osdev
lava has joined #osdev
ElectronApps has quit [Read error: Connection reset by peer]
heat has joined #osdev
andydude has quit [Quit: andydude]
andydude has joined #osdev
tenshi has joined #osdev
zoey has joined #osdev
amanita has joined #osdev
johnjay has quit [Ping timeout: 265 seconds]
johnjay has joined #osdev
amanita_ has quit [Ping timeout: 258 seconds]
gmacd has joined #osdev
<graphitemaster> <klange> how about bubble menu things with tails? https://klange.dev/s/Screenshot%20from%202021-06-23%2021-04-23.png
<graphitemaster> Oh god, the Windows task bar update made it to ToaruOS
<graphitemaster> No one wants weather in their task bar. I can assure you, I saw all the negative comments on all the social media websites.
<gog> i don't want fucken widgets or whirlygigs on my desktop at all
<gog> the desktop-as-folder-view paradigm was absolutely fine with me
<GeDaMo> How often do you actually want to check the weather? :|
<graphitemaster> At most once a day
<gog> when i'm deciding what to wear or headed back out for more than a few minutes
<gog> but only because the weather here is fickle
dzwdz1 has joined #osdev
dzwdz1 has quit [Quit: WeeChat 2.3]
<gog> don't wanna be out in a short skirt and be surprised by the wind :|
dzwdz has joined #osdev
<dzwdz> hi o/
<GeDaMo> Hi dzwdz :)
<gog> howdy
<dzwdz> so i've been quite interested in os security recently
<dzwdz> or paranoid, however you want to put it :p
<GeDaMo> Have you read Reflections on Trusting Trust? :P
<dzwdz> i haven't
<dzwdz> thanks, i'll def read it
<GeDaMo> That'll feed your paranoia :P
<dzwdz> but from a quick peek at the search results
<dzwdz> it's about backdoored compilers, right?
<GeDaMo> Yes
<dzwdz> i'm more interested in security on the os level - like, proper privilege separation and stuff like that
<dzwdz> because modern OSes are awful at that
<dzwdz> do y'all know about any security-oriented hobbyist OSes?
pretty_dumm_guy has joined #osdev
isaacwoods has quit [Quit: WeeChat 3.2]
<GeDaMo> I don't know about hobbyist but what about https://en.wikipedia.org/wiki/Capability-based_security ?
<bslsk05> ​en.wikipedia.org: Capability-based security - Wikipedia
<dzwdz> i've read that already, that doesn't really say anything interesting
<dzwdz> from the implementations listed only genode seems to implement ideas that were similar to mine
<dzwdz> but it also seems kinda overly complicated?
elastic_dog has quit [Ping timeout: 240 seconds]
<dzwdz> i took a look at the section on the wiki with community projects and searched for "security"
andydude has quit [Quit: andydude]
<dzwdz> there's one OS that's long dead, and the second one has barely started
<dzwdz> and that's all, which is a shame
vdamewood has joined #osdev
gmacd has quit [Remote host closed the connection]
tacco has joined #osdev
andydude has joined #osdev
elastic_dog has joined #osdev
mahmutov has joined #osdev
chronon has joined #osdev
rwb has quit [Ping timeout: 252 seconds]
rwb has joined #osdev
<sortie> dzwdz: https://www.openbsd.org/events.html is a great collection of resources
<bslsk05> ​www.openbsd.org: OpenBSD: Events and Papers
<sortie> I mean that's all their stuff, but they usually have a lot great security stuff now and then
<dzwdz> openbsd has a very toxic community
<dzwdz> and it builds on ideas which aren't that good in terms of security
<dzwdz> unixes were made for trusted software and untrusted users, and pcs are the exact opposite of that
<gog> the trusted computing platforms are trying to change that, but there's another bag of worms of vendor lock-in that gets opened with that
<gog> open standards, closed ecosystem
<gog> doesn't add up in my mind
<Bitweasil> OpenBSD has a community of security people who have been, for the past couple decades, been reliably proven "Not paranoid enough."
<Bitweasil> I'm surprised any of them still operate computers.
<Bitweasil> I expect there's a regular flow of people out the back end who simply give up on computing entirely.
<dzwdz> do y'all want to see a few notes about my idea for an secure os?
<Bitweasil> I mean, you're welcome to discuss it.
<dzwdz> they're garbage though
<Bitweasil> Doesn't mean a thing without a well behaved processor under it.
<Bitweasil> And most modern processors aren't.
<dzwdz> well, yeah
<dzwdz> but that doesn't mean that we should abandon security and run everything in ring0
<Bitweasil> "Can I have this data I don't have permission to?" "No!" "But what if I speculate that the data has... a 1 bit here?" "oooh, talk speculation to me!... yeah, that's a 1..."
<Bitweasil> Actually.
<Bitweasil> It kind of does.
<gog> and even if a microarch is provably correct, that's hard to do at scale
<Bitweasil> The modern security model of a modern machine should assume any process can read the data out of any other process on the chip.
<Bitweasil> Because that's what it's actually been for 15 years.
<dzwdz> a malicious cpu isn't my only concern
Sos has quit [Ping timeout: 250 seconds]
<gog> not even malicious, just fallible
<Bitweasil> We've been running a cooperative multitasking OS and believing it's protected memory for a long, long time.
<Bitweasil> Yeah, I don't believe Intel was actually malicious here.
<Bitweasil> Just has built something so complex they can't understand it.
<sham1> Running everything in Ring 0 is certainly an interesting idea. Maybe instead of relying on the processor for things like limiting memory access, you could do it based on the programming language, which could be done if the OS is actually a VM thing
<GeDaMo> That's been done before
<Bitweasil> We used to do that.
<sham1> That's what some modern Lisp OSes do, yes
<Bitweasil> Cooperative multitasking OSes are just a bunch of code politely staying out of the way of other people.
<dzwdz> like, on most current systems a single malicious package maintainer could get root on a bunch of pcs at once
<Bitweasil> MacOS was that way through... 7, possibly 9.
<dzwdz> which i'd argue is a bigger thread
<bslsk05> ​www.mcjones.org: Pilot
<dzwdz> threat*
<sham1> As far as I am concerned, it's all just about what you consider as important in your threat model
<Bitweasil> dzwdz, there's been some cryptocoin miners distributed recently through the python libraries.
<kazinsal> My security approach is "running code that isn't ours voids your warranty".
* Bitweasil voids the warranty then turns the computer on.
<dzwdz> modern systems don't even protect stuff like ssh/gpg keys
* gog dissapears into the void
<Bitweasil> gog, that's fine, I can still speculate on your location with enough information to statistically figure out where you are!
<sham1> I can too: The void
<dzwdz> :o
<dzwdz> i'm including you in my threat model too
<kazinsal> void* gog;
<gog> that's appropriate since i identify as a threat
<sham1> That asterisk placement is ugh
<dzwdz> gog: lmao
<Bitweasil> sham1, it's a void pointer to gog, void *gog is... eh.
<Bitweasil> (void*)(gog) vs (void)(*gog) logically.
<dzwdz> but now you're inconsistent
<dzwdz> person *gog; void* gog;
<dzwdz> that's even worse
<gog> i possess runtime polymorphism
<Bitweasil> #define uint32_t void
<Bitweasil> er
<Bitweasil> define uint32_t void*
<Bitweasil> uint32_t gog
<Bitweasil> Can we all agree that's just entirely wrong? :D
<kazinsal> x *y always reads to me like a variable y that is a pointer of size sizeof(x).
<froggey> template<typename T> using ptr = T *; ptr<x> y;
<sham1> That's nicer, since of course now `ptr<x> a, b;` both `a` and `b` are pointers. As opposed to in `x* a, b`
<sham1> It's using `<>` for generics, but eh
<kazinsal> Yeah, that definition issue is a significant language flaw
<sham1> s/generics/templates/
<sham1> You win some, you lose some
vdamewood has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<dzwdz> ig i'll send those notes https://tilde.town/~dzwdz/dupa.html
<bslsk05> ​tilde.town: a slightly secure os
<dzwdz> they're bad because i didn't mean to share them yet
<dzwdz> but i'm curious what actual osdevs think about something like this
<dzwdz> tldr: a microkernel-ish thing with a plan9 style vfs, but as opposed to p9 you can't regain access to directories that you were locked out of
Sos has joined #osdev
brcolow has quit [Ping timeout: 258 seconds]
heat has quit [Read error: Connection reset by peer]
andydude has quit [Quit: andydude]
vdamewood has joined #osdev
andydude has joined #osdev
tenshi has quit [Quit: WeeChat 3.2]
andydude has quit [Quit: andydude]
<klange> graphitemaster: I've had weather on my panel for years :P
<klange> Weather widget was added to the panel March 27th, 2017, was lost in the NIH update for a bit, but came back eventually alongside a JSON parser.
<graphitemaster> John McAfee in the news, what crazy shit did he do this time, ... oh, ... oh
<gog> yeah
<gog> :|
GeDaMo has quit [Quit: Leaving.]
dormito has quit [Ping timeout: 264 seconds]
remexre has quit [Quit: WeeChat 3.0.1]
remexre has joined #osdev
dennis95_ has joined #osdev
dennis95 has quit [Quit: Leaving]
dennis95_ is now known as dennis95
andydude has joined #osdev
gog has quit [Quit: bye]
gog has joined #osdev
dormito has joined #osdev
gmacd has joined #osdev
mahmutov has quit [Ping timeout: 258 seconds]
amanita has quit [Ping timeout: 250 seconds]
srjek_ has joined #osdev
vdamewood has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dennis95 has quit [Quit: Leaving]
sortie has quit [Quit: Leaving]
ahalaney has quit [Quit: Leaving]
nyah has joined #osdev
gmacd has quit [Remote host closed the connection]
<geist> wow, for the first time since announcement, got an in stock alert for ryzen 5950x
pretty_dumm_guy has quit [Quit: WeeChat 3.3-dev]
nyah has quit [Quit: leaving]
freakazoid333 has joined #osdev
tacco has quit []
zoey has quit [Quit: Leaving]
andydude has quit [Quit: andydude]
andydude has joined #osdev
andydude has quit [Client Quit]