mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 16:52:43 +00:00 
			
		
		
		
	 8cbb7f101f
			
		
	
	
		8cbb7f101f
		
	
	
	
	
		
			
			This will allow us to implement different behaviors depending on the role of the descriptor a File is being accessed through.
		
			
				
	
	
		
			28 lines
		
	
	
	
		
			487 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
	
		
			487 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| #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(FileDescriptor&, const byte* data, ssize_t data_size)
 | |
| {
 | |
|     for (int i = 0; i < data_size; ++i)
 | |
|         IO::out8(0xe9, data[i]);
 | |
|     return data_size;
 | |
| }
 | |
| 
 |