Panic message goes in log over serial port.

Qemu launch script.
This commit is contained in:
jief666 2020-09-04 00:35:36 +03:00
parent efb3c44b0f
commit 87bc06495c
2 changed files with 17 additions and 3 deletions

View File

@ -24,8 +24,13 @@ set -x
if [ "$OSTYPE" = "Darwin" ]
then
if ! [ -f ./Qemu/qemu_portable/qemu-system-x86_64 ]
then
if ! [ -f /usr/local/bin/qemu-system-x86_64 ]
then
echo "You must install Qemu with \"brew install qemu\"", or restore the folder \'qemu_portable\'
exit 1
fi
echo "You must install Qemu with \"brew install qemu\""
exit 1
fi
@ -65,8 +70,8 @@ then
set -m
cd "$SCRIPT_DIR"
/usr/local/bin/qemu-system-x86_64 \
-L . \
./qemu_portable/qemu-system-x86_64 \
-L qemu_portable \
-m 2048 \
-cpu core2duo \
-bios ./bios.bin-1.13.0 \

View File

@ -25,12 +25,21 @@ static void panic_(const char* format, VA_LIST va)
#endif
;
#define FATAL_ERROR_MSG "\nA fatal error happened. System halted.\n"
static void panic_(const char* format, VA_LIST va)
{
if ( format ) {
vprintf(format, va);
#ifdef DEBUG_ON_SERIAL_PORT
char buf[500];
vsnprintf(buf, sizeof(buf)-1, format, va);
SerialPortWrite((UINT8*)buf, strlen(buf));
#endif
}
printf("A fatal error happened. System halted\n");
printf(FATAL_ERROR_MSG);
#ifdef DEBUG_ON_SERIAL_PORT
SerialPortWrite((UINT8*)FATAL_ERROR_MSG, strlen(FATAL_ERROR_MSG));
#endif
while (1) { // this will avoid warning : Function declared 'noreturn' should not return
CpuDeadLoop();
}