Update the console cursor position code to reflect the changes.
authorcoderain <coderain@sdf.org>
Wed, 15 Feb 2017 06:07:27 +0000 (07:07 +0100)
committercoderain <coderain@sdf.org>
Wed, 15 Feb 2017 06:07:27 +0000 (07:07 +0100)
kernel/include/device.h
kernel/src/common.c

index 671448cd8618a1dc2f5000906e41e43ebb481946..41a7a24de6a3780691efa57381485456ddea8aea 100644 (file)
@@ -136,6 +136,7 @@ dword_t register_char_device(device_t *device);
 dword_t unregister_char_device(device_t *device);
 dword_t device_read(device_t *device, void *buffer, qword_t offset, size_t length, size_t *bytes_read);
 dword_t device_write(device_t *device, const void *buffer, qword_t offset, size_t length, size_t *bytes_written);
+dword_t device_ioctl_internal(device_t *device, dword_t control_code, const void *in_buffer, size_t in_length, void *out_buffer, size_t out_length);
 dword_t device_ioctl(handle_t device, dword_t control_code, const void *in_buffer, size_t in_length, void *out_buffer, size_t out_length);
 void device_init(void);
 
index 730c20dab131996d9eff036f4914159cc2e54470..2ac10e3d5248d4ab6a88af56152786561c0e0e6d 100644 (file)
@@ -530,12 +530,13 @@ void putchar(char character)
 
     if (video_initialized)
     {
-        /*video_cursor_location_t params = {
+        video_cursor_location_t params = {
             .row = terminal_row,
             .column = terminal_col
-        };*/
+        };
 
-        // device_ioctl("Video0", IOCTL_VIDEO_SET_TEXT_CURSOR, &params, sizeof(params), NULL, 0);
+        device_t *video_device = get_char_device("Video0");
+        if (video_device) device_ioctl_internal(video_device, IOCTL_VIDEO_SET_TEXT_CURSOR, &params, sizeof(params), NULL, 0);
     }
     else
     {