OSDev.org

The Place to Start for Operating System Developers
It is currently Mon Apr 29, 2024 12:44 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: How to debug using serial port in VMWARE Workstation Player
PostPosted: Fri Jun 16, 2023 10:36 pm 
Offline
Member
Member

Joined: Fri Feb 11, 2022 4:55 am
Posts: 435
Location: behind the keyboard
I fixed the bug that made the os triple fault on VMWare and Real hardware which I knew after I unmapped the NULL page. Executing (struct abc*)x = {0} Caused weird behaviour in the compiler.

Now it works fine, on every platform you can name but. It gets stuck in the acpi driver in real hardware and vmware.
Im gonna start using vmware as a test VM because it emulates the exact same problems that I face on real hardware, and its also faster. VBOX, QEMU and the others are trash lol.

On QEMU and VBOX I debug using serial com1. I just write things and it appears in the serial file. However I tried using serial with VMWare and it shows nothing. I even tried writing to every serial port u could name and it started showing some weird hexadecimal characters in the file.

So, How do I debug using VMWare on Windows 11 ?
Sorry for the misleading title, the debug don't have to be through serial


Top
 Profile  
 
 Post subject: Re: How to debug using serial port in VMWARE Workstation Pla
PostPosted: Fri Jun 16, 2023 11:56 pm 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4597
Location: Chichester, UK
https://www.triplefault.io/2017/07/setu ... gdb_9.html


Top
 Profile  
 
 Post subject: Re: How to debug using serial port in VMWARE Workstation Pla
PostPosted: Sat Jun 17, 2023 12:30 am 
Offline
Member
Member

Joined: Fri Feb 11, 2022 4:55 am
Posts: 435
Location: behind the keyboard
I already know that however I have the permanently free version.

I think maybe I will just make kernel mode console just like every operating system.


Top
 Profile  
 
 Post subject: Re: How to debug using serial port in VMWARE Workstation Pla
PostPosted: Sat Jun 17, 2023 2:57 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5146
devc1 wrote:
Executing (struct abc*)x = {0} Caused weird behaviour in the compiler.

That doesn't look like valid C++ code to me. Are you sure the compiler wasn't doing exactly what you told it to do?

devc1 wrote:
However I tried using serial with VMWare and it shows nothing. I even tried writing to every serial port u could name and it started showing some weird hexadecimal characters in the file.

Did you configure your virtual machine to output the data from the serial port to a file?

Did you initialize the serial port before you tried writing characters to it?


Top
 Profile  
 
 Post subject: Re: How to debug using serial port in VMWARE Workstation Pla
PostPosted: Sun Jun 18, 2023 4:26 pm 
Offline
Member
Member

Joined: Fri Feb 11, 2022 4:55 am
Posts: 435
Location: behind the keyboard
Code:
That doesn't look like valid C++ code to me. Are you sure the compiler wasn't doing exactly what you told it to do?


The compiler didn't complain but it caused weird behaviour that led to a page fault. Don't worry I already told you I fixed that.

I configured it to output from serial but I do not initialize serial ports, maybe I should try to do so !


Top
 Profile  
 
 Post subject: Re: How to debug using serial port in VMWARE Workstation Pla
PostPosted: Sun Jun 18, 2023 4:32 pm 
Offline
Member
Member

Joined: Fri Feb 11, 2022 4:55 am
Posts: 435
Location: behind the keyboard
Thank you now it works. I knew I needed to initialize COM1 i was just a bit lazy


Top
 Profile  
 
 Post subject: Re: How to debug using serial port in VMWARE Workstation Pla
PostPosted: Sun Jun 18, 2023 4:32 pm 
Offline
Member
Member

Joined: Fri Feb 11, 2022 4:55 am
Posts: 435
Location: behind the keyboard
ACPICA gives this message for VMWARE:

Firmware Warning (ACPI):
Incorrect checksum in table [] - 0xFFFF8000016C2108, should be 0xFFFF8000016C2120
(20230331/utcksum-212)

I guess my string formatting function is wrong, I need to fix it first maybe


Top
 Profile  
 
 Post subject: Re: How to debug using serial port in VMWARE Workstation Pla
PostPosted: Mon Jun 19, 2023 6:50 am 
Offline
Member
Member

Joined: Fri Feb 11, 2022 4:55 am
Posts: 435
Location: behind the keyboard
I found out later that the problem was in my OsLayer in OsMapMemory

instead of :
Code:
        return (void*)((UINT64)Vmem + (Where & 0xFFF));



I did :
Code:
return Vmem;


Humans forget !


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], Google [Bot], SemrushBot [Bot] and 21 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group