use of C library in operating systems
The kernel of the system doesn't use the C library (at least not it's I/O facilities).

The kernel does offer system calls like read(3) and write(3) in Unix, and translates them into whatever magic the underlying hardware requires to do this. For example, as a very rough description of how this goes, to write to a serial port, the kernel copies the individual bytes to the serial port's register, signals that a new character is ready to transmit, and waits for it to be shipped off before placing the next one there. To write into a file the kernel keeps track of where the writing to the file has to take place, asks for space in the underlying device if the file will grow, and writes into the allocated space. Each filessystem has its own (rather complex) data structures on disk and in memory to keep track of free and allocated space, and so on. To manipulate it (and the underlying blocks on disk) usually another complex layer talking to the hardware is interposed.

Thus one way of looking at an operating system kernel is as a huge library offering nifty functions (system calls) that allow the programmer to access complex, even under the hood radically different functionalities, by a simple interface. That the programmer uses the convenience of the standard C library, some other language's library, or even chooses to write the system calls directly in assembler, is irrelevant.

The kernel does write messages on occasion. For this it has internal functions (in the case of e.g. Linux it is printk that mimics printf(3)) to do this by tickling the underlying hardware the right way.