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.
This commit is contained in:
Ben Gras 2006-03-13 13:21:13 +00:00
parent b3f969af94
commit 1a7f7d6333
3 changed files with 14 additions and 8 deletions

View File

@ -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.
*/

View File

@ -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;
}

View File

@ -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 */
}