<gog>
i spent about 40 minutes wondering why this action was getting the wrong data from the view and it turns out i had the field names wrong
<gog>
loose coupling is a great idea in theory
<zid`>
I've been home all day and I want to stay here
<zid`>
gog: Someone should invent some sort of tag for variables that tells you what sort of data lives in them, so that you can get some simple compile time checking for if the data seems sane for that usage
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
<FireFly>
sakasama: mood
<gog>
those exist, but in this case i can't use the tag helper
<gog>
because legacy reason
<gog>
maybe i should fix that while i'm at it
<gog>
idk how much that's gonna creep the task though
<FireFly>
I think it was a reference to type systems :p
<FireFly>
at least my reading
<gog>
i mean it is a type system in this case, the view is strongly typed and it's a good idea to use the tag helpers becuase they will enforce the type and check the model to see if the property exists
<gog>
but there's a jquery plugin that doesn't play nice with the tag helpers
<heat>
gog wanna write sea
<heat>
hekc even sea sharp
<gog>
i'm writing c# rn
<gog>
i'm no longer a programmer
<heat>
are u compiler
<gog>
no
<gog>
i'm a web developer
<zid`>
I am write C pls heat
goliath has joined #osdev
vdamewood has quit [Remote host closed the connection]
mrvn has joined #osdev
vdamewood has joined #osdev
linear_cannon has joined #osdev
bauen1 has joined #osdev
xenos1984 has quit [Ping timeout: 246 seconds]
xenos1984 has joined #osdev
bauen1 has quit [Ping timeout: 240 seconds]
slidercrank has joined #osdev
<gaze___>
So I was just thinking. If I want to hide and take over an Ethernet card, why do I need to use VT-d and IOMMU? If it’s a rootkit-like thing, why not just leave everything identity mapped?
<gaze___>
And I don’t really understand DMA on x86 but my impression is that the hardware just bus masters
<gaze___>
So everyone is responsible for its own DMA
goliath has quit [Quit: SIGSEGV]
<gaze___>
(Not actually writing a root kit!)
<gog>
the CPU has to set up the transaction and provide the buffer in memory for the device to use
<gog>
but yeah then the hardware bus masters
<zid`>
you need to hide it to stop the host OS initializing it.. again
<zid`>
and trying to use it
<gaze___>
Is it initialized centrally?
<gog>
the IOMMU makes it such that you don't need to either provide a contiguous buffer in linear space or use scatter/gather
<gaze___>
Yeah yeah what I’m saying is if the VMM leaves everything identity mapped what’s the problem? What indirection is really necessary?
<gaze___>
But ok if the host is going to try and reinitialize some centralized thing that presents an issue certainly
<zid`>
I'm not sure what device hiding and 'vmm' have to do with each other
<gaze___>
I hope I’m using the right terminology. When I say vmm I mean the monitor/hypervisor
<zid`>
ah *that* vmm, the awful one with 4 other meanings
<zid`>
the business term
goliath has joined #osdev
<zid`>
not the technical term
<gog>
the guest system still needs a memory space to do DMA with the device
<gaze___>
What’s the technical term?
<zid`>
I mean, what you just said, the hypervisor
<gaze___>
Ok hypervisor it is then. But yes, it needs memory space and can have it. It sees bare memory.
<zid`>
"Why do I need a hypervisor to hide a device?" is ultimately your question then?
vdamewood has quit [Remote host closed the connection]
<gaze___>
Mmmm yes.
<gaze___>
Wait no!
<zid`>
Because.. that's the mechanism that the cpu provides to enable it?
<zid`>
Otherwise it'd be impossible.
<gaze___>
What I mean is why do I need vtd and the iommu
<gaze___>
If the hypervisor identity maps
<zid`>
because vtd is the tech that implements hypervisors
vdamewood has joined #osdev
<zid`>
and the iommu is the memory controller version of a hypervisor
<gog>
because the guest system doesn't have the actual physical space
<gog>
it sees what the hypervisor configures it to see
<zid`>
The idea of 'devide hiding' is that you need to *somehow* decouple writes to physical memory with *actually* writing to physical memory
<zid`>
that's what either vtd, or an iommu, can do
<gog>
if you're identity mapping physical space into a guest system then you're defeating the purpose of the hypervisor
Turn_Left has joined #osdev
<zid`>
If the host OS has a 'normal' view of physical memory, no devices are hidden from it, because devices are memory mapped (aka, sitting on the memory bus, responding to read/writes). As long as the OS knows the physial address, the device can be interacted with. Ergo you need to *disrupt* that view, and make it impossible to send certain physical addresses to the bus.
Left_Turn has quit [Ping timeout: 240 seconds]
<gaze___>
In a classical blue pill root kit it does right?
<zid`>
does what
<gaze___>
Well — if the device is hidden in the table provided by ACPI, why would the host care about it?
<gaze___>
I mean you identity map most everything except a few thing.
<gaze___>
Few things
<zid`>
how are you hiding it
<zid`>
without changing what the OS sees in memory
<gaze___>
Ah ok sorry I’m not being totally clear. You change what the OS sees — not the hardware.
<zid`>
the OS is the thing the hardware is running
<zid`>
do we have to get into theory of mind and solipsism and stuff
eroux has joined #osdev
<gaze___>
The physical addresses given to the hardware require no indirection in my proposed scheme. The only thing indirected are the attempts to probe that the device exists — that is, the ACPI tables. There’s numerous opportunities elsewhere too. Maybe you hook the function that enumerates devices on the PCI bus.
<gaze___>
Which is harder but maybe you understand what I’m getting at even if I’m wrong
<zid`>
acpi tables can hide an entire controller, but can't hide an individual device, you'll need to fudge the pci-e configuration space for that
<zid`>
Your original question is "Why do I need to change what the cpu can see in memory?" but you seem to be past that now?
<gaze___>
“Fudge the pci-e configuration space” yes that’s what I mean.
<heat>
fudging pcie config in a hypervisor sounds pretty ez
<heat>
each device has 4096 bytes, a whole page
<heat>
so replace every device you want to hide with an all-1s page
<heat>
(or trap them all to all-1s or whatever)
<zid`>
I've never done a hyperpooper, but then again, I've not got anything to run in one either
<zid`>
so that's probably understandable
<gog>
turbovisor
* gog
nyoom nyoom
<zid`>
I should write a hypovisor
<zid`>
makes your system more pessimal
<gog>
i should go home
<gog>
but i'm getting so much done
<gog>
and it's raining
<zid`>
stay late, then don't show up tomorrow, "I stayed late yesterday"
<gog>
tomorrow is gym day tho
<gog>
i like gym
<heat>
>hyperpooper
<heat>
cheers i need to poop now
<gog>
cheers bro i'll poop to that
<zid`>
I've never pooped
xenos1984 has quit [Ping timeout: 256 seconds]
<gog>
ok i'm going home now
gog has quit [Quit: Konversation terminated!]
bauen1 has joined #osdev
DanielNechtan has joined #osdev
DanielNechtan is now known as bombuzal
Halofreak1990 has joined #osdev
xenos1984 has joined #osdev
gog has joined #osdev
<gaze___>
Heat: now we’re talkin!! Why an all-1s?
<heat>
because accesses to configuration space without a device behind it reply all-1s
<gaze___>
Fab. Ok so if I do that, there’s no other central thing that I’d have to muck with so that I can do DMA on my own to the card?
<gaze___>
From the monitor
<gaze___>
DMA on some hardware is done with some central controller but as I understand it, the card just bus masters
<heat>
you need to make sure that if your card is behind a bridge, no one disables memory, io or bus mastering on that bridge
<heat>
you may need to have everything pre-configured and hope linux/something else doesn't rewrite it?
<gog>
ISA DMA is distinct from PCI bus mastering DMA yes
<gaze___>
heat: haha ew
<gaze___>
Is there somewhere you could switch that back and forth on context switches to the monitor or do you wind up screwing up transfers in progress?
<gaze___>
I guess you’d have to emulate the behavior of the bridge or something to keep all those things on.
innegatives has joined #osdev
innegatives has quit [Quit: WeeChat 3.5]
<heat>
the top way of checking if a string only has alphanumeric chars in javascript is to use regex
<heat>
........................
<zid`>
well.. yea?
<zid`>
otherwise you'd have to run some code written in JS, instead of C
<ChadGPT>
i heard regex are zero cost
<zid`>
I bet a regex that's pre-regcomp'd is faster than a loop in js
<zid`>
I've genuinely seen people say "loops are slow" in js :D