From: Ben Gras Date: Mon, 13 Mar 2006 13:21:13 +0000 (+0000) Subject: at_wini: removed RO_BIT misfeature, not used any more X-Git-Tag: v3.1.2a~250 X-Git-Url: http://zhaoyanbai.com/repos/dnssec-verify.html?a=commitdiff_plain;h=1a7f7d63338a274a1494fcbb0f90a8f98fdfa054;p=minix.git at_wini: removed RO_BIT misfeature, not used any more pm: fixed rebooting by making a copy of the monitor code from the user process. this is necessary because that process is dead by the time sys_abort() is called. also added more info to the "can't reply" panic. --- diff --git a/drivers/at_wini/at_wini.c b/drivers/at_wini/at_wini.c index 7b8069c58..4273ce55a 100644 --- a/drivers/at_wini/at_wini.c +++ b/drivers/at_wini/at_wini.c @@ -681,9 +681,6 @@ message *m_ptr; return(EACCES); #endif - /* If it's not an ATAPI device, then don't open with RO_BIT. */ - if (!(wn->state & ATAPI) && (m_ptr->COUNT & RO_BIT)) return EACCES; - /* Partition the drive if it's being opened for the first time, * or being opened after being closed. */ diff --git a/servers/pm/main.c b/servers/pm/main.c index 1e01a013d..9d1c0de89 100644 --- a/servers/pm/main.c +++ b/servers/pm/main.c @@ -89,8 +89,9 @@ PUBLIC int main() if ((rmp->mp_flags & (REPLY | ONSWAP | IN_USE | ZOMBIE)) == (REPLY | IN_USE)) { if ((s=send(rmp->mp_endpoint, &rmp->mp_reply)) != OK) { - panic(__FILE__,"PM can't reply to", - rmp->mp_endpoint); + printf("PM can't reply to %d (%s)\n", + rmp->mp_endpoint, rmp->mp_name); + panic(__FILE__, "PM can't reply", NO_NUM); } rmp->mp_flags &= ~REPLY; } diff --git a/servers/pm/misc.c b/servers/pm/misc.c index b71adfa95..2a5d99e1b 100644 --- a/servers/pm/misc.c +++ b/servers/pm/misc.c @@ -171,7 +171,7 @@ PUBLIC int do_getprocnr() *===========================================================================*/ PUBLIC int do_reboot() { - char monitor_code[32*sizeof(char *)]; + char monitor_code[256]; vir_bytes code_addr; int code_size; int abort_flag; @@ -183,7 +183,14 @@ PUBLIC int do_reboot() abort_flag = (unsigned) m_in.reboot_flag; if (abort_flag >= RBT_INVALID) return(EINVAL); if (RBT_MONITOR == abort_flag) { - code_addr = (vir_bytes) m_in.reboot_code; + int r; + if(m_in.reboot_strlen >= sizeof(monitor_code)) + return EINVAL; + if((r = sys_datacopy(who_e, (vir_bytes) m_in.reboot_code, + SELF, (vir_bytes) monitor_code, m_in.reboot_strlen)) != OK) + return r; + code_addr = (vir_bytes) monitor_code; + monitor_code[m_in.reboot_strlen] = '\0'; code_size = m_in.reboot_strlen + 1; } @@ -203,7 +210,8 @@ PUBLIC int do_reboot() /* Ask the kernel to abort. All system services, including the PM, will * get a HARD_STOP notification. Await the notification in the main loop. */ - sys_abort(abort_flag, who_e, code_addr, code_size); + sys_abort(abort_flag, PM_PROC_NR, code_addr, code_size); + printf("sys_abort called\n"); return(SUSPEND); /* don't reply to caller */ }