mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 20:22:45 +00:00 
			
		
		
		
	Kernel+LibC: Add a DebugLogDevice that forwards everything to I/O port 0xe9.
This is then used to implement the userspace dbgprintf() in a far more efficient way than what we had before. :^)
This commit is contained in:
		
							parent
							
								
									3b986da643
								
							
						
					
					
						commit
						3817f5f619
					
				
					 7 changed files with 61 additions and 7 deletions
				
			
		
							
								
								
									
										28
									
								
								Kernel/Devices/DebugLogDevice.cpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								Kernel/Devices/DebugLogDevice.cpp
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,28 @@ | |||
| #include <Kernel/Devices/DebugLogDevice.h> | ||||
| #include <Kernel/IO.h> | ||||
| 
 | ||||
| static DebugLogDevice* s_the; | ||||
| 
 | ||||
| DebugLogDevice& DebugLogDevice::the() | ||||
| { | ||||
|     ASSERT(s_the); | ||||
|     return *s_the; | ||||
| } | ||||
| 
 | ||||
| DebugLogDevice::DebugLogDevice() | ||||
|     : CharacterDevice(1, 18) | ||||
| { | ||||
|     s_the = this; | ||||
| } | ||||
| 
 | ||||
| DebugLogDevice::~DebugLogDevice() | ||||
| { | ||||
| } | ||||
| 
 | ||||
| ssize_t DebugLogDevice::write(Process&, const byte* data, ssize_t data_size) | ||||
| { | ||||
|     for (int i = 0; i < data_size; ++i) | ||||
|         IO::out8(0xe9, data[i]); | ||||
|     return data_size; | ||||
| } | ||||
| 
 | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling