ebp (base pointer) register is associated with the stack primarily by software convention. On entry to a C function, the function’s prologue code normally saves the previous function’s base pointer by pushing it onto the stack, and then copies the current
esp value into
ebp for the duration of the function. If all the functions in a program obey this convention, then at any given point during the program’s execution, it is possible to trace back through the stack by following the chain of saved
ebp pointers and determining exactly what nested sequence of function calls caused this particular point in the program to be reached. This capability can be particularly useful, for example, when a particular function causes an
assert failure or
panic because bad arguments were passed to it, but you aren’t sure who passed the bad arguments. A stack backtrace lets you find the offending function.
在linux console显示各种颜色的信息可以使用特殊的符号串：escape sequence code.通过使用escape sequence code可以在linux终端以高亮，粗体，闪烁、多种颜色等方式展示消息。
Every operating system ever created tends to have its own boot loader. Installing a new operating system on a machine generally involves installing a whole new set of boot mechanisms, each with completely different install-time and boot-time user interfaces. Getting multiple operating systems to coexist reliably on one machine through typical chaining mechanisms can be a nightmare. There is little or no choice of boot loaders for a particular operating system — if the one that comes with the operating system doesn’t do exactly what you want, or doesn’t work on your machine, you’re screwed.
While we may not be able to fix this problem in existing proprietary operating systems, it shouldn’t be too difficult for a few people in the free operating system communities to put their heads together and solve this problem for the popular free operating systems. That’s what this specification aims for. Basically, it specifies an interface between a boot loader and a operating system, such that any complying boot loader should be able to load any complying operating system. This specification does not specify how boot loaders should work — only how they must interface with the operating system being loaded.