Sending content to vt_windows during vt_replace_backend in vt_core.c

My understanding is that at this point in the boot up cycle, one cannot do something like:

C:
fd=open("/dev/ttyv3", O_WRONLY); // greatly simplified C code
write(fd, "hi\n", 4); // don't try this at home

If I wanted to send text to various TTYs, what interface might I use? I noticed that terminal.h provides a putc implementation, but I'm not sure whether this is necessary. If anyone can save me barking up the wrong tree, I'd be thankful.

Let me share my aim: I've made it possible to specify the console VT to an option set in your kernel build. I've made is possible to switch to another VT that's not getting all the hardware probe + init noise. In that (blank) console that's waiting for getty to finish, I'd like to put something like "System initializing" in (say) green (preferably with a blinking cursor too).
 
right, you're running in kernel mode, and open is a user-space C runtime function. taking a quick look at vt_core.c you might want to try vtterm_copy to put text on the screen. not sure how that'll interact with colors and getty, but it's where we'd start.
 
right, you're running in kernel mode, and open is a user-space C runtime function. taking a quick look at vt_core.c you might want to try vtterm_copy to put text on the screen. not sure how that'll interact with colors and getty, but it's where we'd start.
Super-excellent. I've never done any kernel work before and am really enjoying it. Thanks for the leg-up!
 
Back
Top