Subversion Repositories shark

Rev

Blame | Last modification | View Log | RSS feed

/*
 * Project: HARTIK (HA-rd R-eal TI-me K-ernel)
 *
 * Coordinators: Giorgio Buttazzo <giorgio@sssup.it>
 *               Gerardo Lamastra <gerardo@sssup.it>
 *
 * Authors     : Paolo Gai <pj@hartik.sssup.it>
 * (see authors.txt for full list of hartik's authors)
 *
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
 *
 * http://www.sssup.it
 * http://retis.sssup.it
 * http://hartik.sssup.it
 */


/**
 ------------
 CVS :        $Id: tests.c,v 1.1.1.1 2002-09-02 09:37:48 pj Exp $

 File:        $File$
 Revision:    $Revision: 1.1.1.1 $
 Last update: $Date: 2002-09-02 09:37:48 $
 ------------

 memtest.c:

   try to allocate different regions of memory...

**/


/*
 * Copyright (C) 2000 Paolo Gai
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */


#include "kernel/kern.h"

int main(int argc, char **argv)
{
  void *a;

  kern_cli(); a = DOS_alloc(4500); kern_sti();
  kern_printf("below 1 M: %ld\n", (DWORD)a);

  kern_cli(); a = kern_alloc_aligned(10000,MEMORY_UNDER_16M,10,0); kern_sti();
  kern_printf("below 16M: %ld\n", (DWORD)a);

  kern_cli(); a = kern_alloc_aligned(10000,MEMORY_FROM_1M_TO_16M,2,0); kern_sti();
  kern_printf(">1M <16M : %ld\n", (DWORD)a);

  kern_cli(); a = kern_alloc(10000); kern_sti();
  kern_printf("normal   : %ld\n", (DWORD)a);

  kern_cli(); a = kern_alloc_page(MEMORY_UNDER_1M); kern_sti();
  kern_printf("page <1M : %ld\n", (DWORD)a);

  kern_cli(); a = kern_alloc_page(MEMORY_FROM_1M_TO_16M); kern_sti();
  kern_printf("p>1<16M  : %ld\n", (DWORD)a);

  kern_cli(); a = kern_alloc_page(0); kern_sti();
  kern_printf("page     : %ld\n", (DWORD)a);

  return 0;
}