klange / toaruos

A completely-from-scratch hobby operating system: bootloader, kernel, drivers, C library, and userspace including a composited graphical UI, dynamic linker, syntax-highlighting text editor, network stack, etc.
https://toaruos.org/
University of Illinois/NCSA Open Source License
6.03k stars 475 forks source link

How to transfer files using qemu startup #280

Closed h0pe-ay closed 11 months ago

h0pe-ay commented 11 months ago

Hi,I use qemu to start toaruos in ubuntu20.04, but I don't know how to transfer files and how to debug the program, can you tell me, thank you.

klange commented 11 months ago

Issue reports are not a place to ask questions; you should post such things in Discussions.

The fetch utility can be used to transfer files to the VM by downloading them over HTTP. Additionally, a TLS-capable version of this utility is available from the package repository, as is curl.

To transfer files from the VM to the host system, a simple utility to send a file over a plain TCP socket is provided as upload.krk - it takes a filename and an IP:port combination as arguments and can be combined with nc -l on the host system.

What programs are you hoping to debug? The dbg tool provides a simple debugger that catch signals, print rudimentary tracebacks, and display register and memory contents.

h0pe-ay commented 11 months ago

Sorry, I'll pay attention next time.I want to debug the programs I write and the applications running on toaruos, but there is no gdb on toaruos, so I don't know how to debug. And I use gcc on ubuntu to compile the program and transfer it to toaruos, can it be executed normally?

klange commented 11 months ago

but there is no gdb on toaruos, so I don't know how to debug.

ToaruOS has its own debugger, dbg.

And I use gcc on ubuntu to compile the program and transfer it to toaruos, can it be executed normally?

If you mean you literally use gcc on Ubuntu, you are building Linux applications and they will not work on ToaruOS. You need to use the ToaruOS toolchain. You can install the toolchain natively from the package manager with the build-essential metapackage and compile programs locally within the VM.