I want to make a DOS-inspired UEFI operating system, simple, a good place to start. Take in commands and run those commands, but I don't quite get the "Take in commands" part. In POSIX-UEFI, uefi.h has a custom printf, so I'm assuming it needs a custom scanf, given a different I/O system (educated guess).
I've tried quite a few things. I blatantly tried putting scanf in my code, and I got an implicit function declaration warning, so no scanf in uefi.h, it appears. I searched up loads of things and I didn't get anything back that was relevant to my problem, so I have came here.
Thanks in advance :).
From the looks of things, you end up using uefi services (fairly) directly. During startup, it initializes a global variable named
STto point to the UEFI system table, which looks like this (uefi.h, line 846):To read from the keyboard, you'll use the
ConIn, which is a pointer to asimple_input_interface_t, which is defined as follows (uefi.h, line 576):At a guess, you'll probably want to allocate a buffer of reasonable size. Then use
WaitForKey/ReadKeyStroketo read keys and save them to the buffer until you get a carriage return.Then you can use something like
sscanfto parse the content of the buffer.Reference
uefi.h