From: Lei Xia Date: Thu, 28 Aug 2008 19:44:19 +0000 (+0000) Subject: Add clock_time() in timer.c for uIP X-Git-Tag: 1.0~58 X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=commitdiff_plain;h=bc90ff64cfcd32d978a790f6ee70846a754fba9b;p=palacios.git Add clock_time() in timer.c for uIP --- diff --git a/palacios/src/geekos/fd_boot.asm b/palacios/src/geekos/fd_boot.asm index 2fbfd35..7aa231b 100644 --- a/palacios/src/geekos/fd_boot.asm +++ b/palacios/src/geekos/fd_boot.asm @@ -1,7 +1,7 @@ ; Boot sector for GeekOS ; Copyright (c) 2001,2004 David H. Hovemeyer ; Copyright (c) 2003, Jeffrey K. Hollingsworth -; $Revision: 1.6 $ +; $Revision: 1.7 $ ; This is free software. You are permitted to use, ; redistribute, and modify it as specified in the file "COPYING". @@ -34,6 +34,21 @@ [ORG 0x0] BeginText: ; needed to calculate padding bytes to fill the sector + ;; temporalily for io performance test + mov dx, 0x995 + mov eax, 0x12345678 + out dx, eax + mov dx, 0x999 + xor eax, eax + cpuid + rdtsc + ;; mov [time], eax + ;; mov eax, 0x12345678 + out dx, eax + cpuid + rdtsc + sub eax, [time] + out dx, eax ; Copy the boot sector into INITSEG. mov ax, BOOTSEG @@ -369,6 +384,8 @@ bootsect_dst_base: dw 0 ; ! limit16,base24 =0 dw 0,0,0,0 ; ! BIOS CS dw 0,0,0,0 ; ! BIOS DS +time: + dw 0,0 ; Padding to make the PFAT Boot Record sit just before the BIOS signature. diff --git a/palacios/src/geekos/timer.c b/palacios/src/geekos/timer.c index 7c15550..01b716d 100644 --- a/palacios/src/geekos/timer.c +++ b/palacios/src/geekos/timer.c @@ -2,7 +2,7 @@ * GeekOS timer interrupt support * Copyright (c) 2001,2003 David H. Hovemeyer * Copyright (c) 2003, Jeffrey K. Hollingsworth - * $Revision: 1.9 $ + * $Revision: 1.10 $ * * This is free software. You are permitted to use, * redistribute, and modify it as specified in the file "COPYING". @@ -164,6 +164,11 @@ pit_calibrate_tsc(void) */ volatile ulong_t g_numTicks; +ulong_t clock_time(void){ + return g_numTicks; +} + + /* * Number of times the spin loop can execute during one timer tick */