NodeOS / NodeOS

Lightweight operating system using Node.js as userspace

Home Page:http://node-os.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fresh install results in: "Could not initialize SDL(No available video device) - exiting"

jumson opened this issue · comments

using Ubuntu16, fresh install, ssh into it.
I modified it according to the pull request "#388"
So it builds without problems.

in scripts/start, my QEMU is not getting the -nographic option passed to the prepareCommandLine module.

After some investigation, I find that the start script only sends one argument to prepareCommandLine,

prepareCommandLine, implemented in lib/index.js looks for this second argument called "output":

switch(output)
  {
    case 'curses'   : argv.push('-curses')   ; break
    case 'nographic': argv.push('-nographic'); break
  }
 

and in the qemu case:


      switch(output)
      {
        case 'nographic':
          append.push('console=ttyS0')  // redirect to terminal
        break

        case 'curses':
          append.push('vga=extended')  // 80x50
        break

        default:
          append.push('vga=0x344')  // 1024x768x32
      }

I do not see where prepareCommandLine can be called with that second argument....but it I hard code it in the script, it works. The modification looks like this in the scripts/start:

const {command, argv, cwd} = prepareCommandLine(process.argv.slice(2),'nographic')

I say it "works" -- to an extent. It boots only into the REPL.
There is probably still that problem mentioned in luii's comment in issue #386

"The build script returns error 72 and when you look here it converts the usersfs tar file to an "ext" filesystem using tar2ext which calls tune2fs here and returns an ENOENT, so it is possible that you dont have installed it yet."

the problem might be that my tune2fs is in sbin, requiring sudo privileges . Except, I'm not getting any kind of build script error. It is simply not mounting the user drive, so that will be another issue.

in case more info is needed, I logged the unmodified QEMU output:

results of prepareCommandLine: { command: 'qemu-system-x86_64',
  argv:
   [ '-machine',
     'pc',
     '-m',
     '256M',
     '-vga',
     'std',
     '-net',
     'nic',
     '-net',
     'user,id=eth0,hostfwd=tcp::50080-:80',
     '-net',
     'user,id=eth1,hostfwd=tcp::50443-:443',
     '--kernel',
     'kernel',
     '--initrd',
     'initramfs.cpio.gz',
     '-drive',
     'file=usersfs.img,format=raw,index=0',
     '-append',
     'root=/dev/sda ip=dhcp vga=0x344' ],
  cwd: 'out/x86_64/pc/qemu' }

and when I add the 'nographic' argument to the method, the output is this:

results of prepareCommandLine: { command: 'qemu-system-x86_64',
  argv:
   [ '-machine',
     'pc',
     '-m',
     '256M',
     '-vga',
     'std',
     '-net',
     'nic',
     '-net',
     'user,id=eth0,hostfwd=tcp::50080-:80',
     '-net',
     'user,id=eth1,hostfwd=tcp::50443-:443',
     '-nographic',
     '--kernel',
     'kernel',
     '--initrd',
     'initramfs.cpio.gz',
     '-drive',
     'file=usersfs.img,format=raw,index=0',
     '-append',
     'root=/dev/sda ip=dhcp console=ttyS0' ],
  cwd: 'out/x86_64/pc/qemu' }

How come that you've run in so many errors yet only trying to build NodeOS and im doesn't getting any error at all 👏 . Could be the Distro (I'm using Arch Linux) and made most of the support for Arch (dependencies for arch in the install-dependencies). So i can't really say if your Distro has a missing dependency, but i help if i can.

And the outputs are in fact the same and i noticed that the -nographic doesn't work at my machine.

Good to know that Arch Linux is better supported, I'll spin up one of those and get after it.
This is still a problem though, to achieve the objective of running on a multitude of platforms.

Do you understand how else the "prepareCommandLine" will get that "output" argument? I do not see anything else using it.

Yeah i know what you mean, but i haven't wrote the most of the code so @piranna knows better than i am

the problem might be that my tune2fs is in sbin, requiring sudo privileges . Except, I'm not getting any
kind of build script error. It is simply not mounting the user drive, so that will be another issue.

@jumson Could it be that you don't have the wheel (sudo on Ubuntu) group on your user?

wheel - Administration group, commonly used to give access to the sudo and su utilities (neither uses it by default, configurable in /etc/pam.d/su and /etc/pam.d/su-l). It can also be used to gain full read access to journal files.

@jumson did you've made any progression on this?