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
gog has quit []
Arthuria has quit [Ping timeout: 260 seconds]
gog has joined #osdev
Burgundy has quit [Ping timeout: 268 seconds]
jess has quit []
mimmy_ has joined #osdev
mimmy_ has quit [Ping timeout: 268 seconds]
<klange> Something I've done in my graphics stack, or something that changed in VBox, is annoying me... I seem to not get the initial message I used to get to switch the display mode... I think it might be from modesetting in my bootloader.
<klange> But it's annoying, because I start up in, like, 1024x768 because that's a suitable resolution VESA advertises and then... it just sits there.
<klange> Used to be I would have a pending message from the host-guest interface and it would snap to the right resolution from, like, a mouse interrupt.
<klange> I should update to the newer interface, I wrote this against the legacy one and it nags in the log every time.
dutch has quit [Quit: WeeChat 3.3]
pretty_dumm_guy has quit [Quit: WeeChat 3.3]
dutch has joined #osdev
srjek_ has quit [Ping timeout: 260 seconds]
mimmy_ has joined #osdev
mimmy has joined #osdev
mimmy has quit [Client Quit]
mimmy_ has quit [Ping timeout: 250 seconds]
wikan has joined #osdev
dutch has quit [Quit: WeeChat 3.3]
nyah has quit [Ping timeout: 250 seconds]
isaacwoods has quit [Quit: WeeChat 3.3]
xhrzg2017_ has joined #osdev
dutch has joined #osdev
xhrzg2017_ has quit [Quit: Leaving]
xhrzg2017_ has joined #osdev
xhrzg2017_ has quit [Client Quit]
<klys_> I've been asking about something in #qemu just it seems mebby nobody's there
<klys_> looks like this is the file I want modified: https://gitlab.com/qemu-project/qemu/-/blob/master/qemu-options.hx#L1281
<bslsk05> ​gitlab.com: qemu-options.hx · master · QEMU / QEMU · GitLab
<klys_> the modification would be to add physical and logical drive geometry options cyls, heads, secs, lcyls, lheads, lsecs.
xhrzg2017 has joined #osdev
xhrzg2017 has left #osdev [#osdev]
xhrzg2017 has joined #osdev
xhrzg2017 has left #osdev [#osdev]
xhrzg2017 has joined #osdev
xhrzg2017 has left #osdev [#osdev]
<bslsk05> ​github.com: qemu/qdev-device-use.txt at master · qemu/qemu · GitHub
xhrzg2017 has joined #osdev
<klys_> and it looks like that's on gitlab too
xhrzg2017 has left #osdev [#osdev]
xhrzg2017 has joined #osdev
xhrzg2017 has left #osdev [#osdev]
wikan has quit [Quit: Client closed]
dude12312414 has joined #osdev
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
mahmutov_ has joined #osdev
mahmutov_ has quit [Ping timeout: 260 seconds]
Oli has quit [Quit: leaving]
[itchyjunk] has quit [Remote host closed the connection]
<geist> klys_: yeah the qemu channel doesnt seem that busy does it
<moon-child> optimization I never knew I wanted: compiler should know to convert memmove(x, x + i, 64 - i) into memmove_asc_small(...)
Bitweasil has quit [*.net *.split]
z_is_stimky_ has quit [*.net *.split]
mcfrdy has quit [*.net *.split]
nickster has quit [*.net *.split]
Ermine has quit [*.net *.split]
j`ey has quit [*.net *.split]
puck has quit [*.net *.split]
Stary has quit [*.net *.split]
Emil has quit [*.net *.split]
<geist> i've been fighting addresses-of-fields-of-packed-structs
j`ey has joined #osdev
Emil has joined #osdev
valerius_ is now known as valerius
<geist> compiler really really dissuades you from doing that
z_is_stimky has joined #osdev
Bitweasil has joined #osdev
nickster has joined #osdev
Ermine has joined #osdev
mcfrdy has joined #osdev
puck has joined #osdev
Stary has joined #osdev
kori has quit [*.net *.split]
Celelibi has quit [*.net *.split]
GreaseMonkey has quit [*.net *.split]
nshp has quit [*.net *.split]
raggi has quit [*.net *.split]
bslsk05 has quit [*.net *.split]
corecode has quit [*.net *.split]
froggey has quit [*.net *.split]
vancz has quit [*.net *.split]
les has quit [*.net *.split]
valerius has quit [*.net *.split]
Amanieu has quit [*.net *.split]
lanodan has quit [*.net *.split]
mrkajetanp has quit [*.net *.split]
ElementW has quit [*.net *.split]
remexre has quit [*.net *.split]
Retr0id has quit [*.net *.split]
kanzure has quit [*.net *.split]
woky_ has quit [*.net *.split]
andrewrk has quit [*.net *.split]
sauce has quit [*.net *.split]
raggi has joined #osdev
sauce has joined #osdev
les has joined #osdev
ElementW has joined #osdev
froggey has joined #osdev
remexre has joined #osdev
Amanieu has joined #osdev
vancz has joined #osdev
corecode has joined #osdev
andrewrk has joined #osdev
woky has joined #osdev
arahael has joined #osdev
bslsk05 has joined #osdev
mrkajetanp has joined #osdev
GreaseMonkey has joined #osdev
Celelibi has joined #osdev
kanzure has joined #osdev
<pounce> klys_: #qemu is on oftc, libera channel isn't very busy
bauen1 has quit [Ping timeout: 256 seconds]
<klys_> pounce, yeah I was doing oftc #qemu today
<pounce> oh sorry i haven't been in there long bouncer died
<klys_> my nick there is klysmo
ElectronApps has joined #osdev
diamondbond has joined #osdev
bauen1 has joined #osdev
<geist> i forget, whoever has dealt with pci before, is it incredibly important to read pci config registers in the right width?
<geist> i can imagine writing it almost certainly is
<zid> it says it is
<zid> whether the device controllers give a shit idk
<geist> yah i just replaced my routine that reads pci config space in a byte at a time with one that reads in all the fields in the correct width
<zid> I think you can combine on the 16s
<zid> err that is, two 8s
<geist> i'm guessing it's basically up to the device, but the spec says the device can be dumb and not handle sub field read/writes
<geist> and of course emulators probably generally speaking work fine with bytewise access
<zid> matching the size defo seems safest, and it's not performance or code density critical so whatever
<geist> oh totally
<geist> second question: i assume big endian machines have to deal with the implicit LE order? or... maybe they dont, because it's assumed you access fields with the correct width
<zid> hmm?
<zid> oh hmm
<zid> I guess if it's a 16bit 'char' for that field, there's no endian
<zid> but I don't think that's the case
<zid> I think it's byte addressable
<zid> and whether it allows combining up to 16/32/64/etc is up to the device
<geist> yah and if so then what's the endian order a pci config space?
<geist> i can imagine if the spec says 'the fields must be accessed in native sizes' then it can also appropriate swizzle based on the host cpu endianness
<zid> so if you read anything using wide reads it's going to be backwards on BE
<geist> since the pci bus controller presumably knows that
<zid> it's not swizzled
<geist> and if so that may be precisely why you're supposed to access them inthe native size
<zid> random quote from google cache of osdev, good job google
<zid> "PCI devices are inherently little-endian, meaning all multiple byte fields have the least significant values at the lower addresses. This requires a big-endian processor, such as a Power PC, to perform the proper byte-swapping of data read from or written to the PCI device, including any accesses to the Configuration Address Space. "
<geist> word.
<geist> intel definitely had their hand in it, so i guess at that point in time they pushed for LE
<zid> LE makes the most sense anyway, BE can die
<geist> i can't easily test it anyway since none of the BE arches i have ported to have a machine with PCI i can test on
<geist> unless i make a BE build of ARM or something
<geist> which, meh.
<zid> At any case, it's just 'ram' which.. becomes even more apparent when you use pci-e
<zid> where it's memory mapped but still identical
<zid> so you'll need to le_to_host it all if you do multi-byte reads
<geist> yah or you can consider it a big pile of MMIO registers that the device exports
<geist> i have seen some situations where the bus swizzles the data to the device based on the access width, since it knows the endian of the machine
<geist> i think there was some of that on playstation 3 for example, since the PPC/SPU cpus were big endian and the NV47 GPU was mostly little endian
<zid> I do all my reads as 32bit
<zid> then shift them around depending on the 'offset' I think
<geist> lots of swizzling in the textures and whatnot
the_lanetly_052 has joined #osdev
<zid> addr = ENABLE | bus<<16 | device<<11 | func<<8 | (offset&0xFC); out(CONFIG_ADDR, addr); data = in(DATA_ADDRA); if(offset & 2) data >>= 16;
<zid> I don't remember *why* I do this though :D
<zid> oh because register offset must be xxxxxx00 maybe
<zid> so infact I had it backwards, and you *must* do 32bit reads?
<zid> The PCI pdf probably says all this, but I don't have one
<geist> hmm, for type 1 accesses, yeah i guess that's right?
<geist> ie, via the in/out access method?
<zid> yea, idk if you *can't* do that, for pci, it isn't memory mapped until pci-e
xenos1984 has quit [Quit: Leaving.]
<geist> but writes, do you have to do a RMW if you want to just piddle with 8 bits? (I haven't iomplemented that for type 1 accesses)
<zid> I imagine so? There address selection is agnostic to reads or writes
<zid> s/There/the
<zid> You're still doing out32(CONFIG_ADDR, ...); regardless of reading or writing
<zid> and that's the part that masks the bottom 2 bits as 0
<zid> so you can only select dword aligned addresses, so a rmw might be needed (or you just keep a local copy and keep it in sync, but you're not an idiot so idk why I typed this bit)
<zid> I don't have code for it, the only writes I do are 32bit for the BARs
<geist> oh i dunno, i mean i could look this up
<geist> but it seems like a nice topic
<zid> oh the command reg is 16 I do touch that.. I wonder what's next to it..
<zid> ah, status
<zid> I imagine writing to those doesn't matter
<geist> but yeah looks like the type 1 config accessor is definitely 32bits at a time, in aligned 32bits so
<zid> 32bit write to BAR, 32bit write to status | command
<geist> yah possibly they carefully arranged it such that bits you write to are always shared with bytes that dont latch on write
<geist> cleeeever
<zid> The other one you might wanna mess with is the bridge control | int pin | int line one
<geist> or a bunch of 8 bit fields you want to write all at once
<geist> ah also notice the capabilities pointer is not shared with anything
<zid> so just treat that as one big field I guess
<zid> bridge_pin_line
<geist> though i guess yo never write to that
<geist> so i gues that begs the question: with pci-e are you always supposed to read the ECAM in 32bit offsets
<geist> or more importantly: write to it in units of 32bits
<geist> probably no, but it does beg the question as to what happens if you have a PCI device on a PCI-to-PCIE bridge and you access its config in 8 bit intervals
<zid> I think pci-e is flexibable because the bus acts like memory and they have to support 'the pci-e bus'
<geist> and it was previously never accessable that way
<zid> hmm yea that's a good one
<zid> I wonder if the bridge has to split/combing
<geist> right
<zid> orr the pci-e bridge just has to be treated like a bridge, and you have to use its interface to issue pci writes, and it's specified the same way as pci was
<zid> like, there's just an mmio reg on the pci-e device that is the bridge, which implements 0xCF8 and 0xCFC or whatever, and says 'do it like pci'
diamondbond has quit [Ping timeout: 268 seconds]
<zid> found a random TI pci-e to pci bridge chip's doc, it just says "this device acts like a pci to pci bridge type 1"
<zid> And I think the spec for that says there's a register that's 0 if 16bit io is supported, 1 if 32bit
<zid> yea header type 0x1, pci-to-pci bridge, pci reg 0xC (offset 0x30)
<geist> nice
eau has quit [Ping timeout: 260 seconds]
eau has joined #osdev
immibis has quit [Ping timeout: 256 seconds]
eau has quit [Client Quit]
eau has joined #osdev
Benjojo has quit [Ping timeout: 260 seconds]
kazinsal_ has joined #osdev
mxshift has quit [Ping timeout: 260 seconds]
paulbarker has quit [Ping timeout: 268 seconds]
kazinsal has quit [Ping timeout: 268 seconds]
nohit has quit [Ping timeout: 268 seconds]
seds has quit [Ping timeout: 268 seconds]
kazinsal_ is now known as kazinsal
paulbarker_ has joined #osdev
geist_ has joined #osdev
geist has quit [Ping timeout: 260 seconds]
geist_ is now known as geist
nohit has joined #osdev
seds has joined #osdev
Benjojo has joined #osdev
mxshift has joined #osdev
<klange> I just want to say that the Shell Command Language specification in POSIX is by far the worst language specification it has ever been displeasure to place in front of my eye balls.
<zid> geist: made in abyss s2 (3rd part, with the movie) has preview visuals being released :o it's coomiiing
<geist> oooh
<geist> klange: is that basically a spec for sh?
<kazinsal> seems to be yeah
<kazinsal> quite thorough
<bslsk05> ​pubs.opengroup.org: Shell Command Language
<klange> it is _the_ spec for sh, and it is an astounding feat of non-linear storytelling
<moon-child> I just saw
<moon-child> somebody implementing the visitor pattern. In _C_
<zid> I don't even know what that is, my soul is untarnished
<moon-child> zid: I envy you
<zid> The wikipedia example is like "A naive way would be *perfectly reasonable way to do it*"
<zid> as though functions can't exist
<klange> I do know what that is, but I do not feel unnerved.
<kazinsal> one of those enterprise programming paradigms where everything is a ClassInitiatorProviderFactoryFactory
<zid> yea it definitely looks like "We don't understand how to write code in the first place, so this is one of the hacks we came up with"
<moon-child> I mean, it kinda makes sense given you're already using java. In c I have no idea why you would want it
<zid> Moving operations into visitor classes is beneficial when
<zid> many unrelated operations on an object structure are required,
<zid> Also known as "functions accepting pointers"
<zid> "new operations need to be added frequently" also known as "functions accepting pointers"
<zid> etc
<klange> Ignore the class aspect for a moment; is the visitor pattern not evident in functions like qsort? It is about implementing algorithms in ways which may accept various objects, and about implementing the type-specific functionality without extending the particular types.
<kazinsal> it makes sense when your productivity is purely judged by lines of code
<moon-child> I don't think using function pointers constitutes visitor pattern. It's the weird inversion of control and the large amounts of boilerplate
<zid> qsort being well known to be absolutely awful
<kazinsal> when you need 50 lines of boilerplate per each actual operation line...
<zid> "A drawback to this pattern, however, is that it makes extensions to the class hierarchy more difficult, as new classes typically require a new visit method to be added to each visitor. "
<zid> It'd be like if you had to add a qsort comparitor function for every single type, by the sounds of it
bauen1 has quit [Ping timeout: 264 seconds]
<zid> as soon as you started using qsort anywhere in your code
<klange> No, just for anything that would be sortable.
<zid> which is anything, potentially
<klange> The alternative to the visitor pattern is to have common class functions - eg. interfaces.
<moon-child> klange: qsort isn't ISortable, it's parametric polymorphism. It's just that they both look like void* in c
bauen1 has joined #osdev
<kazinsal> dog bless the language that forces us all to double-check our every move
<zid> If my pointers ever look like `void* ` you can shoot me btw
<moon-child> qsort :: [a] -> (a -> int) -> [a]
<kazinsal> if I need something resembling polymorphism in C I use anonymous member structs with plan9-extensions
<zid> okay I found an easy code example for it, it looks *exactly* like adding a common interface to a set of objects
<klange> tagged unions
<zid> but with a stupid name
<zid> and an extra function to call all of them
<klange> zid: The visitor pattern is, rather literally, implementing a common interface separately from the classes.
<kazinsal> eg. all of my interface types start with an anonymous net_generic_t; so you can send a specific interface to any function that takes a net_generic_t and also so any change to net_generic_t automatically propagates to each interface struct
<klange> For example, say you want to write a JSON serializer. You _could_ add an interface, an "IJSONSerializeable" or whatever, and implement the method across all the classes you want to serialize...
<zid> I don't know what any of that means ^
bauen1 has quit [Ping timeout: 264 seconds]
<klange> The visitor pattern is for hot-patching an interface onto things that didn't implement it.
bauen1 has joined #osdev
<zid> I mean, that just sounds.. completely normal?
<zid> If I want to know about how many otters my 'class' (read: .c file) has captured, I add a function to tell me
Burgundy has joined #osdev
<moon-child> zid: open-world assumption
<zid> pardun
xenos1984 has joined #osdev
xenos1984 has quit [Ping timeout: 250 seconds]
xenos1984 has joined #osdev
stultusv has joined #osdev
gog has quit [Quit: byee]
xenos1984 has quit [Ping timeout: 250 seconds]
gog has joined #osdev
the_lanetly_052 has quit [Ping timeout: 245 seconds]
c2a1 has quit [Quit: AndroIRC - Android IRC Client ( http://www.androirc.com )]
mctpyt has quit [Ping timeout: 256 seconds]
<stultusv> bochs loops between f000:e05b and f000:fff0, never reaches 0x7c00... What might cause this?
lanodan has joined #osdev
xenos1984 has joined #osdev
mctpyt has joined #osdev
X-Scale` has joined #osdev
X-Scale has quit [Ping timeout: 268 seconds]
X-Scale` is now known as X-Scale
bauen1 has quit [Ping timeout: 245 seconds]
bauen1 has joined #osdev
gog has quit []
gog has joined #osdev
auronandace has joined #osdev
wleslie has quit [Quit: ~~~ Crash in JIT!]
bauen1 has quit [Ping timeout: 245 seconds]
<j`ey> if I have .text : AT(0xXXXXXX), should I see my text section at XXXXX when I objdump?
<j`ey> or does objdump default to address 0
<gog> AT() only sets the physical address hint i think
<gog> objdump cares about the virtual address afaik
<j`ey> ah
<zid> lma, rather than phys
<zid> .section VMA : AT(LMA) { . == VMA } >append_to_VMA AT>append_to_lma
dutch has quit [Quit: WeeChat 3.3]
bauen1 has joined #osdev
bauen1 has quit [Ping timeout: 264 seconds]
Oli has joined #osdev
V has quit [Remote host closed the connection]
V has joined #osdev
dutch has joined #osdev
bauen1 has joined #osdev
nyah has joined #osdev
bauen1 has quit [Ping timeout: 250 seconds]
[itchyjunk] has joined #osdev
bauen1 has joined #osdev
wille has quit [Quit: Ping timeout (120 seconds)]
wille has joined #osdev
srjek_ has joined #osdev
GeDaMo has joined #osdev
dennis95 has joined #osdev
wikan has joined #osdev
xenos1984 has quit [Quit: Leaving.]
sprock has quit [Ping timeout: 256 seconds]
dude12312414 has joined #osdev
dude12312414 has quit [Remote host closed the connection]
pretty_dumm_guy has joined #osdev
ElectronApps has quit [Remote host closed the connection]
wikan has quit [Quit: Client closed]
xenos1984 has joined #osdev
wikan has joined #osdev
mahmutov_ has joined #osdev
sprock has joined #osdev
dennis95 has quit [Quit: Leaving]
wikan has quit [Quit: Client closed]
nvmd has joined #osdev
dude12312414 has joined #osdev
gog has quit []
gog has joined #osdev
sprock has quit [Ping timeout: 268 seconds]
vdamewood has joined #osdev
Arthuria has joined #osdev
lkronnus has quit [Read error: Connection reset by peer]
nyah has quit [Remote host closed the connection]
nyah has joined #osdev
srjek_ has quit [Ping timeout: 264 seconds]
jeaye has quit [*.net *.split]
ravish0007 has quit [*.net *.split]
opios2 has quit [*.net *.split]
ravish0007 has joined #osdev
jeaye has joined #osdev
kori has joined #osdev
mahmutov_ has quit [Ping timeout: 245 seconds]
kuler has joined #osdev
mahmutov has joined #osdev
<kingoffrance> re: visitor pattern wikipedia emphasizes double dispatch. https://en.wikipedia.org/wiki/Double_dispatch there is a silly ruby example there. all that is just to say: i think if you had <thing to do, e.g. qsort()> <comparison function> one more layer of indirection on top of qsort, that would be closer
<bslsk05> ​en.wikipedia.org: Double dispatch - Wikipedia
<kingoffrance> not advocating either way, just seems one level above qsort if one was to make that comparison (no pun)
mctpyt has quit [Ping timeout: 250 seconds]
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
<kingoffrance> or, alternately, qsort invoked with a chain of comparison functions (to break ties, something beyond single level, single comparison function). I believe that would also be closer
friedy10 has joined #osdev
GeDaMo has quit [Remote host closed the connection]
c2a1 has joined #osdev
sprock has joined #osdev
nvmd has quit [Quit: Later, nerds.]
X-Scale` has joined #osdev
X-Scale has quit [Ping timeout: 250 seconds]
X-Scale` is now known as X-Scale
srjek_ has joined #osdev
sprock has quit [Ping timeout: 264 seconds]
mahmutov has quit [Ping timeout: 245 seconds]
vdamewood has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
immibis has joined #osdev
<immibis> Mutabah: yes. see also: how to make artificial general intelligence (1) recognize MNIST digits (2) make the rest of the (fucking) intelligence
* Mutabah is away (Sleep)
<immibis> i'm pretty sure the instructions have to contain the word "fucking"
<immibis> how to write any program: (1) write hello world (2) write the rest of the (fucking) program
<immibis> i think in osdev the (1) is an GDT and IDT
<geist> haha
<rustyy> TIL about queued spinlocks, i feel pretty good =)
<kazinsal> if your OS doesn't spontaneously crash after 24 hours of uptime, you can move onto the "write the rest of the fucking operating system" stage
dude12312414 has joined #osdev
<klange> 24 hours is easy; the real benchmark is when you've forgotten a VM running on another workspace for three weeks and you find the clock still ticking.
vdamewood has joined #osdev
c2a1 has quit [Ping timeout: 245 seconds]
vdamewood has quit [Ping timeout: 264 seconds]
vinleod has joined #osdev
vinleod is now known as vdamewood
<kazinsal> and it's still switching packets like a champ
<geist> rustyy: ooooh
<geist> do tell!
Burgundy has quit [Ping timeout: 245 seconds]
<kingoffrance> thats almost Schrödinger ...if a server is buried in a wall and people forgot it exists, is it still routing packets? have to open it up and see
srjek|home has joined #osdev
srjek_ has quit [Ping timeout: 264 seconds]
<geist> so easy with wifi too. you can easily forget you had some raspberry pi on the network somewhere
<geist> or one that's embedded in some other thing
* gog embeds a rasbperry pi into herself
<gog> am borg
* gog assimilates the channel
freakazoid12345 has quit [Read error: Connection reset by peer]
<vdamewood> We are dyslexic of Borg. Prepare to have your ass laminated.
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
sprock has joined #osdev