Subversion Repositories shark

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1120 pj 1
/*
2
 * Project: S.Ha.R.K.
3
 *
4
 * Coordinators:
5
 *   Giorgio Buttazzo    <giorgio@sssup.it>
6
 *   Paolo Gai           <pj@gandalf.sssup.it>
7
 *
8
 * Authors     :
9
 *   Paolo Gai           <pj@gandalf.sssup.it>
10
 *   (see the web pages for full authors list)
11
 *
12
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
13
 *
14
 * http://www.sssup.it
15
 * http://retis.sssup.it
16
 * http://shark.sssup.it
17
 */
18
 
19
/*
20
 * Copyright (C) 2000 Giorgio Buttazzo, Paolo Gai
21
 *
22
 * This program is free software; you can redistribute it and/or modify
23
 * it under the terms of the GNU General Public License as published by
24
 * the Free Software Foundation; either version 2 of the License, or
25
 * (at your option) any later version.
26
 *
27
 * This program is distributed in the hope that it will be useful,
28
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
29
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
30
 * GNU General Public License for more details.
31
 *
32
 * You should have received a copy of the GNU General Public License
33
 * along with this program; if not, write to the Free Software
34
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
35
 *
36
 *
37
 * CVS :        $Id: memtest.c,v 1.1 2002-11-11 08:22:46 pj Exp $
38
 */
39
 
40
/*
41
 * Copyright (C) 2000 Paolo Gai
42
 *
43
 * This program is free software; you can redistribute it and/or modify
44
 * it under the terms of the GNU General Public License as published by
45
 * the Free Software Foundation; either version 2 of the License, or
46
 * (at your option) any later version.
47
 *
48
 * This program is distributed in the hope that it will be useful,
49
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
50
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
51
 * GNU General Public License for more details.
52
 *
53
 * You should have received a copy of the GNU General Public License
54
 * along with this program; if not, write to the Free Software
55
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
56
 *
57
 */
58
 
59
#include <kernel/kern.h>
60
#include <stdlib.h>
61
 
62
int main(int argc, char **argv)
63
{
64
  void *a;
65
 
66
  clear();
67
 
68
  a = malloc(4500);
69
  cprintf("malloc   : %ld\n", (DWORD)a);
70
  free(a);
71
 
72
  kern_cli(); a = DOS_alloc(4500); kern_sti();
73
  cprintf("below 1 M: %ld\n", (DWORD)a);
74
  kern_cli(); DOS_free(a,4500); kern_sti();
75
 
76
  kern_cli(); a = kern_alloc_aligned(10000,MEMORY_UNDER_16M,10,0); kern_sti();
77
  cprintf("below 16M: %ld\n", (DWORD)a);
78
  kern_cli(); kern_free(a,10000); kern_sti();
79
 
80
  kern_cli(); a = kern_alloc_aligned(10000,MEMORY_FROM_1M_TO_16M,2,0); kern_sti();
81
  cprintf(">1M <16M : %ld\n", (DWORD)a);
82
  kern_cli(); kern_free(a,10000); kern_sti();
83
 
84
  kern_cli(); a = kern_alloc(10000); kern_sti();
85
  cprintf("normal   : %ld\n", (DWORD)a);
86
  kern_cli(); kern_free(a,10000); kern_sti();
87
 
88
  kern_cli(); a = kern_alloc_page(MEMORY_UNDER_1M); kern_sti();
89
  cprintf("page <1M : %ld\n", (DWORD)a);
90
  kern_cli(); kern_free_page(a); kern_sti();
91
 
92
  kern_cli(); a = kern_alloc_page(MEMORY_FROM_1M_TO_16M); kern_sti();
93
  cprintf("p>1<16M  : %ld\n", (DWORD)a);
94
  kern_cli(); kern_free_page(a); kern_sti();
95
 
96
  kern_cli(); a = kern_alloc_page(0); kern_sti();
97
  cprintf("page     : %ld\n", (DWORD)a);
98
  kern_cli(); kern_free_page(a); kern_sti();
99
 
100
  return 0;
101
}