<gog>
is there any way other than an interrupt that i could get the cpu to dump the cs to the stack
<gog>
this is for research purposes
<zid>
mov ax, cs; push rax
<zid>
:p
<gog>
undefined opcode
<zid>
orly
<Mutabah>
far call?
<gog>
it assembled but it doesn't run
<gog>
can't be a far call because i don't have another segment to call into
<zid>
mov ax, cs worked on an 8086
<Mutabah>
yeah, surprised that didn't work
<zid>
sure you didn't do movw ax, cs
<zid>
%&£$*AX, ^$&CS
<zid>
that one doesn't exist
<gog>
66 8c c8
<gog>
maybe i did
<heat>
i dont think mov ax, cs exists
<gog>
no
<zid>
0: 66 8c c8 mov ax,cs
<Mutabah>
`66` is a size override
<gog>
felix cloutier
<Griwes>
...I was just typing that
<zid>
2. In 32-bit mode, the assembler may insert the 16-bit operand-size prefix with this instruction (see the following “Description” section for further information).
<zid>
oh apparently otherwise it does mov eax, cs and zeros the upper half of eax
<zid>
which is obviously, not the same thing
<gog>
8c c8 crashes too
<Mutabah>
... 64-bit code?
<gog>
yeah
<Mutabah>
CS doesn't matter
<zid>
what fault do you get?
<heat>
it does matter, it's just flat
<Mutabah>
you shouldn't be needing to touch it in long mode
<zid>
UD? GP(selector)?
<heat>
but the ring and mode do matter
<gog>
ud
<gog>
i'm doing something unauthorized with efi again
<zid>
interesting, that doesn't appear to be documented
<zid>
What does int do in long mode?
<zid>
you could disable irqs, save and swap in a new interrupt table, and int3 maybe?
<gog>
i thought about that and it's kindof a pain but it might be the only way
<heat>
gog what are you doing
<zid>
witchy things
<gog>
nevermind what i'm doding
<heat>
no
<zid>
against the patriarchy of uefi
<heat>
tell me now
<zid>
you need to become a femboy first heat
<gog>
yes
<heat>
why, this is C, not rust
<zid>
Patriarchy says so
<Griwes>
wait, if you're in efi long mode, why do you care about contents of cs
<zid>
not my rules, blame the patriarchy if you have a problem, I just enforce them, as a male
<gog>
it's a secret
<heat>
Griwes, i bet a tenner on how gog is swapping contexts
<heat>
thus you need cs and ds, ss, es, gs, etc
<gog>
no i abandoned that plan
<gog>
this is a different plan
<gog>
it's equally bad
<heat>
what's the plan?
<zid>
heat show me your tenner
<heat>
no
<Griwes>
no no no, if this is long mode efi, then cs is just completely irrelevant, because you _are_ going to be in ring 0, no?
<gog>
i'm faking syscalls
<heat>
whot
<zid>
gog got baited :(
<Griwes>
what
<gog>
so i need something to put in STAR
<zid>
gog how could you, this is what the patriarchy wanted
<heat>
oh ok
<gog>
i could use my own GDT i guess
<gog>
it doesn't matter anyway
<heat>
no, you can't
<gog>
sure i can
<heat>
cuz then you need to disable ints and never call into efi
<zid>
you can swap it back
<gog>
i can use my own GDT and copy the UEFI GDT with the same offsets
<heat>
why do you need syscall anyway?
<zid>
see this is what happens when women speak
<gog>
i don't need it it just makes a small fraction of my work easier
<Griwes>
ah right forgot that STAR is stupid and requires actual descriptors
<zid>
"Why would you want to do this!?"
<heat>
i'm mansplaining all over gog
<zid>
gog: bench press him
<gog>
it's my right as a woman to do stupid bullshit that's probably more trouble than it's worth to save myself another abstraction
<Griwes>
yes, and it is our right to question you doing said stupid bullshit
<zid>
(as the patriarchy)
<gog>
P:
<gog>
maybe i'll abandon this plan like i abandon all my other plans
<zid>
My plan is to continue to never touch uefi
<Griwes>
is that you or the adhd speaking
<zid>
if possible
<gog>
i am the adhd
<heat>
i am the one who adhds
<gog>
"a man loses his hyperfocus and you think that of me? no."
<gog>
on another subject, what's a safe abrasive to fix this line worn into my screen
<gog>
ooh maybe toothpaste would work
<heat>
goggy sometimes you worry me
<gog>
i'm fine
<zid>
nothing is safe
<zid>
turtle wax was my goto
<zid>
for DVDs
<gog>
that migth be too much
<zid>
less abrasive than toothpaste, and stands a chance of actually filling the scratch a little
<zid>
and shouldn't eat plastic
<gog>
hmm yes
<gog>
there is this plastics polish that's used on headamp lenses
<gog>
that might work too
<zid>
yea that's going to be silica nanoparticles or something probably
<gog>
but i guess i'd have to be absolutely sure it's compatible with whatever platic my screen is made of
<zid>
abrasives should be okay, but I'd be wary of anything.. chemical? if that makes sense, and defo test it
<gog>
i think it might have been acetone that caused the thing i'm looking at
<gog>
so yeah
<zid>
and it didn't just go misty?
<gog>
it is a little
<zid>
amazon has plastic polish
<zid>
a tiny buffing should sort out some misting
<zid>
but.. your screen may be coated
<zid>
in which case it'll just make a little topographical map of where you buffed it
<zid>
laptop screens especially
<zid>
cus they tend to have an anti-glare coating
<gog>
true
<gog>
y'all i know my drag stage name, it's gonna be tucker carlsdotter
<zid>
hah
<zid>
tucker is a great drag name in general
<gog>
ay'
<gog>
yes
<gog>
carla tuckerson
<gog>
nah
wblue has quit [Quit: wblue]
heat-onyx has joined #osdev
<heat-onyx>
gog: onyx poggers tcp still works well
<gog>
poggers
<kazinsal>
goggers
<heat-onyx>
bazinga
<heat-onyx>
im not sure if im on ipv6 or v4
<heat-onyx>
whatever irssi defaulted to
<heat-onyx>
probably v6 if going by DNS
<heat-onyx>
anyway, cute re-test
<heat-onyx>
bazel
heat-onyx has quit [Client Quit]
<heat>
aw lame, it was v4
<zid>
very v4
<zid>
mr bl8-253-151.dsl.telepac.pt
<zid>
bl stands for boylove I assume
<heat>
obviously
gog has quit [Ping timeout: 240 seconds]
<heat>
also it's very annoying how this channel is +r, i need to keep an alt for these sorts of tests
<zid>
/msg nickserv identify bl6969 not exactly difficult to do though
[itchyjunk] has quit [Remote host closed the connection]
<SGautam>
My program is simply launching cmd.exe and sending char by char "dir\r\n" to cmd.exe
<SGautam>
The first question I got is, why does the console send me a new line every time I type a character into the terminal
Burgundy has joined #osdev
<SGautam>
The escape sequence ESC[?25l makes the cursor invisible, but the cursor is obviously visible on cmd.exe
<SGautam>
Also it seems to be outputting its entire history to the terminal, rather than give me new lines.
<sham1>
IIRC cmd.exe doesn't emulate VT100
<SGautam>
It doesn't, yes, but the new ConPTY does
<sham1>
I wonder if you'd need to explicitly request that
<SGautam>
They've completely changed the Console API after Win10 2018
<Mutabah>
I thought it was a msvcrt feature that translated the commands
<SGautam>
You can now do the Windows equivalent of ioctling CONIN and CONOUT by using pipes and then connect those pipes to a Console handle returned by the function CreatePseudoConsole
<SGautam>
So yeah its a VT100-compatible stream, at least thats what the docs claim
<Mutabah>
Getting back to the question: what do you mean about the new line on every character?
PublicWiFi has quit [Ping timeout: 245 seconds]
<Mutabah>
and where is this screenshot from?
<Mutabah>
looks like a text editor actually
<SGautam>
From VSCode, I am outputting everything to a text file
slidercrank has joined #osdev
<SGautam>
Everything I get from the Console out pipe.
<SGautam>
So when I type "d", I get a new batch of text, then I type "i", I get another batch of text, and then I type "r" I get yet another new batch of text.
<SGautam>
Yet the parse VT100 output is just "dir" on one line.
<SGautam>
I'm trying to understand how it works.
<SGautam>
You can see "d" "i" and "r" form vertically after ESC[?25l
<klange>
And learning what those escape sequences are doing.
<klange>
Cursor positioning, title sequences, cursor show/hide, clear screen...
<SGautam>
Yes, also when I output it to stdout using WriteFile() I get "dir" on the prompt line as is natural behaviour of consoles, yet the stream I'm getting each character in input is delivered separately
<SGautam>
klange: wow thanks
GeDaMo has joined #osdev
<SGautam>
I was searching for "VT100 escape codes" and all I was getting was lists with one phrase descriptions
<SGautam>
This seems more complete
<Mutabah>
On every key you type, the shell gets the key and prints it for you - that's what you're seeing there (along with it re-rendering the prompt and a bunch of other stuff)
slidercrank has quit [Quit: Why not ask me about Sevastopol's safety protocols?]
SGautam has quit [Quit: Connection closed for inactivity]
<sham1>
Nice
smokealot has quit [Quit: WeeChat 3.8]
q3lont has quit [Quit: Leaving]
sortie has joined #osdev
SGautam has joined #osdev
MiningMarsh has joined #osdev
<mcrod>
hi
<sham1>
hi
<mcrod>
i need a haircut
<sham1>
Cool
<sham1>
Why
<mcrod>
because i can't see anything
zhiayang has quit [Quit: oof.]
zhiayang has joined #osdev
MrBonkers has quit [Quit: ZNC 1.8.2+deb2build5 - https://znc.in]
zxrom has quit [Ping timeout: 272 seconds]
zxrom has joined #osdev
<SGautam>
So I've looked up ANSI escape sequences and some of it now makes sense to me. But what still confuses me is, after I enter a character on the shell, I get it as input, but in addition, following the input, I get the previously outputted text as well, which doesn't make sense. https://usercontent.irccloud-cdn.com/file/Ljmvdssj/image.png
<SGautam>
after I enter a character on the shell, I get it as input <-- meant output, obviously.
zxrom has quit [Ping timeout: 272 seconds]
<SGautam>
/facepalm I got the issue, I was outputting the entire buffer everytime instead of just the bytes read.
Left_Turn has joined #osdev
vdamewood has joined #osdev
smokealot has joined #osdev
heat has joined #osdev
zxrom has joined #osdev
<sham1>
That would do it
<gog>
mcrod:
<mcrod>
gog
<gog>
hi
<gog>
can i have a hug
* mcrod
hugs gog
Turn_Left has joined #osdev
<sham1>
hi
<sham1>
Stupid rain
<sham1>
Cycling home wasn't fun. Oh well, at least my trousers are already drying again
Left_Turn has quit [Ping timeout: 240 seconds]
* gog
hug mcrod
<heat>
gog: i felt really fucking sick today
<heat>
turns out that downing two red bulls for quick and easy sugar doesn't really work when your stomach is empty
<heat>
the things you learn eh
<gog>
bruh moment
<sham1>
Yeah no, you need some snacks just so you're not totally empty when you pull off that kind of BS with energy drinks
<gog>
i feel better now
<gog>
i was pretty bleh before gym
<heat>
i felt pretty weak in the gym cuz of this kind of shit, had a horrendous time but mommy saved me (literally) and took me home
<GeDaMo>
Do you mean the double mov esi, 56? esi is caller saved
vdamewood has joined #osdev
<mcrod>
yes
<mcrod>
oh i see
<mcrod>
ok
<GeDaMo>
"If the callee wishes to use registers RBX, RSP, RBP, and R12–R15, it must restore their original values before returning control to the caller. All other registers must be saved by the caller if it wishes to preserve their values." https://en.wikipedia.org/wiki/X86_calling_conventions#System_V_AMD64_ABI
<Cindy>
kazinsal: i'm looking at the instruction set
<GeDaMo>
Looks like it just copies x86 MMX instructions :|
<Cindy>
they didn't use the unused size operand for 64-bit
<Cindy>
infact they just made different instructions for 64-bit
<Cindy>
the integer instructions are still 32-bit only
<puck>
yes, AMMX is the only 64-bit bit
scaleww has joined #osdev
<Cindy>
>:( this is a PHONY
<kazinsal>
I would never expect dudes building FPGA softcores to make benchmarks run faster on amigas to be good at ISA design
<Cindy>
not surprised
<Cindy>
they could have used the unused operand to extend the instructions to 64-bit
<Cindy>
instead of gluing MMX into the ISA
<Cindy>
and calling it a day
<nortti>
< Cindy> they could have used the unused operand to extend the instructions to 64-bit ← and make general purpose registers 64-bit?
<Cindy>
yes
<nortti>
I wonder how that'd work while running amigaos that is not 64-bit aware. with the MMX-y design I presume it can handle it because it uses floating point registers, but unless the OS was modified it'd just trample on the high 32-bits of the regs
<Cindy>
while making 64-bit versions of some instructions (like a version of SWAP that swaps 32-bit integers in a 64-bit register)
<Cindy>
in case there are instructions that don't accept the size operand
<Cindy>
nortti: it would still be compatible with 32-bit amigaos
<Cindy>
i think
<nortti>
32-bit amigaos running 64-bit user software?
<nortti>
because realistically, there's not going to be a 64-bit aware amigaos for m68k, and the only reason to really make new m68k cores is if you are an amigist
<Cindy>
oh yeah
<Cindy>
i thought you meant 32-bit amigaos running 32-bit software
<Cindy>
also not true, i'm a CD-ist
zxrom has joined #osdev
<Cindy>
CD-i.... ist
<nortti>
does CD have any OS, or does your code just run on the bare metal?
<nortti>
*CD-i
<Cindy>
CD-i runs microware OS-9
<Cindy>
that's it's OS
<Cindy>
CD-i software are supposed to be hardware-agnostic, except being optimized to run in 1MB of RAM or less
<Cindy>
and optimized to run in a regular M68000 (or have a version that is able to run in one)
<Cindy>
1 MB of ram is a huge amount of RAM, especially when you consider that the CD-i was made in 1990
<Cindy>
that's why CD-i players are so goddamn expensive
<zid>
it'd need a bootstrap at least
<zid>
to read the filesystem on the cd-rm and stuff
<Cindy>
yes
<Cindy>
that's what OS-9 handles
danilogondolfo has quit [Remote host closed the connection]
<Cindy>
CD-i players are required to have a copy of OS-9 + device drivers for the hardware + modules for the CD-i's API that the program interacts with
<Cindy>
(or a OS that is compatible with OS-9
<Cindy>
or at least filesystem modules for the CD drive, framebuffer device, and audio processors, that have the D-i GetStat and SetStats
<Cindy>
CD-i*
<Cindy>
implemented
<Cindy>
(GetStat/SetStats are like ioctl)
<Cindy>
i'm in the progress of making a emulator out of this mess
zxrom_ has joined #osdev
zxrom has quit [Ping timeout: 246 seconds]
theboringkid has joined #osdev
theboringkid has quit [Client Quit]
zxrom_ is now known as zxrom
GeDaMo has quit [Quit: That's it, you people have stood in my way long enough! I'm going to clown college!]
<mcrod>
I'm ready to launch a war against people who throw out "premature optimization is the root of all evil" every time someone asks a performance related question
<mcrod>
that's why we are filled to the brim with morons; you're telling people not to think about the shit they write!
<mcrod>
doing something that's less stupid does not a premature optimization make
<mcrod>
knuth himself has said that quote was not meant to be taken in the context it's being taken in today, although it's a happy accident that in context it's true (and it indeed is)
<mcrod>
but if you want to do less stupid things, that's okay, so long as you're not writing 60000 lines of code to optimize something aggressively in the cold path
<mcrod>
and stackoverflow is filled, _filled_ with people who throw out that quote nonstop
<geist>
word.
<geist>
really dogmatically applying anything i think is a problem
<geist>
there's always shades of grey with all these sort of things
<mcrod>
right
<mcrod>
I'm just blowing up because I've heard that quote one too many times today for my lifetime
<mcrod>
heh
scaleww has quit [Quit: Leaving]
orthoplex64 has quit [Read error: Connection reset by peer]
orthoplex64 has joined #osdev
<sham1>
mcrod: premature optimisation of quote usage is the root of all evil
<sham1>
- E. W. Dijkstra
<Ermine>
in Dijkstra's style that should be "premature optimisation of quote usage is considered harmful"
<sham1>
No copula
<zid>
sham1, wanna go copula with me in the broom closet?
<sham1>
"premature optimisation of quote usage considered harmful (by the author)"
<sham1>
zid: there is no broom closet ending
<sham1>
If you enter it one more time, the narrator will get mad
MrBonkers has joined #osdev
gorgonical has joined #osdev
<gorgonical>
I have recently started using xpra and wow what a great program
<gorgonical>
I love it
<sham1>
Is this sarcasm?
<gorgonical>
no
<gorgonical>
honestly it's great
<sham1>
Oh
<gorgonical>
I try to keep all my dev stuff on one machine and that's where I like to run emacs
<gorgonical>
And I ssh tunnel to run emacs, and when I move my laptop it kills emacs because the ssh session closes
<gorgonical>
run it under xpra and it just hangs out politely in the background and I can reconnect when I get home
<gorgonical>
It feels like how I felt when I discovered tmux/screen all those years ago: "this is amazing"
sortie has quit [Quit: Leaving]
<gorgonical>
I did have another strange interaction with arm tf-a. I'm kicking a second core to run my kernel, but when it was doing stuff in the firmware it would crash trying to read psci power domain stuff. Same addresses, idmapped, etc.
<gorgonical>
I basically concluded it has to be a cache problem, but afaik if the pages are marked inner-shareable, write-back shouldn't cache coherence be in play? I fixed it by explicitly clean/invalidating the range, but what's the point of marking them shared if that does nothing?
<gorgonical>
Also, shouldn't the firmware manage that, assuming the port to that platform is "functional"?
<geist>
hmm, what is xpra
<geist>
ah interesting
<geist>
might be useful
<gorgonical>
its tmux/screen but for x11 applications
<geist>
it's like a scree... yeah
<geist>
okay i could definitely use this
<gorgonical>
I use it because I like keeping my buffers and stuff open in emacs when I'm done for the day
<geist>
oh agreed. i ssh into a headless cloud box all the time and like to use gvim or whatnot
<geist>
but a drag that i cant punch it back
<Cindy>
mcrod: premature optimization is the root of all evil
<Cindy>
that's why you ship out a premature game :P
<mcrod>
Cindy may I pet you
<Cindy>
:o
<Cindy>
yes! yes!!
slidercrank has quit [Ping timeout: 260 seconds]
[itchyjunk] has joined #osdev
heat has quit [Remote host closed the connection]
heat has joined #osdev
* mcrod
pets Cindy
<gorgonical>
really thought about it huh
* Cindy
purrrrs ^w^
LibreTown has joined #osdev
LibreTown is now known as Lian
goliath has joined #osdev
Lian has quit [Quit: This Konversation is over!]
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
shittyhills has joined #osdev
wblue has joined #osdev
Turn_Left has quit [Read error: Connection reset by peer]
Burgundy has quit [Ping timeout: 272 seconds]
FreeFull has quit []
<shittyhills>
gog: so why do you use so many PROVIDE_HIDDEN in there?
zxrom has quit [Remote host closed the connection]
<zid>
What were your thoughts?
zxrom has joined #osdev
<shittyhills>
the provide is used to define symbol not provided by link, so to refer in other parts of the linker script i imagine
<zid>
'to refer in other'?
<shittyhills>
but the provide_hiddens there are not even referred to
<shittyhills>
i dont know, thats what docs say, reference
<zid>
I don't understand the grammar
<shittyhills>
| cow_2001, :) │+davros1
<shittyhills>
│17:38:56 <-- | Atque (~Atque@user/atque) has quit (Remote host closed the connection) │+de-facto
<shittyhills>
│17:39:23 +cow_2001
<shittyhills>
oops
<shittyhills>
wrong paste
<shittyhills>
In some cases, it is desirable for a linker script to define a symbol only if it is referenced and is not defined by any object included in the link.
<zid>
I don't understand why you're pasting anything to begin with, just explain what you think it's for
<zid>
rather than pasting from that stackoverflow post
<shittyhills>
its for doc
<zid>
'for doc'?
<zid>
for a doctor?
<shittyhills>
from*
<zid>
from a doctor?
<shittyhills>
documentation
<zid>
what documentation?
<zid>
> I don't understand why you're pasting anything to begin with, just explain what you think it's for
<shittyhills>
binutils ld
<zid>
you pasting it doesn't make me think you understand it
<zid>
if I asked you what 4+4 was I wouldn't expect you to paste me the wikipedia article on addition
shittyhills has left #osdev [WeeChat 3.8]
shittyhills has joined #osdev
<shittyhills>
nevermind, ill figure it out
<zid>
Even if you're wrong, that's fine, because then we at least know what you misunderstood
<zid>
why are you afraid of answering?
<shittyhills>
i just needed to grep the codebase
<zid>
There's nothing to 'figure out', you just need to understand what it does
<zid>
and either you do or you don't
<zid>
It's not a magic spell
<shittyhills>
okay i think i do
<shittyhills>
anyway
<shittyhills>
heres one question id really like answered
<shittyhills>
say you have uefi set up and everything loading elf kernel on x86_64, whats the smallest code you can write in your kernel main.c to verify that it successfully loaded?
<zid>
Completely unanswerable
<Cindy>
you coooould checksum the executable in memory
eddof13 has joined #osdev
<shittyhills>
i mean i dont want to pass the framebuffer then print with it just to verify kernel is loaded and running
<zid>
There are very rarely absolutes available to you, 'smallest code' is undefined. You probably meant to ask what a good way that we might use for our situations
<shittyhills>
yes
<shittyhills>
what would be the good way?
<zid>
which might be totally different to yours though, we don't know yours
<zid>
I'd be doing it under a debugger, so I'd j ust make an infinite loop
<zid>
then check that I was inside that loop with the debugger
<shittyhills>
can you just make infinite loop and listen to cpu screaming?
<zid>
That is absolutely not what I said
<zid>
If I had no debugger I would obviously do something completely different
<shittyhills>
what would you do with no debugger?
<zid>
On my motherboard? write to i/o port 0x80
<zid>
failing that, serial port, or vga text console
<zid>
or clear the screen red if it looks like it might be in a graphical mode, or both
<shittyhills>
but doesnt uefi drop you off into environment where there's no vga text console?
eddof13 has quit [Client Quit]
<zid>
no idea, I don't do uefi
<zid>
hence the red, and it being option 4, from a list I invented 10 seconds ago
nvmd has joined #osdev
roan has quit [Ping timeout: 245 seconds]
vdamewood has quit [Read error: Connection reset by peer]
vdamewood has joined #osdev
<gog>
shittyhills: the symbol is defined but not exported to the dynamic symbol table
<gog>
that's why i use PROVIDE_HIDDEN
<gog>
because the dynamic symbol table is not currently important but it's part of an overall plan
<zid>
It's also just dirty not to
<gog>
also uefi doesn't provide a vga text console but it's actually easy to write one
<gog>
i did it
<gog>
it's not pretty or performant but i did it
<zid>
what does not provide even mean
<zid>
the hw provides it every time I've used it
<gog>
i think you actually can maybe
<zid>
you just have to be in a vga text mode lest you not be able to actually see it
<gog>
yeah it's not available
<zid>
what's not available mean though
<zid>
it forcibly ejects my 1050 out of its pci-e slot?