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
eddof13 has joined #osdev
eddof13 has quit [Client Quit]
exark has quit [Quit: quit]
exark has joined #osdev
<kof673> mjg: not related to fred, but just as a general "conway's law" :D not arguing for or against : > Strategic Partners of WEF 2009 AMD [no idea currently] when you say "AMD" (or thousands of other entities) ...."stakeholder" stuff is involved, atop the usual corporate veil
<kof673> just meant as "like webdev...there are x other "stakeholders" "
<kof673> i doubt that directly affects such a micro decision, but macro level more perhaps
xenos1984 has quit [Read error: Connection reset by peer]
xenos1984 has joined #osdev
<kof673> this is meant in the spirit of "what will amd do?" excuse me sir, i think you mean amd/stakeholders
netbsduser has joined #osdev
eddof13 has joined #osdev
eddof13 has quit [Client Quit]
eddof13 has joined #osdev
eddof13 has quit [Quit: eddof13]
eddof13 has joined #osdev
Matt|home has joined #osdev
netbsduser has quit [Ping timeout: 272 seconds]
<Matt|home> apologies for the off topic question: does anyone know if management software exists for multi platform LANs, or if it's just not practical? example: something that allows me to make one setting change on one computer reflect across the entire network, like adding a new user to a mac locally will update to adding a new user across every machine regardless of OS
<Matt|home> or would that be a hugely stupid security flaw? i assume this is why most industry sticks to one OS on their networks
<CompanionCube> which OSes, specifically?
<Matt|home> uhhh well ideally software that could support as many platforms as possible so everything from android to ios to windows, but if that's completely infeasible (which i assume it is) then at least soemthing that can operate across linux and windows would suffice
<CompanionCube> well, android/ios aren't really multi-user operating systems, but for Linux and Windows the relevant thing to look at would be Active Directory
<Matt|home> yeah im still unclear on the difference between something like active directory and SMB or whatever, but if my assumption that it's basically a fancy UI for network and system management and it works on linux as well i'll look into setting it up
<Matt|home> thanks CompanionCube
<CompanionCube> SMB is a network filesystem
<CompanionCube> Active Directory is Microsoft's branding for their solution to this, which involves a few different elements
<Matt|home> yeah something to do with domains or some such, i don't know anything about windows management yet
<Matt|home> ty <3
<CompanionCube> probably it's very overkill for you but oh well
<Matt|home> maybe, if it's a ridiculous amount of effort i won't bother
<Matt|home> for me in terms of level of "not worth it" it was when i was setting up a BIND server for fun. that was my upper limit on effort for a project i didn't have _that_ much interest in
<Matt|home> never set up a BIND server ;_; just don't do it.. boycott..
gog has quit [Ping timeout: 255 seconds]
<CompanionCube> for linux the thing you want to look up is 'Samba'
<Matt|home> yeah i know how samba works thankfully :D
<CompanionCube> well if you want you can use that to run the thing, it has support for that
<Matt|home> CompanionCube , just out of curiosity can i ask what your preferred work environment is for computer stuff? just a personal preference i don't care about specifics
<CompanionCube> Matt|home: this was the result of me asking a similar question, but no i don't really have opinions
Arthuria has joined #osdev
netbsduser has joined #osdev
mavhq has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
mavhq has joined #osdev
netbsduser has quit [Ping timeout: 245 seconds]
nanobot567 has joined #osdev
<geist> yah Kerberos, which relates to AD somehow nowadays
<geist> but basically the gist is you get user management into a central database
<geist> i have never set any of this up so i have no idea
<CompanionCube> kerberos is the auth bit of the puzzle, like on unix
edr has quit [Quit: Leaving]
TuxHub has joined #osdev
TuxHub has quit [Client Quit]
Arthuria has quit [Ping timeout: 268 seconds]
Arthuria has joined #osdev
netbsduser has joined #osdev
nanobot567 has quit [Quit: Into the abyss I go!]
eddof13 has quit [Quit: eddof13]
heat has quit [Ping timeout: 268 seconds]
Gooberpatrol66 has quit [Remote host closed the connection]
netbsduser has quit [Ping timeout: 264 seconds]
Arthuria has quit [Ping timeout: 260 seconds]
eddof13 has joined #osdev
neo has joined #osdev
smeso has quit [Quit: smeso]
neo has quit [Ping timeout: 268 seconds]
smeso has joined #osdev
eddof13 has quit [Quit: eddof13]
stolen has joined #osdev
netbsduser has joined #osdev
<kof673> Matt|home, i don't now modern stuff but ancient "yellow pages" stuff for various unix...it depends on what platforms/versions.
<kof673> i mean, in unixland you can ghetto just sort of synchronize groups/passwd files across machines, but that is assuming they are identical on all osen, etc.
<kof673> but IIRC i believe that is more less all that "yellow pages" did lol
<kof673> *more or less
<kof673> there were "netgroups" too but not sure anyone uses them...nfs does i think, 1+ machines can be added to a "netgroup" and that can be used in various configuration files
<kof673> point being: ancient stuff certainly did exist, but not sure anyone uses them. stuff like novell netware, the os would either include a client and/or it cost extra
<kof673> *the other os that had to interface, for file server/login i believe, maybe some more things, printing...
<kof673> *know
<kof673> there are much simpler DNS servers, it is nice for a LAN to have .internal local names but some people don't like "split DNS" if you had to later expose this :D
<kof673> and if you only use ssh keys to reach other machines...then remote machines e.g. headless might even be fine with password login totally disabled :D
<kof673> UNIXland i think generally you can do diskless stuff, /home and other things over NFS, but yeah, not sure if this is still "modern" :D
<kof673> and then....let's say firefox...can it handle a shared /home directory, if you run firefox on two different machines, two different cpus, or will that crash and burn if you don't point them at separate directories/profiles :D
<kof673> depends on the program if it will like you sharing configuration files across cpus/osen, for example :D
netbsduser has quit [Ping timeout: 245 seconds]
<kof673> many years ago, i use to have a window manager set up, so that the menu options would find the "least loaded machine" and remote X display the selected program...but it depends on the program how well that works :D
<kof673> https://docs.freebsd.org/en/books/handbook/network-servers/ that covers the old ancient NIS/"yellow pages"
<bslsk05> ​docs.freebsd.org: Chapter 32. Network Servers | FreeBSD Documentation Portal
<kof673> other osen might vary :D
eddof13 has joined #osdev
<kof673> IIRC i believe like DNS you can say "search local files first, then go out to the network" and pick the ordering of lookups for users and groups
<kof673> for 'manual' "synchronization of files across machines/whatever" isn't that what puppet and other stuff is for? i don't follow these things :D
netbsduser has joined #osdev
asarandi has quit [Quit: WeeChat 4.2.2]
valshaped7424880 has quit [Ping timeout: 240 seconds]
fkrauthan has quit [Quit: ZNC - https://znc.in]
asarandi has joined #osdev
fkrauthan has joined #osdev
valshaped7424880 has joined #osdev
netbsduser has quit [Ping timeout: 260 seconds]
GreaseMonkey has quit [Read error: Connection reset by peer]
gbowne1 has quit [Quit: Leaving]
netbsduser has joined #osdev
neo has joined #osdev
neo has quit [Ping timeout: 264 seconds]
neo has joined #osdev
goliath has joined #osdev
stolen has quit [Quit: Connection closed for inactivity]
netbsduser has quit [Ping timeout: 256 seconds]
eddof13 has quit [Quit: eddof13]
netbsduser has joined #osdev
zetef has joined #osdev
zetef has quit [Remote host closed the connection]
eddof13 has joined #osdev
netbsduser has quit [Ping timeout: 256 seconds]
night_ has joined #osdev
night has quit [Quit: No Ping reply in 180 seconds.]
Beato has quit [Read error: Connection reset by peer]
eddof13 has quit [Ping timeout: 260 seconds]
Beato has joined #osdev
GeDaMo has joined #osdev
mavhq has quit [Ping timeout: 245 seconds]
mavhq has joined #osdev
<dostoyevsky> kof673: how about a distributed file system?
GreaseMonkey has joined #osdev
<GreaseMonkey> how fiddly does IDE get in practice? using raw IDE in QEMU with nothing but RBIL and guesswork seems to take about as much code space as using the INT 13h LBA stuff, but, well, QEMU can be quite generous in this regard
<GreaseMonkey> using one of the guides on the osdev wiki actually worked when using the freedos live cd
op has joined #osdev
<Mutabah> IDE is pretty simple iirc, although I've only worked with emulators
manawyrm has quit [Quit: Read error: 2.99792458 x 10^8 meters/second (Excessive speed of light)]
manawyrm has joined #osdev
valshaped7424880 has quit [Quit: Gone]
valshaped7424880 has joined #osdev
neo has quit [Read error: Connection reset by peer]
neo has joined #osdev
neo has quit [Remote host closed the connection]
neo has joined #osdev
neo has quit [Ping timeout: 255 seconds]
neo has joined #osdev
<nikolapdp> ddevault what are the additions
<ddevault> everything, I started from scratch(ish)
<nikolapdp> oh nice, basically caught up to what you had as it seems
<ddevault> nah, this isn't related to helios
<nikolapdp> oh?
<ddevault> this is a more recreational project, monolithic unix-ish OS
<nikolapdp> neat
<nikolapdp> code?
<ddevault> I pulled in some helios code that is applicable to a monolithic kernel and the rest is from scratch
<bslsk05> ​git.sr.ht: ~sircmpwn/bunnix - A simple monolithic Unix-ish kernel - sourcehut git
<nikolapdp> bunnix, nice name
<ddevault> speedrunning a Unix for fun :^)
<nikolapdp> heh nice
<nikolapdp> are you doing a basic unix like v7 or are you planning something more ambitious
<ddevault> dunno
<ddevault> maybe self hosting
<nikolapdp> sounds doable
<nikolapdp> tcc+hare
<ddevault> more likely cproc than tcc
<ddevault> the main challenge would be binutils
<ddevault> right now I'd like to get a shell and some basic utilities, plus ext4 and FAT and a VFS
<ddevault> then I'll put in some kind of libc and see about a few ports
<nikolapdp> porting an existing shell sounds challenging
<nikolapdp> or did you mean writing your own
<ddevault> dunno, depends
<ddevault> ash with job control patched out probably isn't that hard
<kof673> dostoyevsky, yes, i was just trying to say "username/groups/password synchronization" is very old :D
<ddevault> but yeah for the start I'll just write a simple shell myself
<nikolapdp> neat
<kof673> and nfs is lowest common denominator for old stuff.....
<kof673> nis is ancient, but kerberos and ldap always seemed more work to me
<ddevault> maybe I'll use mlibc to speed things up
<ddevault> C++ though, blegh
<kof673> i just wanted to throw in an old answer, i'm sure he wants something more modern and runs more modern things :D
<nikolapdp> musl seems to be a popular choice for a first libc
gog has joined #osdev
<ddevault> musl is the basis of the helios libc
<ddevault> but mlibc would probably be better for a "speedrun"
<ddevault> since it's much more portable
pog has joined #osdev
<ddevault> but it is written in C++ which promises a significant amount of headache
* kof673 pets both gog and pog, gives both cheese
leg7 has joined #osdev
gog has quit [Ping timeout: 245 seconds]
* pog prr and fascinate
bauen1 has quit [Ping timeout: 255 seconds]
<nikolapdp> well i'd avoid cp
<nikolapdp> cpp
vdamewood has joined #osdev
heat has joined #osdev
<heat> a libc written in C++ is as much of a headache as one written in C
<heat> unless it's garbage. in that case, the C one would probably be worse
<ddevault> spoken like a true C++ user
<heat> the things i write are barely considered C++
<nikolapdp> lol
<ddevault> spoken like a true C++ user
<ddevault> MY subset of C++ is good actually!
<heat> i write C
<heat> but seriously, there's no difference unless you have headers full of identifiers named new and class
<nikolapdp> c doesn't have lambdas
<ddevault> do you compile your C code with gcc or g++
<heat> good news neither do I
* pog lambdas
<nikolapdp> i've seen your code heat, you do
<heat> my lambdas are just syntactical sugar around plain function pointers
<heat> because i dont have std::function and all that horribleness
<nikolapdp> so you do use lambdas
<bslsk05> ​github.com: Onyx/kernel/kernel/mm/slab.cpp at master · heatd/Onyx · GitHub
<heat> does a C programmer understand this file?
<heat> i'd wager yes
<nikolapdp> lol still not c
<nikolapdp> but yes, sure, i do understand
<heat> read it
<heat> you know what this is?
<nikolapdp> read what
<heat> it's like kernel C, with the scoped locks and everything
<nikolapdp> i mean it's in the name of the file
<pog> i don't understand it
<heat> but you're a cat pog
<heat> that's understandable
<pog> oh yeah
<zid> monig
<nikolapdp> morng
Nixkernal has joined #osdev
<leg7> mrnng
<heat> kenrel
<pog> kornol
<leg7> krnl
<heat> ddevault, btw dash is also pretty portable
<heat> it doesn't need job control
<heat> it'll *try to* get job control, but if it doesn't work it can't be arsed to try again
<heat> so as long as you have some sort of tty device you can write and read to, you're fine
<ddevault> cool, that'll do
<heat> bash is significantly more fucked up as it tries to poll your fds and do line editing and all that jazz
<ddevault> yeah not going to bother with bash
<ddevault> and I really don't want to implement TTYs properly, TTYs suck
<nikolapdp> they do
<heat> that's sane
<zid> TTY for life
<zid> what's wrong with ttys :(
<heat> zid what happens when your session leader dies but you still have processes in the foreground pgrp
<heat> this is a tty semantics quiz
<zid> I don't have session leaders
<nikolapdp> lol
<pog> omg this property injection pattern is fucking killing me
<zid> that's nothing to do with ttys, that's "what linux does"
<zid> as usual
<heat> wrong
<zid> you failed to separate them
<heat> it's specified by POSIC
<ddevault> session leaders are defined by POSIX
<heat> POSIX
<zid> and?
<ddevault> (poorly) defined
<zid> Still nothing to do with ttys
<ddevault> wrong
<heat> it's not "what linux does", it's "what POSIX says ttys do"
<ddevault> they interact with TTYs in meaningful ways
op has quit [Ping timeout: 245 seconds]
<zid> That's like saying that cats are shit because they don't have front toes
<zid> then I find out you mean "what certain americans do to cats"
Left_Turn has joined #osdev
<heat> i'm saying cats are shit because they're weird and smelly
<ddevault> if you don't have session leaders your TTY implementation is not POSIX conformant
<ddevault> go read the spec
<zid> okay, good
<zid> no
<heat> (cats are not shit btw, don't cancel me)
<zid> posix doesn't get to control how my 50kg box of metal and plastic from the 60s works
<zid> sorry posix
<heat> anyway the answer was
<heat> it's an orphaned process group, so the foreground gets a SIGHUP + SIGCONT and those processes' controlling tty gets cleared
<Ermine> heat: bash, at least old, doesn't need job control either
<Ermine> it (iirc, 3.x or 4.x) runs in minix somehow
<heat> that's possible, they're all designed to run in shite situations without job control
<heat> maybe against /dev/console?
<heat> also probably stuff like curl | bash -
<Ermine> I've run it over ssh. Still more pleasant than ksh
MiningMarsh has quit [Quit: ZNC 1.8.2 - https://znc.in]
netbsduser has joined #osdev
<heat> yeah but ssh is a pty so you do have job control
bitoff_ has joined #osdev
<heat> i use bash for everything because i'm remotely human and i dont use zsh
bitoff has quit [Ping timeout: 252 seconds]
MiningMarsh has joined #osdev
<leg7> fish is best
<zid> You're thinking of 'what's the best thing to catch in a net in the sea'
<zid> we were talking about shells
<bslsk05> ​fishshell.com: fish shell
* pog chomp fish
<leg7> Are X86 operand sizes relevant to programmers? I thought the assembly language handeled them
<leg7> Section 3.6 of the intel volume 1 manual
<leg7> basic architecture
bauen1 has joined #osdev
SophiaNya has quit [Remote host closed the connection]
ptrc has quit [Remote host closed the connection]
<GeDaMo> Well, you have to care a little bit about the size of values
SophiaNya has joined #osdev
ptrc has joined #osdev
<leg7> well in nasm you have to explicitly give the size of operands
<leg7> for example: mov byte [eax + 4], 8
<GeDaMo> Not always, most of the time the assembler can determine the size from registers used
<leg7> yes but not in nasm
<leg7> maybe in gas
<GeDaMo> That's because you're writing a literal to memory, there's nothing there to specify how many bytes you want to write unless you specify
<heat> mov byte [eax + 4], 8 = movl $8, 4(%eax)
<heat> it's as ambiguous
<GeDaMo> If you do mov [eax+4],ebx then it know you're writing 4 bytes because of the size of ebx
<heat> well, in this case, it's not ambiguous
<GeDaMo> It would be movb if you want to write a byte
<GeDaMo> gas uses the mnemonic suffixes to specify size
<leg7> well I'm not sure that would compile gedamo
<heat> what would?
<GeDaMo> Which? mov [eax+4],ebx
<leg7> yes
<heat> thats valid intel syntax
<GeDaMo> 1 0000 67895804 mov [eax+4],ebx
<heat> mov %ebx, 4(%eax) is valid at&t
<GeDaMo> Admittedly that's using gas in Intel mode :P
<leg7> wouldn't it have to be: mov dword [eax+4], ebx
<leg7> in nasm
<GeDaMo> No
<GeDaMo> ebx sets the size
<GeDaMo> Being a 32 bit register
<bslsk05> ​godbolt.org: Compiler Explorer
<heat> compiles just fine
<GeDaMo> From nasm 1 00000000 6667895804 mov [eax+4],ebx
<GeDaMo> Huh, I didn't know godbolt does asm :P
heat has quit [Remote host closed the connection]
<bslsk05> ​www.nasm.us: NASM - The Netwide Assembler
bauen1 has quit [Ping timeout: 245 seconds]
<GeDaMo> Yes, it doesn't store variable types
<GeDaMo> Registers are not variable
<GeDaMo> Er, variables
heat has joined #osdev
<bslsk05> ​godbolt.org: Compiler Explorer
<zid> I mean, you could always have done that
<leg7> yeah I just sent that for clarification
<zid> godbolt didn't even used to have C on its dropdown
<zid> so I had to use C++ and -x c
<leg7> All arithmetic instructions (except the DIV and IDIV instructions) allow the source operand to be an immediate value. The maximum value allowed for an immediate operand varies among instructions, but can never be greater than the maximum value of an unsigned doubleword integer (232).
<leg7> Is this true even in long mode?
<zid> yes
<leg7> ok that's a bit odd
<zid> there's a single mov reg imm64 encoding and that's it
<zid> why?
<zid> You almost exclusively never load 64bit constants
<zid> from .text
<leg7> don't you mean mov reg imm32?
<heat> no
<zid> no?
<zid> You asked if the 32bit limit applied only to pmode
<leg7> yeah
<zid> I said long mode has a singular 64bit immediate instruction, but is otherwise true
<leg7> ok
<GeDaMo> "REX.W + B8+ rd io MOV r64, imm64 OI Valid N.E. Move imm64 to r64." https://www.felixcloutier.com/x86/mov
<bslsk05> ​www.felixcloutier.com: MOV — Move
<zid> even the 32bit versions are barely used in practice
<heat> 64-bit imm instructions for everything would possibly make some of the encodings unencodeable in 15 bytes
<heat> and that would be fun
<zid> I'd say 80% of the time you're dealing with values like "divide by 8", and 19.99% of the time it'd fit in say, a short if that encoding existed
<leg7> so how does something like mov eax, 2^33 work?
<leg7> I mean rax
<zid> You typically don't, let's start with that, but you could either form it mathematically, or with a non-immediate load.
<zid> mov eax, [someval]
<leg7> ok
<zid> when was the last time you wrote 'long long' into a C program
<GeDaMo> The research that lead to RISC found that most immediate values were small
<zid> then passed 2^33 to that function
<zid> that's how often you need that
<zid> yea it's like, zipf's law or whatever I imagine GeDaMo
<zid> 50% are 1 digit, 25% are 2, 12.5% are 3, etc
<GeDaMo> I think the research was by Andrew Tanenbaum
<zid> It's n ice to quantify, but it's fairly obvious
<zid> I've *never* used a 128bit number, but I use '1' constantly. QED.
<heat> mov rax, 2^33 Just Works
<heat> mov r64, imm64
<zid> oh cus of the movsx
<zid> err movabs
<zid> yea, that's the one encoding that DOES exist, lol
<GeDaMo> "Another finding, not fully explored at the time, was Tanenbaum's note that 81% of the constants were either 0, 1, or 2." https://en.wikipedia.org/wiki/Berkeley_RISC
<zid> You meant to say "How does one do add rax, 2^33-7" or whatever
<zid> GeDaMo: I am a geniarse
<zid> if you rub it you get a wish!
<GeDaMo> Er, no thanks :|
<leg7> Well according to the intel manual an immediate value can never be greater than 2^32
<leg7> So it shouldn't work
<zid> you don't listen do you
<zid> There are *zero arithmetic ops that have an immediate bigger than 2^32*
<heat> mov isn't an arithmetic instruction
<zid> there is a *single mov* encoding
<leg7> "The maximum value allowed for an immediate operand varies among instructions, but can never be greater than the maximum value of an unsigned doubleword integer (232)."
<leg7> So the manual is wrong
<zid> are you reading the ia-32e manual
<zid> or the ia-32
<heat> >All arithmetic instructions
<heat> ARITHMETIC INSTRUCTION
<heat> MOV DOES NO ARITHMETIC
<zid> ergh he pasted that last one out of context?
<heat> full quote above
<leg7> The second sentence is independent of the first one
<GeDaMo> mov rax, 0x1234567812345678 can be encoded; add rax, 0x1234567812345678 cannot
<zid> oh ffs yea it's just that one cut in half
<zid> It fucking is not.
<leg7> All arithmetic instructions (except the DIV and IDIV instructions) allow the source operand to be an immediate value. The maximum value allowed for an immediate operand varies among instructions, but can never be greater than the maximum value of an unsigned doubleword integer (232).
<zid> That's not how language works
<heat> ok the answer is
<zid> The thing we told him 8 times
<zid> already
<heat> you're apparently reading an old ass document
<zid> I even asked if he had the ia-32 or ia-32e manual
<leg7> it says it varies among instructions not that it varies among arithmetic instructions. I understand what you're saying it's just that the manual is ambigous here
<leg7> Intel® 64 and IA-32 ArchitecturesSoftware Developer’s Manual
<leg7> Order Number: 325462-082USDecember 2023
<zid> Okay so then maybe you could suggest they tighten that wording up very slightly
<leg7> yes
<zid> but it's not exactly hard to understand
<leg7> It's not hard for you when you know all the instruction encodings
<leg7> I'm reading the manual and it contradicts what you say and you treat me like an idiot when I bring it up
<zid> If I was in a chapter called "Art history of the 1700s" and then the sentence "The predominant technique for painting is sticking brushes up your nose"
<zid> that *still* doesn't say anything about 1900s painting technique
<heat> wow okay this is truly fucking bizarre
spareproject has joined #osdev
<heat> they haven't touched this section since the fucking pentium or something
<zid> nice
<heat> the ppro manual reads exactly the same
<zid> still doesn't matter though
<bslsk05> ​i.imgur.com <no title>
<heat> boss, you forgot a whole mode boss
<heat> the rax is a lie
<zid> hey at least it has fs and gs
<zid> no 3dnow though :(
<pog> 3dnow was an amd extension
<leg7> I asked the question in the first place because when you read 3.7.1 it looks like this only applies to 32bit
<zid> it also just used the mmx nomenclature anyway
<zid> it does
<zid> but it doesn't say anything about 64bit, so you just don't know, which is why you asked
<zid> it doesn't make any *false* claims in that regard
<leg7> yes
<zid> It also happens to still be true
<zid> you just can't *tell*
<zid> But we answered you, 8 times
<zid> and you just argued
<leg7> Yes because the manual says otherwise so I wanted to know which is right.
<zid> You just acknowledged that it only applied to 32bit
<zid> now you're saying it says otherwise
<zid> pick
<GeDaMo> There is one instruction which allows a 64 bit immediate, mov to 64 bit register
vdamewood has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<zid> Either you're saying the rax register doesn't exist
<zid> or you're saying that limitation only applies in 32bit
<zid> you can't have *both*
<leg7> I feel like you are always misunderstanding me on purpose to make me look stupid
<zid> If you actually read what the manual says in that chapter, it says 64bit code *does not exist* and that *immediates are limited to 32bit*
<zid> You can't then claim it says 64bit code's immediates are mentioned
<zid> leg7: Maybe don't argue about answers to your questions then?
<zid> Be cooperative instead of combatitive
<zid> and you'll find us more cooperative
<heat> linix kernel
<heat> leg7, you just found a really shitty part of the manual, that's all
<zid> There was no "Oh, weird, the manual here confused me *link*" and we'd have gone "haha yea funny manual is old, it hasn't been updated with rax look, so clearly this can't apply to 64bit"
<heat> it's almost verbatim the same as the ppro manual
<heat> pog, bazel
<pog> msbuild
<leg7> How am I supposed to know the manual hasn't been updated in 10 years jeez
<zid> We got a badly cropped quote designed to de-contextify it to make it look bad with "manual is wrong", looked like it was designed to trick *us*
<zid> 10? oh dear
<zid> You wish
<zid> also, arguing again
<zid> pentium pro was 1995
<heat> hey stop arguing everyone
<zid> my calculator says that was -1771 years ago
<zid> I think I fucked up
<heat> whats your favourite build system
<zid> 29 years ago, nice
<heat> BUILD SYSTEM WAR
<zid> If you have a favourite you care more about wanking than you do about code or software
<zid> qed
<zid> It's like having a favourite serial killer
<heat> wanking tends to be better than software
<heat> no tech debt at least
<zid> computers were a mistake
<pog> software is bad anyway and we should stop building it
<zid> factorio is the only useful pieceof software
<pog> balatro
<pog> zid i won blue deck on black stake
<zid> balatro is love2d, so technically it's not software
<GeDaMo> Let's see you write an OS in Factorio :P
<zid> nice, ur not super shit anymore, that's pretty good
<leg7> Bro you really have to relax. I never tried attacking you, I just ask for clarification and quote the manual and you make me out to be this idiot who is conspiring against you or something. I'm just here for help and information, When I tell you the manual contradicts you it's not to be an asshole it's just because it did.
<pog> factorio circuits are turing-complete
<zid> I didn't say you attacked me
<zid> I said you were arguing
<zid> which you are
<heat> hey everyone chill the fuck out
* GeDaMo grates cheese over everyone
<heat> as samuel l jackson once said
<heat> tell your bitch to be cool
<zid> GeDaMo: I actually suggested to nik yesterday we should make a z80 in factorio
<heat> bitch be cool
<zid> idk how to do it though, best way would be to just write a compiler that spat out the map
<zid> but idk how to do the routing part
<zid> like, if you compiled it to a netlist of factorio parts, you need to turn that into a laid-out PCB with all the wires, and that sounds hard
<zid> I think it's Np hard, too
<GeDaMo> Maybe a Verilo / VHDL to Factorio compiler :P
<GeDaMo> Er, Verilog
<zid> factorio doesn't have point to point wire connections
<GeDaMo> Conveyor belts?
<zid> else it'd be easy
<leg7> zid you made me really sad
<leg7> goodbye
<pog> there are a bunch of youtube videos about making cpus in factorio
leg7 has quit [Remote host closed the connection]
<zid> yea someone posted a megabyte of dram yesterday
<zid> I'd care more if bots could handle wire betters tbh :P
<pog> deploying a local redis docker was the best idea i've had today. my testing flow is about 3x faster
<zid> they're annoying, but I think a few of the dev logs have shown imprpovements to that are coming
<heat> redis mongo docker
<heat> the tech people expect us to think this is real
<zid> GeDaMo: sort of p2p but the latency would be insane, and you can't cross them, so it doesn't really help
<zid> wires can cross but the range is tiny
<zid> If gog says "on rails" at any point in the next 20 minutes, can I shoot her?
<zid> It's a mercy
<GeDaMo> Can you put conveyor belts underground or is that just pipes?
<zid> you can but that grants you one crossing
<GeDaMo> (I haven't played much Factorio :P )
<zid> so it's still constrainted
<zid> which means you need a constraint solver still
<zid> so you may as well use wires again
<zid> GeDaMo teach me how to adapt REGISTER COLOURING for eletricity pole colouring I guess :P
LittleFox has quit [Quit: ZNC 1.8.2+deb3.1 - https://znc.in]
<nikolapdp> another constraint, underground belts can only be so long
<Ermine> i wonder why android doesn't use ncm for usb tethering
<Ermine> (instead of rndis)
<zid> disregard programming, acquire 4700 lines of ifs()
LittleFox has joined #osdev
<zid> It amazes me just how much WORK people can get done with relatively little ability, and produce such cool things
<GeDaMo> Why isn't that some kind of database table? :|
<zid> meanwhile I could write much nicer code but I can't *produce* anything :(
<pog> ooooooof
<pog> i try to strike a balance between productive coding and attractive coding
<zid> worst part
<zid> spaces: 4
<pog> just stuff the nasty parts into a file you never have to look at
bauen1 has joined #osdev
<Ermine> cpus in minecraft are funny btw
<Ermine> gargantuan constructs which work at shite clock rates, but work nonetheless
<heat> pessimal clock rates
<heat> imagine your cpu had to run tons of java just to do an op
<heat> fucking pessimal stuff
<heat> truly shite webdev
<Ermine> even 16bit
<Ermine> 'truly shite webdev' would be if it was written in javascript
<zid> your cpu would be slow too if the speed of light was 1m/s and wires didn't exist :p
<nikolar> :)
<nikolar> The world would be wacky if the speed of light was 1m/s
<zid> There was a game of that a while back
<zid> mit student project or whatever id
<zid> but everything redshifted as you moved etc
<zid> yea I was right
<zid> v
<bslsk05> ​gamelab.mit.edu: A Slower Speed of Light – MIT Game Lab
<zid> I did grab it and play for 30 seconds back in 2016
stolen has joined #osdev
<nikolapdp> very nice ddevault
<nikolapdp> yea same actually lol
vaihome has quit [Ping timeout: 255 seconds]
edr has joined #osdev
Arthuria has joined #osdev
raphaelsc has joined #osdev
Arthuria has quit [Ping timeout: 245 seconds]
nagitsu has joined #osdev
<zid> SPIN UP
<zid> 250G of western digital power
<zid> poor port 1 got span up and nothing's there?
<ddevault> (staggered spin up, that was a real bitch the first time I wrote an AHCI driver)
<ddevault> port 1 is ATAPI, it's silently ignored
<nikolapdp> very nice ddevault
<zid> when do we get the porn off the drive
<zid> ascii naked nikolar
Matt|home has quit [Remote host closed the connection]
goliath has quit [Quit: SIGSEGV]
navi has joined #osdev
<zid> discord is having a right moment
zetef has joined #osdev
spareproject has quit [Remote host closed the connection]
heat has quit [Remote host closed the connection]
heat has joined #osdev
edr has quit [Quit: Leaving]
Terlisimo has quit [Quit: Connection reset by beer]
<zid> why are pigs cheaper than cheese
Terlisimo has joined #osdev
<GeDaMo> Pigs are self reproducing :P
bauen1 has quit [Ping timeout: 252 seconds]
<zid> heat: important build info for my KERNAL
<ddevault> end of day 3: https://files.catbox.moe/ie7u6w.png
neo has quit [Ping timeout: 256 seconds]
Turn_Left has joined #osdev
xenos1984 has quit [Ping timeout: 268 seconds]
xenos1984 has joined #osdev
carbonfiber has joined #osdev
Left_Turn has quit [Ping timeout: 256 seconds]
<zid> pog: You made me think of balatro, so I beat purple for ghost deck
<zid> weird shit deck but was super easy to play and just barely scored enough
<zid> sigil turned half my deck into 2s, and I found vampire
<zid> so just.. throw tarot upgrades onto 2s and play 5 of a kind, done
<zid> had random trash other jokers like the +4 mult one :p
bauen1 has joined #osdev
npc has joined #osdev
Fingel has joined #osdev
<pog> the only illegal hand i got so far is flush house
<pog> i haven't gotten 5 of a kind yet
<pog> anyhow time to go home
pog has quit [Quit: Konversation terminated!]
npc has quit [Ping timeout: 240 seconds]
gog has joined #osdev
<heat> ddevault, cool stuff!
<heat> i like how you wrote down some video mode on your laptop :P
spareproject has joined #osdev
<ddevault> haha yep
<heat> are you taking drivers from your other thing into this one?
<heat> (forgot the name)
<ddevault> yeah
<ddevault> porting them in and adapting them for the monolithic approach
<ddevault> lots of original code though
<ddevault> god having a slab allocator in the kernel simplifies the fuck out of things doesn't it
<mjg> yo, did 8086 have rings?
<mjg> i don't know how much shit i can legally talk about dos
<mjg> i would ask chatgpt but perhaps someone here will know
<GeDaMo> I don't think so
<mjg> maybe i should just google the programmer's manual
<heat> ddevault, how do you allocate without a slab allocator?
<heat> or allocator in general i'd guess
<ddevault> helios only has a page allocator
<ddevault> the memory manager is in userspace
<heat> oh
<heat> not many objects then?
<ddevault> somewhat north of a dozen
<ddevault> but all of them are at or rounded up to the page size
<ddevault> plus stack and some globals of course
<heat> yeah i guess it works if they're page-size-ish
chiselfuse has quit [Remote host closed the connection]
<ddevault> yeah, it's stuff like a PML4 or thread state
<ddevault> it's a microkernel after all
chiselfuse has joined #osdev
frkazoid333 has quit [Ping timeout: 268 seconds]
<netbsduser> that's very micro
<zid> nikolapdp they're talking about you again
<netbsduser> mach and spring have comprehensive and complete virtual memory implemented in the kernel with an external pager interface for backing objects
<nikolar> :(
<ddevault> well, to be fair I am considering having a fatter microkernel, particularly with a more sophisticated memory manager
xenos1984 has quit [Ping timeout: 268 seconds]
<ddevault> the monolithic project is giving me a lot of ideas for improving the microkernel
divine has joined #osdev
<ddevault> both in userspace and kernel space
<ddevault> though I imagine most of the memory manager could still be in userspace, but improved nonetheless with some of what I've learned
<nortti> < mjg> yo, did 8086 have rings? ← nope, only one mode of execution, and segments were all 64K in size, read/write/exec, and located at segment_reg * 16 physical
<mjg> nortti: ye that's what i'm reading so far
<heat> yeah weren't rings apart of the 286 protected mode stuff?
<mjg> looks like they came with 285
<nortti> aye
<mjg> i have to oficially shit on dos a little less
<mjg> i always assumed they *could* have used rings, but just did not. in contrast to unix which started with kernel/user separation
<GeDaMo> There were multi-user, multi-tasking systems on 8086
<mjg> with actual protection?
<nortti> no
<mjg> right
<mjg> cooperative multi-tasking is what dos is known for
<mjg> and what was fucking with windows before the nt switch
<nortti> no there were preëmptive systems, they just relied on the user processes not to stomp on each other / the kernel
<mjg> preemptive?
<heat> no, preëmptive, the european version of preemptive
<mjg> you mean something else than cooperative multi-tasking?
<mjg> i only know of tsr's or whatever the acronym
<nortti> yeah, for example xenix ran on 8088 PCs
<GeDaMo> Terminate and Stay Resident
<GeDaMo> Also Concurrent CP/M
<mjg> huh
<mjg> TIL
<heat> xenix? you sure?
<GeDaMo> Yes
<nortti> yeah
<mjg> so how much can i legally shit on dos
<heat> 8088 sounds too small for xenix
<nortti> why?
<GeDaMo> "The first 8086 port was for the Altos Computer Systems' non-PC-compatible 8600-series computers (first customer ship date Q1 1982)." https://en.wikipedia.org/wiki/Xenix
<heat> it.. just does
<heat> maybe my mental map of xenix history is slightly off
<heat> but they ditched 16 bit fairly quickly
<heat> they = unix in general
<nortti> mjg: you can shit on it for having too limited of a hardware abstraction layer, leading to software poking the hardware directly, and also for having no affordances for multitasking in its design
<mjg> heh, so chatgpt correctly claims 8086 did not have rings, i'm impressed
<heat> did you know it does not scale
<heat> actually, no, it scales perfectly
<heat> no locks
<mjg> wrong
<heat> LOCKLESS
<mjg> intel docs for 8086 already talk about the LOCK prefix
<mjg> :s
<mjg> so
<heat> i bet you wont find a single LOCK in dos
<nortti> lemme see…
<mjg> this reminded me of a fucker who claimed some algo is not lockless
<mjg> cause there was a lock-prefixed instruction in generated asm
<mjg> :d
<heat> i agree
<nortti> yeah, no lock prefix in dos 1.25 at least
<heat> you'll need a lock somewhere
<mjg> dozzZ
<mjg> lemme tell ya, norton commander was my emacs
<mjg> for the uninitiated, emacs users do eerything in the fucking editor
<mjg> in dos times it was common to just run nc
<heat> oh yes
<heat> the very common linux irc user that never heard of emacs
<nortti> I would not expect much locking in any case, as even up to windows 3.11 you had "the critical section", as in, one single synchronization object for the entire system
<mjg> it even had shit like ncedit, which is how mcedit came to be
<heat> minecraft edit??
<mjg> hm... did 3.x even support smp?
<mjg> i know nt kernel did, while running the same "shell" or whatever they call it as win 3.x
<acidx> 3.11 in enhanced mode used virtual8086 for every app
<acidx> but the system itself was running in protected mode
<mjg> so presumably as far as source code went, some understanding of multicore had tobe there
xenos1984 has joined #osdev
<heat> but the nt kernel was good
<nortti> dos 2.0 has LockOper, syscall number 92
<acidx> but, no, win3.11 didn't support smp IIRC. it wasn't that common on desktops back then.
<nortti> aye
<Bitweasil> Far as I know, only the NT series supported SMP. None of the consumer Windows did, until XP.
<Bitweasil> (... and call 2000 what you will, it wasn't really aimed as a consumer OS, though it did a fine enough job at it)
<mjg> hey i had a 2000 on my desktop in high school]
<mjg> rock solid until blaster showed up
<Bitweasil> Blaster? I ran 2k on my box in college for a few years.
<mjg> xp series was shutting down after a minute, 2000 was losing networking
<geist> correct everyone has said here. SMP was very exotic on consumer stuff util late 90s
<nortti> okay looks like LockOper is file locking https://www.ctyme.com/intr/rb-3016.htm
<bslsk05> ​www.ctyme.com: Int 21/AH=5Ch
<mjg> the exploit was causing some process to crash and it was taking networking down with it
<GeDaMo> There were a few asymmetric systems in the 80s :P
<Bitweasil> The Pentium Pros could do it, but were certainly "exotic workstation chips." I believe there were some SMP 486s, but with bizarre glue.
zetef has quit [Remote host closed the connection]
<nortti> geist: how big of a flex was bebox being dual CPU, actually?
<Bitweasil> nortti, you were a god among men if you had one of those. :p
<geist> it was kinda a flex yeah
<geist> also macs had some MP machines, but they weren't properly SMP
<acidx> the LEDs in the case were a flex, probably
<Bitweasil> ... "probably"? :p
<geist> and yeah the LEDs being up front was a major flex
<Bitweasil> BeBox said "I appreciate the weird architectures, and I have money."
<acidx> I've never seen a real working bebox before
<geist> i have a pair of them
<acidx> I saw one at one of the brazilian google offices a while back
<kazinsal> you could probably build some exotic bespoke SMP 8088 system but you'd need a lot of glue logic
<Bitweasil> I'm pretty sure the SMP 486s were "a lot of custom glue."
<acidx> I think that bebox was Bruno Albuquerque's box
<Bitweasil> PPro and following had it natively, more or less.
<nortti> kazinsal: would you? there's no caching, and DMA is already something supported, so presumably bus arbitration is not too hard
<Bitweasil> My first "modern" computer after the 486 was a SMP Pentium 3 board, and I've owned a bunch of P6 based SMP boxes over the years - quad PPro, quad P3 Xeon, etc.
<acidx> I worked at a PC repair shop in the 90s and I remember a SMP Pentium Pro rolling in one day. it was running NT 4 IIRC. I was amazed by the idea
<Bitweasil> Probably had, like, 128 meg RAM too! :D
<Bitweasil> I still think the single fastest system I've ever used in my life was a SMP P3 866 box, Rambus, and a U320 SCSI 15k drive, running XP.
<acidx> right. I had a 486 with 8 megs of ram back then
<Bitweasil> The NVMe stuff is a lot faster, but everything is *so* much more massive these days...
vdamewood has joined #osdev
freakazoid332 has joined #osdev
goliath has joined #osdev
helene has quit [Remote host closed the connection]
randm has quit [Remote host closed the connection]
randm has joined #osdev
gbowne1 has joined #osdev
helene has joined #osdev
Nixkernal_ has joined #osdev
Nixkernal has quit [Ping timeout: 255 seconds]
<netbsduser> who even likes rings
<netbsduser> no one
stolen has quit [Quit: Connection closed for inactivity]
<netbsduser> needless junk, i have no idea why they put it in the vax instead of a traditional user/supervisor mode, but it's aged like milk
<mjg> what filesystem is now being shipped with windows and does it data checksumming?
<mjg> does it do*
<mjg> i know they had something other than ntfs, but i don't know if it ships
<puck> refs?
<mjg> ye that one
<puck> the "dev drive" feature uses ReFS
<bslsk05> ​learn.microsoft.com: Set up a Dev Drive on Windows 11 | Microsoft Learn
<heat> refs doesn't ship
<heat> they ship ntfs
<vdamewood> NotTested File System
<vdamewood> Rarely Effective File System
<mjg> is it still possible to isntall windows on fat? (i'm guessing no, but in that case when was it lost? 7?)
<vdamewood> I think v/ista
<vdamewood> Come to think of it, It might have even been XP.
Nixkernal_ has quit [Ping timeout: 255 seconds]
<mjg> i think xp allowed to convert fat to ntfs
<mjg> but i don't recall if it *demanded* it
GeDaMo has quit [Quit: That's it, you people have stood in my way long enough! I'm going to clown college!]
vdamewood has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Gooberpatrol66 has joined #osdev
hunta987 has joined #osdev
<zid> we know the requirement for reiserfs, what do you have to kill to work on ntfs?
<zid> I'll go with small swedish village and work outwards if it wasn'tenough
<MelMalik> greople
spareproject has quit [Remote host closed the connection]
* sham1 chants "DEVELOPERS DEVELOPERS" at zid
<zid> ooh good call sham
* kof673 sees lunduke in the front row getting spit on
<nikolar> lol
<sham1> > lunduke
<sham1> Mate really went off the deep end
zetef has joined #osdev
<sham1> It's a shame, really
<gog> developers developers developers
* Bitweasil throws a chair
<gog> the ballmer peak is real btw
<gog> after i have a liquid lunch i write some great code
<sham1> I don't think Ballmer ever threw a chair
<gog> oh yes he did
<gog> in meetings
<gog> he'd throw chairs and shout and
<sham1> Oh, nvm
<zid> It's disinhibiting, gog
<zid> sounds good for a performative art like programs
<sham1> If you take enough alcohol, you won't even feel ashamed for shitcode
<zid> "eh fuck it, we'll just do one of these, and one of those, bam"
<sham1> (which is like shitposting but for code)
<gog> you know what they call shitcode that ships and makes money?
<zid> exactly sham, you just wanna take the edge off
<gog> they don't
<gog> nobody cares
<zid> I can't deliver so I'd need the booze
<sham1> Nobody cares except for developers who have to maintain the thing after
Matt|home has joined #osdev
<sham1> Then again, no one cares for those developers
<gog> i'll be dead before anybody else has to maintain my code
<sham1> Which is why the Ballmer chant was (and still is) necessary
<gog> could be 6 months, could be 50 years
<gog> developers? developers. developers!
<sham1> Developers
<bslsk05> ​'Steve Ballmer: Developers' by MrWueb007 (00:00:24)
<ghostbuster> anyone know why include/linux/pgtable.h contains definitions like #define pmd_offset pmd_offset, #define pud_offset pud_offset, etc
<nikolar> so that you get macros instead of enums
<nikolar> or whatever it is
<zid> git blaame :P
<nikolar> lol
<zid> (I imagine that code is too ancient though)
<nikolar> yeah probably
gmodena has joined #osdev
<bslsk05> ​github.com: mm: consolidate pte_index() and pte_offset_*() definitions · torvalds/linux@974b9b2 · GitHub
<ghostbuster> macros instead of functions, but why?
<zid> looks like he just chopped what it was defined as off, and replaced it with his new one
<heat> ghostbuster, it's a common pattern
<heat> basically you can't check in C if a function is defined, but you can check if a macro is defined
<zid> so that the thingy stayed a macro
<ghostbuster> ah
<nikolar> yeah basically
<heat> what happens in the linux mm is that they have many layers of headers, with ifdef'd code, ifndef'd fallbacks, etc
<nikolar> not particularly important most of the time
<heat> so this is common
<ghostbuster> makes sense, thanks
<ghostbuster> still trying to wrap my brain around 5x levels of page tables
<heat> there you go, here's the fallback
<bslsk05> ​elixir.bootlin.com: pgtable.h - include/linux/pgtable.h - Linux source code (v6.8.7) - Bootlin
<heat> if you're not looking specifically into understanding and working on linux, learning the linux page table nomenclature is really futile
<heat> their thing is really backwards
<ghostbuster> yeah i think i read something about how they got named
<heat> they made up nice names for everything, but then for the 5th level they just said fuck it, p4d
<heat> page tables are named pte
<heat> (the lowest level page tables)
<heat> the page table entries are not pte but ptep
<nikolar> isn't that what intel calls the them
<heat> calls what?
<zid> PTE yea, but not PTEP
<heat> the lowest level of page tables on x86 intel is named page table
<heat> the entries are named PTEs
<heat> page table -> page directory -> page directory pointer table -> PML4 -> PML5
<heat> personally i think we should've done page directory pointer table table
<heat> wait, no, page directory pointer table pointer table
<zid> I wanted page directory directory pointer table table
<ghostbuster> i'm looking at linux on x86 now but i also want to understand apple os and ARM eventually
<geist> if you want to look at a general purpose open source OS i'd recommend starting with the BSDs first
<nikolar> you mean mac os?
<geist> they're a bit clearer to read
<geist> than linux
<ghostbuster> i mean macOS/iOS/iPadOS/watchOS/tvOS/visionOS/etc lol
<nikolar> yeah doubt you'd find much public information, though the kernel code is open source
<geist> yah fwiw the kernel is called XNU, part of the darwin project
<geist> XNU most folks will know what you're talking about
<ghostbuster> i am context switching between a bunch of learning material for diff. architectures and OSes
<ghostbuster> right now trying to reproduce this exploit https://www.willsroot.io/2022/01/cve-2022-0185.html
<bslsk05> ​www.willsroot.io: Will's Root: CVE-2022-0185 - Winning a $31337 Bounty after Pwning Ubuntu and Escaping Google's KCTF Containers
<ghostbuster> managed to get the kernel running in gdb and crash it: PGD 10cb3a067 P4D 10cb3a067 PUD 10f23c067 PMD 4141414141414141
netbsduser has quit [Ping timeout: 260 seconds]
netbsduser has joined #osdev
<zid> if GNU is so great why didn't god put richard stallman bones everywhere to test us like he did dinosaurs
<sham1> Because RMS (pbuh) is still alive
<ghostbuster> does he need all his bones
<sham1> I'm sure He prefers having all of his bones
<ghostbuster> not what i asked
<heat> gnu people don't need most bones, they can't get up from their chairs anyway
<zid> sham1 work on ur reading comprehension
* sham1 mutters in gnu
<heat> >Recently, several friends on my CTF team Crusaders of Rust
<heat> christ save us
<zid> They're going on a crusade to battle rust over the holy land!?
<zid> nice guys
<nikolar> if not, we're doomed
<sham1> Shooting down the Shaheds due to them not using Rust
<sham1> And doing the same for the Iron Dome
<heat> iron dome obviously has rust
<nikolar> kek
<friedy> Can't stand Rust I'm never using it unless I'm one day forced to
<heat> literally 1984
* ghostbuster overwrites friedy's page tables
<hunta987> oxidized dome
<heat> joe biden is making me use a memory safe language
<sham1> The rocketn't
<sham1> Watch Bibi rename stuff in zoomer lingo
<heat> the leftist snowflakes cant handle real programming languages
<nikolar> lol ↑ but unironically
<nikolar> considering a left leaning government recommended rust
<heat> tfw you try to be as egregious as possible and someone agrees with you
<nikolar> lol
<nikolar> that's what you wanted right :p
<sham1> Something something overton window something
<friedy> Rustaceans say "This is the future!! It's gonna replace C!!! Embedded Rust!!!" Me "Okay bro"
<heat> okay bro, let me get back to you once i finish my fortran program
<sham1> Somehow, somewhere, a pacemaker stops working because in one of the 2^64 transient dependencies of the Rust-based firmware, you get a panic
<sham1> Although I'll be fair to Rust people for once and say that they probably wouldn't do that, but you never know. They managed to smuggle the `alloc` crate into Linux
<sham1> The significance being of course that `alloc` doesn't let you detect allocation problems other than by panics
<Ermine> oxidized world won?
<sham1> Seemingly
<sham1> I'm surprised that Linus gave it the green light
<Ermine> you didn't get the joke
<sham1> Many of his objections against C++ are also applicable in Rust, after all
<sham1> Clearly not
<nikolar> That's not wrong
<sham1> I didn't see a joke
<nikolar> They just wore him down
<Ermine> It was a reference to "the plastic world has won" punk rock song
<sham1> Ah
<heat> kernel rust alloc can fail
<Ermine> actually it's named the other way, but it contains that song
<Ermine> s/song/line
<Ermine> i'm kinda fucked these days
<kof673> songs within songs, lines within lines, plastic world without end
<heat> part of the reason why i'm moving back to C interfaces for my kernel is if i ever want to add rust, i can just do it
<nikolapdp> why would you want that
<heat> it's safer
<Ermine> btw rust produces too big code which is unsuitable for embedded targets
<nikolapdp> FEARLESS CONCURRENCY
<nikolapdp> SAFETY
<heat> rust should produce more or less what llvm produces
<hunta987> I don't understand why they'd make panic a default macro in Rust, why encourage programs to fail? Maybe it was intended to be a release build version of assert(false)
<heat> i don't understand why they'd make abort() a default function in C, why encourage programs to fail?
<Ermine> heat: that's what my friend which works with such hw said. And he likes rust
<heat> Ermine, yes, but language runtime aside the codegen should be similar, unless rustc really sucks ass at generating llvm IR
<Ermine> probably
<heat> rust however really depends on LTO which is its own set of problems
<nikolapdp> i mean abort() isn't encouraged as the default error handling mechanism in c
<nikolapdp> unlike with panic!() in rust
<heat> okay so what you're thinking is that what tutorials do is automatically great
<mjg> i don't think panic! is encouraged per se
<nikolapdp> no, that's what rust people think
<heat> they .unwrap(), sometimes the .unwrap() goes sideways and it panics
<mjg> unless you mean de facto encouraged as a consequence of unwrap
<nikolapdp> that too
<mjg> which does seem to be common
<heat> you should not unwrap unless you're not ready to deal with the fuck up
<heat> it's like
<heat> int *ptr = malloc(sizeof(int)); *ptr = 10; /* error checking is for wankers */
<Ermine> otoh armclang does wonders when it comes to binary sizes
<Ermine> (also it probably cheats and compresses stuff)
<mjg> concuRustency
<nikolapdp> lol
<heat> conculinuxkernel
<heat> top 10 smp_mb() uses
<Ermine> concix
<heat> hey ermine what memory barrier are you?
<heat> i'm a dma_wmb()
<zid> error checking is infact, for wankers
<zid> all it does it make it harder to debug
<mjg> your girlfriend is smp_rmb() on amd64
<mjg> compiles to nothing LOL
<heat> :(
<heat> you're a big ol meanie aren't you
<sham1> mjg: I thought that the joke would have been about her being shared around
<mjg> i'm not fat
<mjg> otherwise ye
<sham1> But I guess that also works
<mjg> sham1: that's your gf
<heat> this LOSER doesn't know the x86 memory model lol
<heat> get OWNED son
<Ermine> gotta study those barriers
<zid> heat: I'd rather have a crash than have MessageBox("Write error"); return 1;
<zid> returned from main too so I have no fuckin idea
<nikolapdp> zid: asm("ud2");
<bslsk05> ​imgflip.com: They don't know - Imgflip
<zid> nikolapdp: yes pls
<zid> as long as the ud2 is with the code that caused it
<nikolapdp> there, solved your issue with memory checking
<zid> and not a shared global ud2 that is jmp'd to from everywhere
<nikolapdp> you obviously macro it
<nikolapdp> to abort or something
<zid> and pray the compiler
<zid> doesn't merge them all
<zid> nothing's stopping it just emitting jmp abort
<heat> global ud2 is alright
<zid> instead of ud2
<heat> it's as alright as an abort()
<sham1> Surely it would have to be a volatile ud2
<sham1> volatile ask even
<nikolapdp> asm blocks are opaque, it can't merge them
<sham1> ASM
<zid> You might actually have to force inline it
<zid> it can merge the *label* though niko
<nikolapdp> that's why you macro it
<zid> so you'd have to wrap it in an inline tagged func
<nikolapdp> #define abort do { asm ("ud2"); } while (0)
<zid> oh macro func right
<nikolapdp> boom
<zid> yea that'd do I guess
<heat> sham1, TRIVIA: what does smp_wmb compile to, and what does an __atomic_store_n(&var, __ATOMIC_RELEASE) (or smp_store_release) compile to
<heat> on x86
<nikolapdp> there's probably __builtint_debug_trap or whatever
<nikolapdp> if you want portable
<zid> nothing, mov
<heat> __builtin_trap() exists
<mjg> heat: can you smp_rmb(); smp_wmb(); instead of smp_mb()?
<sham1> Yeah, I was under the impression that movs are atomic
<nikolapdp> heat: yeah that one
<heat> smp_wmb compiles to an add $0 to a random stack location
<mjg> smp_wmb?
<sham1> What the hell
<heat> because stores are all happens-before wrt each other
<mjg> smp_mb does
<heat> DID I GET SOMETHING WRONG???
<mjg> 's an optimization over mfence
<mjg> mofer
<heat> wow i did
<nikolapdp> lol
<heat> shit!
<sham1> God damn x86
<mjg> it's a well known optimization to spinlocks to merely mov 0,(%rdi)
<zid> was the answer 'nothing'
<heat> yes
<mjg> which you are probably using
<nikolapdp> isn't smb_wmb a literal noop
<mjg> and now this shit
<zid> I got 100% marks then
<heat> i know the release codegen
<zid> If you said the answer was anything else, I was going to counter with I never defined SMP and I was right anyway, though
<mjg> then you know there is no stock fuckery to it
<nikolar> lol
<mjg> stack
<heat> yes but smp_wmb() != a release store
<mjg> atmic_store above should compile to the a mov and that's it
<mjg> s/the//
<mjg> ignoring the missing value to store to it
<heat> does smp_wmb() just literally guarantee happens-before wrt stores?
<heat> thought it was somewhat stronger
<heat> LKMM am i right
<zid> Magic 8-ball, is heat right?
<zid> It says "Don't ask me you blind fuck, I'm a bowling ball"
<heat> i am always right, even when i'm wrong
<heat> wasn't this an awful political catchphrase in some awful CNN show in the US in the 00s
<mjg> the cpu guarantees the right ordering, you only ask the compiler to not muck with it
<mjg> (here cpu == amd64)
<mjg> now things get funny if you need a full barrier
<mjg> i'm curious why that lock xadd 0 is cheaper than mfence
<mjg> there is probably some stupid internal reason
<mjg> as per usual, optimizations are not always what's logical
<mjg> fuckin ucode
<heat> yes but what i'm asking is
<heat> is smp_wmb() just a release barrier?
<mjg> yes
<Ermine> mjg needs to write spinlocks for onyx
<heat> ok thanks
<heat> no please
<heat> i'm okay
<mjg> :(
<mjg> ok
<mjg> i'm gonna dod them for openbsd
<heat> department of defense?
<mjg> dogs of dogshire
<mjg> did you UNPESSIIMAL your locken though
<heat> not yetten
<Ermine> sometime...
<mjg> i'm lookingat the code now, is is the bare minimum variant
<mjg> you are getting a pass
<heat> do you want me to give you a ticket lock impl
<mjg> 00:14 < mjg> you are getting a pass
<mjg> quit while ahead
<heat> no
<mjg> look mofer
<mjg> if you implement a fair lock and concede onyx mostly runs in a vm
<mjg> you gonna have to make it kvm locking aware
<heat> ugh
<Ermine> kvm locking aware?
<mjg> sounds like you changed your mind
<mjg> Ermine: kick the vcpu holding the lock, if needed
<heat> i don't want to paravirt my whole kernel
<heat> it sounds depressing
<mjg> it is shite work
<mjg> if you want a sliver of more performance add backoff with a small ceiling
<mjg> like literally 16 spins or something
<heat> my big problem isn't lock performance
<heat> it's the locks
<mjg> if you are heavily contended, there is some win to be gained from primitives degrading less
<mjg> mofo
<childlikempress> simply never lock anything
<mjg> childlikempress: wrong, always lock everything
<childlikempress> lockfree all the things
<mjg> childlikempress: except in rust
<heat> i don't want to be heavily contended
<mjg> heat: use linux
<heat> that's the point
<childlikempress> wamjg:
<mjg> childlikempress: rust docs say fearless concurrency and it's all locks
<heat> mjg, can't use linux, i talk to women
<mjg> childlikempress: and you are going to tell me that's slow?
<mjg> fuck you
<mjg> i'm not buyin'
<childlikempress> no time for fear when you're 🎵waiting🎵on🎵locks🎵
<Ermine> chad onyx developer be like
<mjg> OOOH
<zid> nikolapdp: Are you on wet food and dry food or do you just get the dry?
<kof673> goto wamjg;
<mjg> i updated to ubuntu 24 few days back
<heat> i slack off on my actual responsibilities, not my social life
<mjg> i only now noticed utf works in the terminal!
<mjg> i mean random shite like music notes
<heat> mâteuśz guŝik
<mjg> that's a nice improvement
<childlikempress> did you not see any of my emojis before :(
<mjg> childlikempress: nope :(
<Ermine> I installed kde and found a crippling bug
<nikolapdp> i eat food
<childlikempress> i actually put an emoji every few messages😘
<zid> wet or dry though
<heat> 𓂺
* kof673 whispers to nikolapdp, frogs are both wet and dry, amphibious
<childlikempress> 𓂺
<Ermine> also had to modprobe rndis_host to make usb tethering work
<nikolapdp> lol i don't eat frgs
<nikolapdp> rfogs
<mjg> this does not show for me
<Ermine> (Insert another yotld joke here)
<heat> rndis is a vulnerable protocol
<heat> that's probably why you needed to modprobe it
<mjg> rndisecure
<mjg> i thought it got reited
<mjg> even the module
<zid> ^ from sexual advances
<mjg> there was some flame about it
<Ermine> gregkh really wants to retire it, but too many stuff is using it
<mjg> right, it is almost imopssible to retire stuff as long as there is hw for it
<Ermine> But really, what prevents android from using ncm?
<mjg> and vendors love to reuse bad stuff
<heat> zid, watch some girl asking the guy what that cute blowfish is
<heat> followed by a long depressing explanation of openbsd
<nikolar> lol
xal has quit []
<Ermine> how to make girl goth
<mjg> heat: ey, do you have preemption at arbitrary points in the kernel?
<heat> yes
<zid> I made a girl goth once all down my shirt
<mjg> who disbles preemption around spin_lock calls?
<heat> i do
<friedy> you guys are too funny lmao
<zid> heat and mjg are getting married now
<heat> that tends to be what you do with spinlocks
<mjg> ooh i see, i got tricked by trylock doing this in the implementation
<mjg> and the rest happening in header files
<mjg> i mean for the other routines
xal has joined #osdev
<mjg> you should probably assert in __spin_lock that preemption is disbaled
<heat> why
<heat> webdev assert that's what that is
<mjg> no, you document requirements with asserts
<mjg> and should someone break them one day you find out
<heat> the fact that the function starts with a double underscore is a large big warning
<mjg> also note that's not code which would be present in compiled production kernel
<Ermine> I have a feeling that I saw special version of spin_lock which disables prevention. Am I hallucinating?
<heat> large big is a stupid combination
<childlikempress> int x = 5; assert(x == 5)
<mjg> you are linuxing it big time
<heat> Ermine, you are not, i used to have a spin_lock_preempt, bad idea
<heat> note that _irqsave implicitly disables preemption
<childlikempress> spinlock can run with preemption enabled, as a treat
<mjg> yolo_spinlocks
<mjg> i'm gonna publish a paper
<heat> please mommy don't disable preemption please please please mommy i beg you
<heat> i'll be nice
<heat> i won't use all the other threads' timeslices
<childlikempress> https://github.com/Gankra/cargo-mommy this mommy?
<bslsk05> ​Gankra/cargo-mommy - Mommy's here to support you when running cargo~ (46 forks/537 stargazers/Apache-2.0)
<heat> can we get gcc to do that?
<dostoyevsky2> preemption always gets in the way
<childlikempress> gcc please🥺
<mjg> __builtin_unreachable();
<mjg>
<mjg> panic("sched_load_finish returned");
<mjg> you told the compiler to not emit that panic
<mjg> implicitly
<heat> i like how you look at the oldest parts of my kernel
<heat> can you git blame those lines for me?
<Ermine> you can make compiler driver around gcc and make it extensible
<mjg> dude i'm just scrolling through the scheduler
<heat> it's wack
<heat> there, saved you some minutes
<heat> i stole the freebsd loadavg code cuz i didn't get the maths
<mjg> may i recommend:
<mjg> #define __assert_unreachable() \
<mjg> __FILE__, __LINE__, __func__)
<mjg> panic("executing segment marked as unreachable at %s:%d (%s)\n", \
zxrom has quit [Quit: Leaving]
<heat> ubsan does that for me
<mjg> and for non-debug define __assert_unreachable() __builtin_unreachable()
<mjg> well the above would definitely have been avoided
<Ermine> is getting after __builtin_unreachable a UB?
<heat> executing an unreachable is UB
<mjg> the compiler assumes you are NOT going to get there
<heat> well, aktshually __builtin_unreachable() is not UB cuz it's a compiler builtin
<heat> C23 unreachable() is
<mjg> why do you even calculate load
<heat> unix
<mjg> you got your jollies from seeing 'uptime'
<heat> yes
<mjg> understandable
<mjg> geunine question, what's this bit in sched_lock:
<dostoyevsky2> mjg: maybe you want to know why the fans are spinning so much, so the load can help narrow it down
<mjg> unsigned long cpu_flags = spin_lock_irqsave(l);
<mjg> unsigned long _ = spin_lock_irqsave(&thread->lock);
<mjg> (void) _;
goliath has quit [Ping timeout: 245 seconds]
<mjg> dostoyevsky2: in onyx?
<heat> oh god you're looking at sched_lock
<heat> never look at sched_lock
<mjg> what's _
<mjg> looks very perl-y
<heat> _ as unused is pretty common
<heat> RUST uses it too
<mjg> unused what
<mjg> in that code
<clever> haskell as well
<hunta987> python
<Ermine> go
<heat> mjg, what if told you a lot of my scheduler locking is subtly busted
<nikolar> see, heat, the c way to mark something as unused is (void)func();
<heat> (void) _;
<heat> dumbass
<mjg> oh shit, i missed that this is the reutrn value from spin_lock_irqsave
<zid> (void) antibabypillen;
<zid> that's how you get your compiler pergant
<nikolapdp> i meant without assigning it to a variable, dumbass
<mjg> you guys ok
<mjg> so how does your scheduler do compared to ULE
<nikolapdp> he started it :(
<mjg> heat is a genz
<mjg> are you a genz
<nikolapdp> i am a genz
<mjg> oh, in that case carry on
<nikolapdp> lol
<nikolapdp> what did you expect
<zid> my hot genz bf
<mjg> i'm an old fart, osdev is a millenial and boomer game
<heat> mjg, i don't know, poorly?
<mjg> younger folk in the area are pretty rare
<heat> it's functional as in "it runs the things"
<Ermine> 3 genz's agains one boomer?
<nikolapdp> who's the third
<heat> ermie
<Ermine> me
<nikolapdp> let's go
<mjg> 8(
<heat> where
<mjg> you guys should go to discord
<nikolapdp> nah we like boomer stuff clearly
<nikolapdp> osdev, irc
<heat> are you ever going to get a discord?
<heat> or does freebsd not run discord?
<heat> oh wait, you don't use freebsd do you?
<mjg> dude i'm on linux
<mjg> is that a jab because of ULE
<heat> multilayered roast
<heat> no
<mjg> cause as i told you, it is not
<Ermine> you can always open discord in browser
<mjg> i'm openly a linux user
<mjg> :>
<heat> anyway i really need to run kcsan against many parts of my kernel
<heat> the scheduler is one
<Ermine> which is apparently the only option while being in wayland with hidpi display
<mjg> Kentucky Fried Sanitizer
<dostoyevsky2> mjg: Are you writing an OS based on Linux?
<mjg> dostoyevsky2: i'm not writing any os
<mjg> i'm here to take cheap stabs at the few people who do
<nikolar> Ermine: i mean the "desktop" version of discord is a browser in disguise so no much of a difference
<nikolar> except you can actually control the version
<dostoyevsky2> isn't any program an OS in some way?
<Ermine> nikolar: what concerns me is blurriness
<nikolar> what blurrines, no oh hidpi nor wayland so :)
<Ermine> i have both
<heat> dostoyevsky2, not really
<childlikempress> uhhh pretty sure the c way to mark something as unused is /*NOTUSED*/
<heat> mjg, kcsan has limited weak memory emulation where it re-orders writes
<heat> i *really* want to try it
goliath has joined #osdev
<kof673> "any program evolves until it can read email" (paraphrase) </jwz> eventually, if you don't kill it first :D
<Ermine> but if you implement coroutines in you program, poof! and you get cooperative scheduling
<mjg> heat: oh, ncie
<mjg> nice even
<Ermine> childlikempress: it's netbsd way of doing things I guess
<dostoyevsky2> mjg: and onyx is a distributed OS written in clojure? https://github.com/onyx-platform/onyx
<bslsk05> ​onyx-platform/onyx - Distributed, masterless, high performance, fault tolerant data processing (206 forks/2044 stargazers/EPL-1.0)
<Ermine> /* NOTUSED */
<childlikempress> heat: huh how does that work?
<childlikempress> Ermine: it's lint(1)
<Ermine> /* NOTREACHED */
<mjg> dostoyevsky2: ooh, no
Turn_Left has quit [Read error: Connection reset by peer]
<mjg> dostoyevsky2: https://github.com/heatd/Onyx
<bslsk05> ​heatd/Onyx - UNIX-like operating system written in C and C++ (10 forks/76 stargazers/NOASSERTION)
<Ermine> heat: they stole your os name! We must sue them!
<heat> childlikempress, basically i think they keep track of N writes and reads inside a single function and reorders it
xenos1984 has quit [Read error: Connection reset by peer]
<childlikempress> is it just static reordering? or do they maintain a software write queue?
<mjg> i would expect compiler support to reorder things arbitrarily, while respecting all the fences ofc
<nikolar> heat do you just shuffle the writes :P
<mjg> most notably do stores before loads if possible
<nikolar> yeah that too
<childlikempress> mjg: if you don't maintain a software write queue then 1) there will be certain reorderings you can't perform and 2) you always get the same order
<childlikempress> vs being able to do a random order every time you run the code
<mjg> i was thinking you quickly compile a bunch of kernels and crashtest them in qemu
<mjg> while only mucking with the code you are changing, so the cycle should be faster
<bslsk05> ​docs.kernel.org: Kernel Concurrency Sanitizer (KCSAN) — The Linux Kernel documentation
<bslsk05> ​docs.kernel.org: Kernel Concurrency Sanitizer (KCSAN) — The Linux Kernel documentation
<mjg> but now that i said it, perhaps an emulated qemu cpu could fuck with it?
<mjg> it could pretend to be ppc or something on that front
<childlikempress> ohh cool
<heat> it turns the google people
<childlikempress> so basically it is a queue but only one element
raphaelsc has quit [Remote host closed the connection]
<heat> they know some stuff eh
<heat> turns out*
<heat> ktsan is the superior option but hard to pull off in a kernel setting
<heat> much less a kernel with a custom memory model
<heat> ktsan could find you all of the problems
<netbsduser> i could use one of these so-called "sanitisers"
<childlikempress> just one?
<heat> i'm collecting them all
<heat> Ermine, WRITE A KMSAN IMPLEMENTATION NOW
<heat> THE ONYX PROJECT NEEDS YOUR HELP!
<netbsduser> have just integrated some pleasant work to partially free up certain parts of the sync/waiting interfaces from locking, and it would be helpful if one of these "sanitisers" could help assure me of no raciness
<dostoyevsky2> netbsduser: OpenBSD might have them all activated by default
<netbsduser> dostoyevsky2: impossible
<heat> that would be funny but the compiler can only activate a very small subset at a time
<netbsduser> i tried one of the "sanitisers" in userland, i think it was address-san or memory-san - i forgot which, stupid names - and it adds a massive performance penalty
<heat> not that massive
<Ermine> heat: I gotta defend my diploma on Thursday
<netbsduser> i've also used the kaddress-san once, i didn't do a proper implementation, i just got it to help me out with looking at certain addresses
<heat> ASAN (particularly inlined!) is usable
<heat> 2x slower maybe, but still usable
<netbsduser> oh, that's nothing
<netbsduser> i get a worse penalty from an O0 build and without that you can't debug at all
<heat> sure i can
<heat> i debug with -O2 on
<Ermine> after that I'll do something on onyx
zetef has quit [Remote host closed the connection]
<netbsduser> i like to be able to see my variables not gdb whining "{optimised out}"
<heat> that is annoying but most of them are okay
<nikolapdp> Ermine good luck
<Ermine> thx
<nikolapdp> how do you defend your diploma
<heat> good luck!
<netbsduser> sometimes you can identify where you want to find out about the contents of a variable and insert a printf there so you can see it despite gdb's pretensions but it's a bit of a time sink
<netbsduser> yes good luck Ermine
<dostoyevsky2> netbsduser: Or maybe write the OS in Rust? I think that should cover a lot of sanitation
<Ermine> thank you heat and netbsduser
<netbsduser> nikolapdp: by a viva, you have to hold your ground in front of a panel of experts grilling you
<netbsduser> dostoyevsky2: rust cannot even capture half of the tricks i employ
<netbsduser> and i have more in the pipeline
zetef has joined #osdev
<nikolapdp> what do they grill you about
<nikolapdp> rust is really overrated
<netbsduser> for example i will be depending on certain objects which have reached their end-of-life but are still accessible in certain cases maintaining type stability for a grace period (this will be an RCU use)
<Ermine> nikolapdp: about literally everything
<nikolapdp> kek
<Ermine> "Your title page is shite"
<Ermine> "Your references list is shite"
<dostoyevsky2> nikolapdp: I guess if you wanted to use Rust for an OS without unsafe, you'd have to copy data a lot... or invent some phantom pointers for avoiding circular data structures
<Ermine> "Your topic is off-topic in our department"
<netbsduser> rust is very good at enforcing the conventional but in a kernel (and i imagine this applies to other software which has to employ every trick in the book, like database engines) you aren't dealing in the conventional anymore
<heat> rcu is hard to express in rust's type system yeah
<heat> we'll see how that unfolds
xenos1984 has joined #osdev
<heat> worst case unsafe {} with a large big comment
<heat> whts up with me and large big today
<nikolapdp> might as well use c then
<heat> what
<nikolapdp> > worst case unsafe {} with a large big comment
<heat> "rust gets you wins but sometimes it doesn't fit the bill and you need to go manual"
<heat> "might as well use C then!"
<nikolapdp> indeed
<dostoyevsky2> just make your fn main() unsafe... then you have one localized unsafe :)
<heat> does it need to solve all the problems for you to use it?
<heat> because C solves none of them
<kof673> nikolapdp, https://0x0.st/s/viVQXnwb0PZ-KeaVUV7ZdA/Hd-h.jpg there is *a* green frog in the middle, both wet and dry...then it turns to dry land supposedly so you may cross at the equinox lol
<kof673> (they might use another frog earlier)
zetef has quit [Remote host closed the connection]
<dostoyevsky2> kof673: is that the loading screen of your OS?
Fingel has quit [Quit: Fingel]
<gog> hi
<heat> woah gog hi
<heat> you just missed a heated conversation about zig
<nikolapdp> hello gog
<gog> i'm over zig
<nikolapdp> zig??
<nikolapdp> i missed that discussion too
<heat> oh you're over zig?
<heat> are you a hare stan now?
<nikolapdp> yes, we stan hare here
<heat> i stan nim
<hunta987> im a nimwit
<kof673> dostoyevsky, i thought about an ouroborus lol
<dostoyevsky2> kof673: like an infinite loading screen
<dostoyevsky2> I wonder if one could write an OS that just displays https://www.youtube.com/watch?v=qItugh-fFgg in a loop on a weekend... But must be written in Zig ofc
<bslsk05> ​'All Your Base Are Belong To Us' by zuchini (00:04:21)
<Ermine> embed this video, write a decoder, and get frames on the screen with GOP's BitBlt
<kof673> well i want something like synthesis but c89...jitty
<kof673> *synthesis os was
<nikolapdp> tcc
<dostoyevsky2> Ermine: I guess I could just embed an existing video decoder + the video data... but not sure how to play the sound...
<nikolapdp> pcspkr :)
<hunta987> with a fast timer you can get "good" sound from the pc speaker
<hunta987> clockrate
<dostoyevsky2> could an OS just ask the bios for some hardware address (dma or the like) where one could draw graphics and play sound?
<childlikempress> tcc is awful codegen
<Ermine> yes, use VESA and you get framebuffer
<gog> isn't it connected directly to channel 2 of the PIT?
<gog> on ibm compat ig
<nikolapdp> childlikempress: but it can jit :)
<gog> you're PWMing pretty hard and it's cpu-bound
<Ermine> or GOP on EFI systems, and you can get framebuffer
<childlikempress> nikolapdp: luajit a nice ~pareto-optimal point with actually decent codegen
<geist> driving the PC speaker to simulate some sort of DAC style playback is tricky but i assume it's a solved problem
<geist> though it may take a lot of cpu time
<acidx> it's not that hard!
<Ermine> for anything better than pc speaker you need to drive a sound card
<acidx> have to jig the PIT to drive the speaker
<Ermine> (hda driver would suffice I guess)
<clever> geist: i lost it decades ago, but i had a win95 driver, that would bit-bang the speaker to play wave files, and it had an option to improve quality, by turning IRQ's off, lol
<acidx> last time I did this I had a ring buffer that would be consumed in an ISR
<gog> the pit is running at like 1.4mhz or something right
<geist> yah but to constantly reprogram it to play back a PCM sound file i assume involves some sort of transformation
<clever> windows saw it as a pcm based sound card, so you could then play audio in any app
<nikolapdp> childlikempress: you've just remineded me that i should look into it
<geist> or di you just whack the PIT to tick it once?
<dostoyevsky2> Ermine: I guess one could let qemu simualte a sound card where you can just stream some wav the same way one could stream the video via framebuffer?
<zid> are you talking about people's windows again nikolapdp
<nikolapdp> no zid
<zid> pokémon yellow does this btw
<Ermine> dostoyevsky2: tbh i don't know how audio hardware works
<acidx> here's some code I wrote for a ms-dos/real mode game some friends were working on: https://github.com/lpereira/Mines/commit/089dc8ecfaa37da5e1701b86d82a97adec4b9645
<bslsk05> ​github.com: [MS-DOS] Preliminary audio support using PC-Speaker · lpereira/Mines@089dc8e · GitHub
<zid> it bit bangs 1bit audio into one of the channels with interrupts off to make pikachu say "Pikachu" in horrible aliased noise :D
<clever> :D
<gog> there's no small amount of psychoacoustics to make it work
<acidx> (the code that's there will just play some white noise, I didn't push the finished MOD player to github)
<gog> like whats the minimum interval before it doesn't sound like a tone of x Hz anymore
<geist> hmm ` outb(0x42, sample >> 1);` is that the trick?
<dostoyevsky2> Ermine: I guess the easiest audio APIs where like: just beeping for a given length, then they added pitch and volume... but they didn't have streaming yet, so then came synthesizers, where you can model a waveform... and eventually you play full samples, like wav files
<geist> loading 7 bits of the sample as some sort of counter or whatnot?
navi has quit [Ping timeout: 268 seconds]
<geist> acidx: so i see it setting up the counter at 16khz and then feeding noise into it, what's the mechanism for the data getting fed in on that line?
<geist> does the timer shift it out?
<acidx> geist: the code that's there doesn't do it, it was just the initial commit. I didn't push the new code as it was crashing somewhere and I didn't have time to fix it. but the idea was essentially a ring buffer that was consumed by the ISR and populated by code outside the ISR
<acidx> all the mixing and whatnot happened outside the ISR
<geist> yeah but the key is that 'play sample' routine. it loads it into a register
<geist> what is the mechamism by which that twiddles the speaker?
<geist> (i'd read the comments on what you're programming the timer as but you didn't write any :)
<acidx> the previous write to 0x43 will change how the next two bytes will be interpreted https://web.archive.org/web/20080201210533/gd.tuwien.ac.at/languages/c/programming-bbrown/advcw3.htm#sound
<bslsk05> ​web.archive.org: Advanced C, part 3 of 3
<geist> ah that's what i was looking for, thanks