Skip to content

Commit

Permalink
Cleaned up and finalized monitor - Drew Kersnar
Browse files Browse the repository at this point in the history
  • Loading branch information
dakersnar authored and PeterDinda committed Apr 1, 2020
1 parent 0b160de commit c438d00
Show file tree
Hide file tree
Showing 5 changed files with 263 additions and 224 deletions.
32 changes: 27 additions & 5 deletions include/nautilus/dr.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
/*
* This file is part of the Nautilus AeroKernel developed
* by the Hobbes and V3VEE Projects with funding from the
* United States National Science Foundation and the Department of Energy.
*
* The V3VEE Project is a joint project between Northwestern University
* and the University of New Mexico. The Hobbes Project is a collaboration
* led by Sandia National Laboratories that includes several national
* laboratories and universities. You can find out more at:
* http://www.v3vee.org and
* http://xstack.sandia.gov/hobbes
*
* Copyright (c) 2020, Peter Dinda <pdinda@northwestern.edu>
* Copyright (c) 2020, Drew Kersnar <drewkersnar2021@u.northwestern.edu>
* Copyright (c) 2020, The Interweaving Project <http://interweaving.org>
* The V3VEE Project <http://www.v3vee.org>
* The Hobbes Project <http://xstack.sandia.gov/hobbes>
* All rights reserved.
*
* Authors: Peter Dinda <pdinda@northwestern.edu>
* Drew Kersnar <drewkersnar2021@u.northwestern.edu>
*
* This is free software. You are permitted to use,
* redistribute, and modify it as specified in the file "LICENSE.txt".
*/

/* General access routine for the debug registers */

Expand Down Expand Up @@ -143,8 +168,7 @@ static inline void write_dr7(uint64_t data)
}


// track a single address (for long word), looking for a write to it

// track a single address (for long word), looking for a read or write to it
static inline void set_watchpoint(uint64_t addr, int dreg_num)
{
dr7_t t;
Expand Down Expand Up @@ -196,8 +220,6 @@ static inline void set_watchpoint(uint64_t addr, int dreg_num)
}

// track a single instruction address, looking for an instruction fetch


static inline void set_breakpoint(uint64_t addr, int dreg_num)
{

Expand Down Expand Up @@ -249,7 +271,7 @@ static inline void set_breakpoint(uint64_t addr, int dreg_num)
}
}


// removes a breakpoint/watchpoint
static inline void disable(int dreg_num)
{
dr7_t t;
Expand Down
25 changes: 24 additions & 1 deletion include/nautilus/monitor.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
/*
* This file is part of the Nautilus AeroKernel developed
* by the Hobbes and V3VEE Projects with funding from the
* United States National Science Foundation and the Department of Energy.
*
* The V3VEE Project is a joint project between Northwestern University
* and the University of New Mexico. The Hobbes Project is a collaboration
* led by Sandia National Laboratories that includes several national
* laboratories and universities. You can find out more at:
* http://www.v3vee.org and
* http://xstack.sandia.gov/hobbes
*
* Copyright (c) 2020, Drew Kersnar <drewkersnar2021@u.northwestern.edu>
* Copyright (c) 2020, The Interweaving Project <http://interweaving.org>
* The V3VEE Project <http://www.v3vee.org>
* The Hobbes Project <http://xstack.sandia.gov/hobbes>
* All rights reserved.
*
* Authors: Drew Kersnar <drewkersnar2021@u.northwestern.edu>
*
* This is free software. You are permitted to use,
* redistribute, and modify it as specified in the file "LICENSE.txt".
*/

void nk_monitor_init();
void nk_monitor_init_ap();

int nk_monitor_entry ();
int nk_monitor_excp_entry ();
Expand Down
1 change: 0 additions & 1 deletion src/dev/ps2.c
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,6 @@ kbd_handler (excp_entry_t * excp, excp_vec_t vec, void *state)
if (scan == 0xc3) {
// F9 up - stop
nk_monitor_entry();
//asm("int $1");

// now ignore the key
goto out;
Expand Down
2 changes: 1 addition & 1 deletion src/nautilus/idt.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ null_excp_handler (excp_entry_t * excp,

struct nk_regs * r = (struct nk_regs*)((char*)excp - 128);
nk_print_regs(r);
backtrace(r->rbp); // steal this
backtrace(r->rbp);

panic("+++ HALTING +++\n");

Expand Down
Loading

0 comments on commit c438d00

Please sign in to comment.