From 2e850e52f6ad1a7560329d7a842acad34b113c94 Mon Sep 17 00:00:00 2001 From: "Evgeny Grechnikov (Diamond)" Date: Wed, 4 Oct 2006 14:35:44 +0000 Subject: [PATCH] hd_drv.inc: now code should work correctly on any computer kernel32.inc: added 'dbgstr' macro which may be useful for kernel debugging git-svn-id: svn://kolibrios.org@162 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/blkdev/hd_drv.inc | 18 ++++++++++-------- kernel/trunk/kernel32.inc | 25 +++++++++++++++++++++++++ kernel/trunk/kglobals.inc | 9 +++++++++ 3 files changed, 44 insertions(+), 8 deletions(-) diff --git a/kernel/trunk/blkdev/hd_drv.inc b/kernel/trunk/blkdev/hd_drv.inc index c05c57deba..44e1d5c513 100755 --- a/kernel/trunk/blkdev/hd_drv.inc +++ b/kernel/trunk/blkdev/hd_drv.inc @@ -130,17 +130,19 @@ hd_read_pio: ret disable_ide_int: - mov edx,[hdbase] - add edx,0x206 - mov al,2 - out dx,al +; mov edx,[hdbase] +; add edx,0x206 +; mov al,2 +; out dx,al + cli ret enable_ide_int: - mov edx,[hdbase] - add edx,0x206 - mov al,0 - out dx,al +; mov edx,[hdbase] +; add edx,0x206 +; mov al,0 +; out dx,al + sti ret align 4 diff --git a/kernel/trunk/kernel32.inc b/kernel/trunk/kernel32.inc index ea1c6bdf67..0e85042d80 100644 --- a/kernel/trunk/kernel32.inc +++ b/kernel/trunk/kernel32.inc @@ -50,6 +50,31 @@ macro diff16 title,l1,l2 display 13,10 } +; \begin{diamond}[29.09.2006] +; may be useful for kernel debugging +; example 1: +; dbgstr 'Hello, World!' +; example 2: +; dbgstr 'Hello, World!', save_flags +macro dbgstr string*, f +{ +local a +iglobal_nested +a db 'K : ',string,13,10,0 +endg_nested +if ~ f eq + pushfd +end if + push esi + mov esi, a + call sys_msg_board_str + pop esi +if ~ f eq + popfd +end if +} +; \end{diamond}[29.09.2006] + struc db [a] { common . db a if ~used . display 'not used db: ',`.,13,10 diff --git a/kernel/trunk/kglobals.inc b/kernel/trunk/kglobals.inc index 75688d765d..68276a10c7 100644 --- a/kernel/trunk/kglobals.inc +++ b/kernel/trunk/kglobals.inc @@ -5,6 +5,10 @@ macro iglobal { IGlobals equ IGlobals, macro __IGlobalBlock { } +macro iglobal_nested { + IGlobals equ IGlobals, + macro __IGlobalBlock \{ } + ;------------------------------------------------------------- ; use 'uglobal' for inserting uninitialized global definitions. ; even when you define some data values, these variables @@ -14,7 +18,12 @@ macro uglobal { UGlobals equ UGlobals, macro __UGlobalBlock { } +macro uglobal_nested { + UGlobals equ UGlobals, + macro __UGlobalBlock \{ } + endg fix } ; Use endg for ending iglobal and uglobal blocks. +endg_nested fix \} macro IncludeIGlobals{ macro IGlobals dummy,[n] \{ __IGlobalBlock