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
Burgundy has quit [Ping timeout: 256 seconds]
wikan has quit [Quit: WeeChat 3.0]
dequbed has quit [Ping timeout: 240 seconds]
biblio has quit [Quit: Leaving]
gog has quit []
matrice64 has joined #osdev
matrice64 has quit [Client Quit]
zaquest has quit [Remote host closed the connection]
FatalNIX has quit [Ping timeout: 240 seconds]
zaquest has joined #osdev
nyah has quit [Ping timeout: 256 seconds]
kkd has quit [Remote host closed the connection]
Oli has joined #osdev
sdfgsdfg has quit [Quit: ZzzZ]
kkd has joined #osdev
kkd has quit [Ping timeout: 256 seconds]
dude12312414 has joined #osdev
archenoth has quit [Read error: Connection reset by peer]
archenoth has joined #osdev
pretty_dumm_guy has quit [Quit: WeeChat 3.4]
qubasa_ has joined #osdev
qubasa_ is now known as qubasa
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
kkd has joined #osdev
Oli has quit [Ping timeout: 256 seconds]
Oli has joined #osdev
kkd has quit [Remote host closed the connection]
kkd has joined #osdev
kkd has quit [Remote host closed the connection]
kkd has joined #osdev
netbsduser has joined #osdev
netbsduser` has quit [Ping timeout: 250 seconds]
srjek has quit [Ping timeout: 240 seconds]
blockhead has quit [Ping timeout: 256 seconds]
blockhead has joined #osdev
terrorjack has quit [Quit: The Lounge - https://thelounge.chat]
terrorjack has joined #osdev
Oli has quit [Ping timeout: 250 seconds]
[_] has joined #osdev
[itchyjunk] has quit [Ping timeout: 240 seconds]
[_] is now known as [itchyjunk]
dude12312414 has joined #osdev
dude12312414 has quit [Remote host closed the connection]
Lugar has quit [Quit: Bye]
sdfgsdfg has joined #osdev
Oli has joined #osdev
Burgundy has joined #osdev
Burgundy has quit [Ping timeout: 250 seconds]
Burgundy has joined #osdev
ecs has quit [Ping timeout: 260 seconds]
ElectronApps has joined #osdev
raggi has quit [Ping timeout: 250 seconds]
raggi has joined #osdev
ecs has joined #osdev
ElectronApps has quit [Quit: Leaving]
ecs has quit [Ping timeout: 240 seconds]
cheapie has quit [Quit: Local host tripped over the cable]
ecs has joined #osdev
nshp has quit [Ping timeout: 250 seconds]
cheapie has joined #osdev
Oli has quit [Ping timeout: 250 seconds]
sdfgsdfg has quit [Quit: ZzzZ]
ElectronApps has joined #osdev
ElectronApps has quit [Remote host closed the connection]
edr has quit [Ping timeout: 256 seconds]
edr has joined #osdev
[itchyjunk] has quit [Read error: Connection reset by peer]
ZombieChicken has joined #osdev
ZombieChicken has quit [Quit: WeeChat 3.4]
ElectronApps has joined #osdev
ElectronApps has quit [Remote host closed the connection]
sdfgsdfg has joined #osdev
fwg has quit [Ping timeout: 250 seconds]
fwg has joined #osdev
MarchHare has quit [Ping timeout: 240 seconds]
klys has quit [Ping timeout: 256 seconds]
klange has quit [Ping timeout: 256 seconds]
jeaye has quit [Ping timeout: 268 seconds]
klys has joined #osdev
klange has joined #osdev
nyah has joined #osdev
klys has quit [Ping timeout: 256 seconds]
klys has joined #osdev
jeaye has joined #osdev
klys has quit [Ping timeout: 240 seconds]
klange has quit [Ping timeout: 256 seconds]
jeaye has quit [Ping timeout: 256 seconds]
biblio has joined #osdev
klange has joined #osdev
adachristine has joined #osdev
dormito has quit [Quit: WeeChat 3.3]
klys has joined #osdev
GeDaMo has joined #osdev
jeaye has joined #osdev
adachristine is now known as gog
dormito has joined #osdev
sheb has joined #osdev
<junon> Is RIP-Relative mode what is used with you compile with PIE?
<junon> err, rip-relative addressing*, not mode
<klange> Should be. RIP-relative was a big improvement over the thunks that were used in 32-bit x86.
<junon> I thought x86 already had EIP-relative addressing though? e.g. jmp short and whatnot. Am I misremembering?
<zid> that's not an addressing mode
<junon> What does addressing mode mean here, then? Just for reads/writes?
<Mutabah> yes.
<Mutabah> For doing memory accesses
<klange> You want to load a library somewhere [or for PIE, an executable image]. You _could_ load it and then rewrite all the data references, but now you've trashed all of the code with writes and your bovines are now sad.
<klange> Instead you use RIP-relative addressing. Your static data gets loaded with the code as a single segment (or two... r/w/x separation...) and the code knows where it is relative to itself and that doesn't change when you stick the lot at different addresess
<klange> now all that code can remain cow-friendly, and because it's not doing extra function calls to extract EIP from stack frames, it's not any slower for it
<froggey> mooo
Oli has joined #osdev
<junon> ahhhhhh
<junon> for static data, right
<junon> neat.
<junon> thanks klange
<zid> lea rsi, [dll_base_addr]
<zid> add rsi, symbol_offset
<zid> mov eax, [rsi]
<zid> vs. mov rsi, [rip+0x8394]
<zid> well not dll, .o
<junon> Oh okay I have definitely seen that.
<junon> in some disasm output before
<junon> also TIL NOP is actually XCHG EAX, EAX under the hood, and that AMD64 keeps it that way regardless of size prefixes.
<junon> Why would that make a difference, though? Why not... do nothing? Is there an observable side effect to XCHG EAX,EAX that had to be preserved?
<zid> it actually doesn't do that
<zid> because it'd break a whole bunch of programs
<junon> Ohhh it doesn't do that? The writing is vague
<junon> section 2.5.7: > Without special handling in 64-bit mode, the instruction would not be a true no-operation. Therefore, in 64-bit mode the processor treats opcode 90h (the legacy XCHG EAX, EAX instruction) as a true NOP, regardless of a REX operand-size prefix.
<zid> that's precisely what it says
<zid> it says it DOES NOT do it, because that would *not* be a nop
<zid> so it *has* to replace it with nop, because otherwise it'd.. clear the upper bits of rax
<junon> Riiiiight okay.
<junon> is that because 90h is an encoded instruction?
<junon> there was no dedicated, true NOP?
<zid> 90 is nop
<zid> and happens to be where xchg eax, eax *would* be
<zid> if you looked at a little map
<junon> Gotcha, so it was effectively NOP in x86 but because of zero extension in 64-bit mode it has side effects if treated as such, so AMD64 has special handling
<junon> is what I'm understanding
<zid> idk the exact encoding but you could imagine 7E: xchg rbx, rdx 7F: xchg rbx, rcx 80: nop 81: xchg rax, rdi 82: ..
<junon> or, maybe not zero extension but truncation
hodbogi has joined #osdev
<zid> it just takes the place of xchg rax, rax
<junon> right
<junon> okay
<zid> it's just letting you know not to assume it does xchg rax, rax and people *treat* that as a nop
<zid> it actually *is* a nop
<junon> Cool, makes sense. Thanks zid :)
gruetzkopf has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
hodbogi has quit [Quit: Lost terminal]
FatalNIX has joined #osdev
dennis95 has joined #osdev
sdfgsdfg has quit [Quit: ZzzZ]
gruetzkopf has joined #osdev
gruetzkopf has quit [Client Quit]
blockhead has quit []
lleo has joined #osdev
Terlisimo has quit [Quit: CVE reboot :)]
wgrant has quit [Ping timeout: 250 seconds]
Terlisimo has joined #osdev
wgrant has joined #osdev
biblio has quit [Quit: Leaving]
srjek has joined #osdev
lleo has quit [Quit: institute budget]
Lugar has joined #osdev
gruetzkopf has joined #osdev
dequbed has joined #osdev
[itchyjunk] has joined #osdev
dequbed has quit [Client Quit]
dequbed has joined #osdev
ElectronApps has joined #osdev
ElectronApps has quit [Remote host closed the connection]
mahmutov has joined #osdev
MarchHare has joined #osdev
Oli has quit [Ping timeout: 240 seconds]
blockhead has joined #osdev
dennis95 has quit [Quit: Leaving]
Dreg has joined #osdev
dude12312414 has joined #osdev
Dreg has quit [Read error: Connection reset by peer]
Dreg has joined #osdev
tomaw_ has joined #osdev
tomaw has quit [Ping timeout: 612 seconds]
tomaw_ is now known as tomaw
Lugar has quit [Read error: Connection reset by peer]
Dreg has quit [Read error: Connection reset by peer]
Dreg has joined #osdev
Dreg has quit [Read error: Connection reset by peer]
Lugar has joined #osdev
srjek has quit [Ping timeout: 240 seconds]
mahmutov has quit [Ping timeout: 240 seconds]
tomaw has quit [Read error: Connection reset by peer]
tomaw has joined #osdev
<geist> huh TIL that 90 is xchg
<geist> didn't know that
<geist> also to take it to the next level there are lots of ways to encode nops on x86. 90 is the 1 byte, but some of the optimization and/or programming manuals for intel and amd give you a list of suggested nops from 1 - 15 bytes
<geist> for padding purposes if you need say a 3 byte nop use this, or 6 byte, etc
<geist> usually it's a raw nop + some prefixes and such
<bslsk05> ​stackoverflow.com: assembly - Long multi-byte NOPs: commonly understood macros or other notation - Stack Overflow
* gog nop-sleds into the room
<geist> yah.
* geist pets gog
* gog purrs
<geist> i wonder what the raw encoding of the 0f prefixed nop is?
<zid> nop dword ptr [eax]
<zid> I really like that just in general
<geist> hmmm, according to sandpile its simply nop, yeah
<geist> 0x0f group which is a standard 2 byte opcode group
<zid> some of them are leas with the same src and dst reg
<zid> lea rsi, [rsi*1+0]
<zid> but I don't think anything uses those ones they all just stack nops
<zid> nop dword [eax+0] nop dword[eax+eax*1+0] nop dword [eax + 0x00000000] ...
<geist> then 0x1f which is 'group 16' in sandpile
<geist> i dont get where it consumes the next byte byte there ya go
<zid> 0f is all the cool kid opcodes
<geist> the next byte (0 for 3 byte ones) is probably mod/rm or something
<geist> and thus you get multiple sizes of that
<geist> according to sandpile it was added in p6
<geist> oh and that stackoverflow lists the pre p6 versions, which seem to be leas, yeah
wootehfoot has joined #osdev
johnjaye has joined #osdev
GeDaMo has quit [Remote host closed the connection]
sheb has quit [Quit: Leaving]
dormito has quit [Quit: WeeChat 3.3]
srjek has joined #osdev
fwg has quit [Remote host closed the connection]
dormito has joined #osdev
xenos1984 has quit [Ping timeout: 250 seconds]
flx has quit [Remote host closed the connection]
flx has joined #osdev
xenos1984 has joined #osdev
Bitweasil- is now known as Bitweasil
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
biblio has joined #osdev
srjek has quit [Ping timeout: 240 seconds]