Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run.bat script not working #3

Open
brennennen opened this issue Feb 2, 2021 · 1 comment
Open

run.bat script not working #3

brennennen opened this issue Feb 2, 2021 · 1 comment

Comments

@brennennen
Copy link

After watching your youtube video, I couldn't get "run.bat" to work without some intervention. I'm thinking it's because my working directory is on another drive?

Error:
qemu-system-x86_64: -drive file="D:\repositories\sandbox\projects\c\poncho_os\kernel\run.bat"/../bin/CustomOS.img: Unknown protocol '"D'

D:\repositories\sandbox\projects\c\poncho_os\kernel>set OSNAME=CustomOS

D:\repositories\sandbox\projects\c\poncho_os\kernel>set BUILDDIR="D:\repositories\sandbox\projects\c\poncho_os\kernel\run.bat"/../bin

D:\repositories\sandbox\projects\c\poncho_os\kernel>set OVMFDIR="D:\repositories\sandbox\projects\c\poncho_os\kernel\run.bat"/../../OVMFbin

D:\repositories\sandbox\projects\c\poncho_os\kernel>qemu-system-x86_64 -drive file="D:\repositories\sandbox\projects\c\poncho_os\kernel\run.bat"/../bin/CustomOS.img -m 256M -cpu qemu64 -drive if=pflash,format=raw,unit=0,file=""D:\repositories\sandbox\projects\c\poncho_os\kernel\run.bat"/../../OVMFbin/OVMF_CODE-pure-efi.fd",readonly=on -drive if=pflash,format=raw,unit=1,file=""D:\repositories\sandbox\projects\c\poncho_os\kernel\run.bat"/../../OVMFbin/OVMF_VARS-pure-efi.fd" -net none
qemu-system-x86_64: -drive file="D:\repositories\sandbox\projects\c\poncho_os\kernel\run.bat"/../bin/CustomOS.img: Unknown protocol '"D'

D:\repositories\sandbox\projects\c\poncho_os\kernel>pause
Press any key to continue . . .

I got it running by cleaning up the double quotes that got inserted around the %0. I also had to clean up funky quote placement on the "-drive" arguments.

set OSNAME=CustomOS
set WORKING_FILE=%0
:: remove double quotes that are around "%0" or builddir and ovmfdir get ugly
set FIXED_WORKING_FILE=%WORKING_FILE:"=%
set BUILDDIR=%FIXED_WORKING_FILE%/../bin
set OVMFDIR=%FIXED_WORKING_FILE%/../../OVMFbin

qemu-system-x86_64 -drive "file=%BUILDDIR%/%OSNAME%.img" -m 256M -cpu qemu64 -drive "if=pflash,format=raw,unit=0,file=%OVMFDIR%/OVMF_CODE-pure-efi.fd,readonly=on" -drive "if=pflash,format=raw,unit=1,file=%OVMFDIR%/OVMF_VARS-pure-efi.fd" -net none
pause
@RedstonedLife
Copy link

I have created a pull request that fixes the issue so that new comers will have the fixed run.bat instead of the broken one.
I hope this helps future learners

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants