Skip to content

Commit c612fe2

Browse files
committed
latest code
1 parent d253ac2 commit c612fe2

18 files changed

+113
-13
lines changed

.tmp_versions/cryptctl_driver.mod

Lines changed: 0 additions & 3 deletions
This file was deleted.

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
obj-m := cryptctl_driver.o
2-
KDIR := /lib/modules/$(shell uname -r)/build
3-
PWD := $(shell pwd)
4-
default:
5-
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
1+
driver:
2+
make -f makefile.driver
3+
4+
crypt_main:
5+
make -f makefile.crypt_main

a.out

-13.1 KB
Binary file not shown.

crypt_main

28.2 KB
Binary file not shown.

crypt_main.c

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
#include <sys/stat.h>
88
#include <fcntl.h>
99
#include<unistd.h>
10+
#include "io_api.h"
11+
12+
13+
//int write_unicode(char* buffer´, int file
1014

1115
int main(int argc, char** argv)
1216
{
@@ -107,7 +111,7 @@ int main(int argc, char** argv)
107111
char dev_name2[1024];
108112
char input[3072];
109113
strcpy(dev_name1,ENCRYPT_DEV_PATH);
110-
strcpy( input ,argv[3]);
114+
strcpy(input, argv[3]);
111115
strcat(dev_name1, argv[2]);
112116
printf("opening this file: %s\n", dev_name1);
113117
int control_file = open(dev_name1, O_RDWR | O_NONBLOCK);
@@ -135,7 +139,13 @@ int main(int argc, char** argv)
135139
perror("close");
136140
return -1;
137141
}
138-
printf("write output:%s\n", input);
142+
// printf("write output:%s\n", input);
143+
int i = 0;
144+
while(i<strlen(input))
145+
{
146+
printf("%d\n",input[i]);
147+
i++;
148+
}
139149
printf("File closed. Done.\n");
140150

141151
}
@@ -174,7 +184,13 @@ int main(int argc, char** argv)
174184
perror("close");
175185
return -1;
176186
}
177-
printf("write output:%s\n", input);
187+
// printf("write output:%s\n", input);
188+
int i =0;
189+
while(i<strlen(input))
190+
{
191+
printf("%d\n",input[i]);
192+
i++;
193+
}
178194
printf("File closed. Done.\n");
179195

180196
}

crypt_main.o

18.6 KB
Binary file not shown.

cryptctl_driver.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,9 @@ int init_module(void)
216216
void cleanup_module(void)
217217
{
218218
// unregister_chrdev(driver_major, CRYPTCTL_NAME);
219+
unregister_chrdev_region(cryptctl_dev, DEVICE_RECORDS_SIZE * 2 );
219220
destroy_char_dev(driver_major,driver_minor,&cryptctl);
221+
class_destroy(crypt_class);
220222
printk("Device was unregustered. See ya later alligator");
221223
return 0;
222224
}

cryptctl_driver.ko

104 Bytes
Binary file not shown.

cryptctl_driver.mod.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ __attribute__((section(".modinfo"))) =
2525
"depends=";
2626

2727

28-
MODULE_INFO(srcversion, "6E422632E37730FD63FD5F4");
28+
MODULE_INFO(srcversion, "BE62A1F7BEC1EEF73CC687E");

cryptctl_driver.mod.o

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)