osresearch / safeboot-loader

Linux kernel module to use UEFI Block IO Protocol devices. Probably not a good idea.
72 stars 8 forks source link

How do I display the ncurses form? #21

Open DenisVASI9 opened 1 year ago

DenisVASI9 commented 1 year ago

I would like to draw a login box using python. I copied the python and ran the script, but nothing was shown on the screen.

import npyscreen
class TestApp(npyscreen.NPSApp):
    def main(self):
        # These lines create the form and populate it with widgets.
        # A fairly complex screen in only 8 or so lines of code - a line for each control.
        F  = npyscreen.Form(name = "LOGIN",)
        t  = F.add(npyscreen.TitleText, name = "Login:",)
        t  = F.add(npyscreen.TitlePassword, name = "Password:",)
        # This lets the user interact with the Form.
        F.edit()

if __name__ == "__main__":
    App = TestApp()
    App.run()
osresearch commented 1 year ago

safeboot-loader doesn't include python, so I'm not sure where you want to run this application.

DenisVASI9 commented 1 year ago

I added python myself. After that I wrote an example in c and it doesn't work either.

#include <ncurses.h>

int main()
{   
    initscr();          /* Start curses mode          */
    printw("Hello World !!!");  /* Print Hello World          */
    refresh();          /* Print it on to the real screen */
    getch();            /* Wait for user input */
    endwin();           /* End curses mode        */

    return 0;
}
Error opening terminal: linux.

I did this directly in initrd

DenisVASI9 commented 1 year ago

@osresearch What do you think of that?