character device driver using semaphore