Better testing for random
This commit is contained in:
parent
e8b2c1ae56
commit
70f78dfa26
1 changed files with 6 additions and 4 deletions
10
kern/start.c
10
kern/start.c
|
|
@ -1,11 +1,11 @@
|
||||||
#include <endian.h>
|
|
||||||
#include <badrand.h>
|
|
||||||
#include <hexdump.h>
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
#include <badrand.h>
|
||||||
#include <banner.h>
|
#include <banner.h>
|
||||||
#include <buddy.h>
|
#include <buddy.h>
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
#include <endian.h>
|
||||||
#include <freelist.h>
|
#include <freelist.h>
|
||||||
|
#include <hexdump.h>
|
||||||
#include <memory.h>
|
#include <memory.h>
|
||||||
#include <panic.h>
|
#include <panic.h>
|
||||||
#include <proc.h>
|
#include <proc.h>
|
||||||
|
|
@ -100,8 +100,10 @@ void start() {
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
char buffer[128];
|
char buffer[128];
|
||||||
|
memset(buffer, 0, 128);
|
||||||
|
assert(!looks_random(buffer, 128));
|
||||||
badrand_buf(buffer, 128);
|
badrand_buf(buffer, 128);
|
||||||
hexdump(buffer, 128);
|
assert(looks_random(buffer, 128));
|
||||||
}
|
}
|
||||||
|
|
||||||
kprintf("To exit qemu, press CTRL+a followed by x\n");
|
kprintf("To exit qemu, press CTRL+a followed by x\n");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue