Re: Using compression from kernel mode...

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Remove all CRT header files from the compression algorithm source code.

Compile for kernel mode. Re-implement all required CRT functions until all
errors are eliminated

Replace all memory allocations with fixed buffers, as much as possible.

Test performance with compression in the kernel.

Then, re-architect the driver to interface with a user-mode application
using the blocking-ioctl method, put the compression in the user-mode app,
and then test performance.

You may find that immense amount of work in the kernel is great when the
system is doing nothing but executing your codepath, but terrible when other
applications are running. You may find that performance is terrible with
certain access-patterns exhibited by particular applications. Or, you may
find that it works better in the kernel.

But, the main reason why implementing the blocking-ioctl method is best is
that silly bugs cause simple user-mode exceptions -- process termination --
instead of re-boots. Very helpful during the development and testing phase.

After doing it this way, when it comes time to move the code into the
kernel, you might think twice... what if... at the customer site... BSOD...
right now... I catch any exceptions in user-mode, relaunch the
driver-interface thread, and recover gracefully... but what if my testing
was not 100% complete... what about getting a surprise removal when coming
out of hibernation on a multi-core cpu... while the user is pressing the F10
key... ya know... in the interests of "public safety", the only code in the
driver is code that MUST execute in kernel-mode.

Aahh... now we can all sleep at night without worrrying about scrambled hard
disks due to a silly oversight / typo / build-bug....

The only code in the kernel is code that can not execute in user-mode.

"Debabrata" <debabrata@xxxxxxxxxxxxxxx> wrote in message
news:uxPIwYeXGHA.1352@xxxxxxxxxxxxxxxxxxxxxxx
hi
well yeah....actually I am developing a virtual disk driver for FAT and
NTFS which will be capable of loading used and compressed image of a
FAT/NTFS....The compression has to be done by an application program while
my driver will decompress the image and load it.
I have been able load the used clusters image of FAT32 but now I am struct
with the compression problem..
Can you plz help me out..

Rgds

"Gary G. Little" <gary.g.little@xxxxxxxxxxx> wrote in message
news:443bc2eb$0$15431$6d36acad@xxxxxxxxxxxxxxxxxxxxx
Is there a compelling reason to do this in the kernel?

--
The personal opinion of
Gary G. Little

"Debabrata" <debabrata@xxxxxxxxxxxxxxx> wrote in message
news:Op7Lb%23WXGHA.4148@xxxxxxxxxxxxxxxxxxxxxxx
hi
I am developing a kernel mode driver in which I need to
compress/decompress huge amount of data.Now all the available
compression
libraries seem to contain the usage C run time libraries,making it
very
unsuitable for use in windows kernel mode.
Is there any compression decompression library for windows kernel
mode
environment?

Rgds








.



Relevant Pages

  • [RFC] LZO de/compression support - take 6
    ... Following compares this kernel port vs original miniLZO code: ... Compression: 41.8412 usec ... The LZO library is free software; ... GNU General Public License for more details. ...
    (Linux-Kernel)
  • [RFC] LZO de/compression support - take 5
    ... Can anyone do timing measurement in kernel space only. ... This file is part of the LZO real-time data compression library. ... The LZO library is free software; ... GNU General Public License for more details. ...
    (Linux-Kernel)
  • Re: [PATCH] Add LZO1X compression support to the kernel
    ... it`s pretty useful because it`s and a damn fast and damn cpu friendly compression alorithm. ... seems, they have also done porting it to the kernel, so there is probably choice between two implemetations to merge. ... but, from a user-perspective, lzo is really portable and seems to be a rock solid compression scheme. ... This is based on the standard userspace lzo library, ...
    (Linux-Kernel)
  • Re: reiser4 plugins
    ... >>That just means the zip plugin has to be more carefully written than I ... >>Remember that zip, at least, would not be in the kernel. ... > Doesn't matter if it is zip of some other compression, ... Can't trust the kernel at all if root is malicious. ...
    (Linux-Kernel)
  • Re: 2.6.30-rc4 kernel
    ... I think there may be a problem with the 2.6.30 kernel that is ... # Generic Driver Options ... # PCI IDE chipsets support ... # Other IDE chipsets support ...
    (Linux-Kernel)