Posts

Using Overlapped I / O in DeviceIoControl

Image
Using Overlapped I / O in DeviceIoControl Various methods can be used, such as  synchronizing with events and continuously receiving events through polling, to monitor the frequent events in the kernel driver one by one in user mode  . Scenario in question Imagine that you continue to receive events with relatively simple polling.  The kernel driver queues the event that occurred, and the user mode application issues the IOCTL to retrieve the contents of the queue.  In this type of logic, the user-mode application will  While execute the same loop as  DeviceIoControl and will continue to communicate with the driver by calling. while ( true ) { BOOL ret = DeviceIoControl(hDevice, IOCTL_RECV, &data, sizeof (DATA), 0 , 0 ,&dwReturn, NULL ); if (ret) { // 처리.. } } DeviceIoControl Blocking 발생 In the previously used logic,  DeviceIoControl blocking occurs  until an event occurs in the kernel driver  ....

Enabling Com Port on Hyper-V 2nd Generation VM / Windbg

Image
To test the UEFI boot environment, I created a second generation virtual machine in Hyper-V. And I had to configure the Com port to attach the kernel debugger.  However, the Com Port device was not visible in the 2nd generation Hyper-V VM.  Invisible Com port device Hyper-V 2nd generation VM must be assigned a pipe to the Com port to be visible in the device list. 1. VM termination First, shut down the VM before working. 2. Run as Powrshell administrator Detailed configuration of Hyper-V VM can be done through Powershell command.  Run Powershell with administrator privileges.  3. set-vmcomport  Run the following command to activate the com port. set -vmcomport -vmname [VM이름] -number [COM포트번호] [파이프이름] To check the COM port to which the pipe is assigned, execute the following command. get -vmcomport -vmname [VM이름] The following is an example of command execution.  https://docs.microsoft.com/en-us/powershell/module/hyper-v/...

Installing CentOS7 NodeJS source compilation / v12.16.1 LTS

Image
0. Installation environment (g ++ 6.3.x) CentOS 7 has gcc version 4.8 installed by default.  However, nodejs build environment requires version 6.3 or higher. Please refer to the following link to install version 6.3. https://lucidmaj7.tistory.com/144   Installing CentOS7 GCC 6.x devtoolset-6 Installing CentOS7 GCC 6.x Installing GCC on CentOS 7 will install version 4.8.5.   In some cases, you may need to install a higher version.   The following is how to install GCC, G ++ 6.x version.   $ sudo yum install .. lucidmaj7.tistory.com   1. Download NodeJS source Connect to the NodeJS homepage and download the source of the LTS version using the wget command. https://nodejs.org/en/download/   Download |   Node.js Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. nodejs.org [root@localhost ~] # wget https: //nodejs.org/dist/v12.16.1/node-v12.16.1.tar.gz 2. Decompression Unzip ...

Installing CentOS7 GCC 6.x

Installing CentOS7 GCC 6.x Installing GCC on CentOS 7 will install version 4.8.5.  In some cases, you may need to install a higher version. The following is how to install GCC, G ++ 6.x version. $ sudo yum install centos- release -scl $ sudo yum install devtoolset- 6 After installation, enable gcc 6 with the command below.  The command below should be run every time you use gcc 6. $ scl enable devtoolset-6 bash You can check the installed version through the GCC command. [root@localhost ~] # gcc --version gcc (GCC) 6.3 .1 20170216 (Red Hat 6.3 .1 -3 ) Copyright (C) 2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. [root@localhost ~] # g++ --version g++ (GCC) 6.3 .1 20170216 (Red Hat 6.3 .1 -3 ) Copyright (C) 2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. Ther...

What is a driver?

driver The driver is ... So long ago, I needed something to buy and use a new device on my computer.  In the box of the new device you purchased, the manual and warranty card are enclosed, and a floppy disk or CD-ROM is included.  You could use the device by inserting a floppy disk or CD into the computer and installing something.  This is a device driver program.  Device drivers make certain devices available to your computer. When you hear the word driver, the first thing that comes to mind is not a program.  A screwdriver that turns like a screw comes to mind first.  It is a computer term that is not translated into Korean.  It confuses us from here.  It is a word that reads a book and goes to MDSN to learn the concept, but does not reach the heart.  However, fortunately, the friends in the north translated it in Korean and used it as "device driver" or "device driver program".  Their interpretation is probably kneeling!  It...

Json_encode function to print php json indent

Image
When encoding an associative array to json using the json_encode function in php, it is output as a single line without indentation. <?php $arr[ 'user' ] = "kim" ; $arr[ 'age' ] = "15" ; $arr[ 'phone_number' ] = "1111-1111" ; echo json_encode($arr); ?> Results If the JSON is long, you can use a site that sorts JSON because it is very hard to see. https://jsonformatter.curiousconcept.com/   JSON Formatter & Validator Format and validate JSON data so that it can easily be read by human beings. jsonformatter.curiousconcept.com This json encoding process is provided in php's json_encode by default. Just give JSON_PRETTY_PRINT as the second argument of json_encode. This argument has been supported since php 5.4. <?php $arr[ 'user' ] = "kim" ; $arr[ 'age' ] = "15" ; $arr[ 'phone_number...