*:first-child {
margin-top: 0 !important;
}

.markdown-body>*:last-child {
margin-bottom: 0 !important;
}

.markdown-body .anchor {
position: absolute;
top: 0;
bottom: 0;
left: 0;
display: block;
padding-right: 6px;
padding-left: 30px;
margin-left: -30px;
}

.markdown-body .anchor:focus {
outline: none;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
position: relative;
margin-top: 1em;
margin-bottom: 16px;
font-weight: bold;
line-height: 1.4;
}

.markdown-body h1 .octicon-link,
.markdown-body h2 .octicon-link,
.markdown-body h3 .octicon-link,
.markdown-body h4 .octicon-link,
.markdown-body h5 .octicon-link,
.markdown-body h6 .octicon-link {
display: none;
color: #000;
vertical-align: middle;
}

.markdown-body h1:hover .anchor,
.markdown-body h2:hover .anchor,
.markdown-body h3:hover .anchor,
.markdown-body h4:hover .anchor,
.markdown-body h5:hover .anchor,
.markdown-body h6:hover .anchor {
height: 1em;
padding-left: 8px;
margin-left: -30px;
line-height: 1;
text-decoration: none;
}

.markdown-body h1:hover .anchor .octicon-link,
.markdown-body h2:hover .anchor .octicon-link,
.markdown-body h3:hover .anchor .octicon-link,
.markdown-body h4:hover .anchor .octicon-link,
.markdown-body h5:hover .anchor .octicon-link,
.markdown-body h6:hover .anchor .octicon-link {
display: inline-block;
}

.markdown-body h1 {
padding-bottom: 0.3em;
font-size: 2.25em;
line-height: 1.2;
border-bottom: 1px solid #eee;
}

.markdown-body h2 {
padding-bottom: 0.3em;
font-size: 1.75em;
line-height: 1.225;
border-bottom: 1px solid #eee;
}

.markdown-body h3 {
font-size: 1.5em;
line-height: 1.43;
}

.markdown-body h4 {
font-size: 1.25em;
}

.markdown-body h5 {
font-size: 1em;
}

.markdown-body h6 {
font-size: 1em;
color: #777;
}

.markdown-body p,
.markdown-body blockquote,
.markdown-body ul,
.markdown-body ol,
.markdown-body dl,
.markdown-body table,
.markdown-body pre {
margin-top: 0;
margin-bottom: 16px;
}

.markdown-body hr {
height: 4px;
padding: 0;
margin: 16px 0;
background-color: #e7e7e7;
border: 0 none;
}

.markdown-body ul,
.markdown-body ol {
padding-left: 2em;
}

.markdown-body ul ul,
.markdown-body ul ol,
.markdown-body ol ol,
.markdown-body ol ul {
margin-top: 0;
margin-bottom: 0;
}

.markdown-body li>p {
margin-top: 16px;
}

.markdown-body dl {
padding: 0;
}

.markdown-body dl dt {
padding: 0;
margin-top: 16px;
font-size: 1em;
font-style: italic;
font-weight: bold;
}

.markdown-body dl dd {
padding: 0 16px;
margin-bottom: 16px;
}

.markdown-body blockquote {
padding: 0 15px;
color: #777;
border-left: 4px solid #ddd;
}

.markdown-body blockquote>:first-child {
margin-top: 0;
}

.markdown-body blockquote>:last-child {
margin-bottom: 0;
}

.markdown-body table {
display: block;
width: 100%;
overflow: auto;
word-break: normal;
word-break: keep-all;
}

.markdown-body table th {
font-weight: bold;
}

.markdown-body table th,
.markdown-body table td {
padding: 6px 13px;
border: 1px solid #ddd;
}

.markdown-body table tr {
background-color: #fff;
border-top: 1px solid #ccc;
}

.markdown-body table tr:nth-child(2n) {
background-color: #f8f8f8;
}

.markdown-body img {
max-width: 100%;
-moz-box-sizing: border-box;
box-sizing: border-box;
}

.markdown-body code {
padding: 0;
padding-top: 0.2em;
padding-bottom: 0.2em;
margin: 0;
font-size: 85%;
background-color: rgba(0,0,0,0.04);
border-radius: 3px;
}

.markdown-body code:before,
.markdown-body code:after {
letter-spacing: -0.2em;
content: "\00a0";
}

.markdown-body pre>code {
padding: 0;
margin: 0;
font-size: 100%;
word-break: normal;
white-space: pre;
background: transparent;
border: 0;
}

.markdown-body .highlight {
margin-bottom: 16px;
}

.markdown-body .highlight pre,
.markdown-body pre {
padding: 16px;
overflow: auto;
font-size: 85%;
line-height: 1.45;
background-color: #f7f7f7;
border-radius: 3px;
}

.markdown-body .highlight pre {
margin-bottom: 0;
word-break: normal;
}

.markdown-body pre {
word-wrap: normal;
}

.markdown-body pre code {
display: inline;
max-width: initial;
padding: 0;
margin: 0;
overflow: initial;
line-height: inherit;
word-wrap: normal;
background-color: transparent;
border: 0;
}

.markdown-body pre code:before,
.markdown-body pre code:after {
content: normal;
}

.markdown-body .highlight {
background: #ffffff;
}

.markdown-body .highlight .c {
color: #999988;
font-style: italic;
}

.markdown-body .highlight .err {
color: #a61717;
background-color: #e3d2d2;
}

.markdown-body .highlight .k {
font-weight: bold;
}

.markdown-body .highlight .o {
font-weight: bold;
}

.markdown-body .highlight .cm {
color: #999988;
font-style: italic;
}

.markdown-body .highlight .cp {
color: #999999;
font-weight: bold;
}

.markdown-body .highlight .c1 {
color: #999988;
font-style: italic;
}

.markdown-body .highlight .cs {
color: #999999;
font-weight: bold;
font-style: italic;
}

.markdown-body .highlight .gd {
color: #000000;
background-color: #ffdddd;
}

.markdown-body .highlight .gd .x {
color: #000000;
background-color: #ffaaaa;
}

.markdown-body .highlight .ge {
font-style: italic;
}

.markdown-body .highlight .gr {
color: #aa0000;
}

.markdown-body .highlight .gh {
color: #999999;
}

.markdown-body .highlight .gi {
color: #000000;
background-color: #ddffdd;
}

.markdown-body .highlight .gi .x {
color: #000000;
background-color: #aaffaa;
}

.markdown-body .highlight .go {
color: #888888;
}

.markdown-body .highlight .gp {
color: #555555;
}

.markdown-body .highlight .gs {
font-weight: bold;
}

.markdown-body .highlight .gu {
color: #800080;
font-weight: bold;
}

.markdown-body .highlight .gt {
color: #aa0000;
}

.markdown-body .highlight .kc {
font-weight: bold;
}

.markdown-body .highlight .kd {
font-weight: bold;
}

.markdown-body .highlight .kn {
font-weight: bold;
}

.markdown-body .highlight .kp {
font-weight: bold;
}

.markdown-body .highlight .kr {
font-weight: bold;
}

.markdown-body .highlight .kt {
color: #445588;
font-weight: bold;
}

.markdown-body .highlight .m {
color: #009999;
}

.markdown-body .highlight .s {
color: #dd1144;
}

.markdown-body .highlight .n {
color: #333333;
}

.markdown-body .highlight .na {
color: teal;
}

.markdown-body .highlight .nb {
color: #0086b3;
}

.markdown-body .highlight .nc {
color: #445588;
font-weight: bold;
}

.markdown-body .highlight .no {
color: teal;
}

.markdown-body .highlight .ni {
color: purple;
}

.markdown-body .highlight .ne {
color: #990000;
font-weight: bold;
}

.markdown-body .highlight .nf {
color: #990000;
font-weight: bold;
}

.markdown-body .highlight .nn {
color: #555555;
}

.markdown-body .highlight .nt {
color: navy;
}

.markdown-body .highlight .nv {
color: teal;
}

.markdown-body .highlight .ow {
font-weight: bold;
}

.markdown-body .highlight .w {
color: #bbbbbb;
}

.markdown-body .highlight .mf {
color: #009999;
}

.markdown-body .highlight .mh {
color: #009999;
}

.markdown-body .highlight .mi {
color: #009999;
}

.markdown-body .highlight .mo {
color: #009999;
}

.markdown-body .highlight .sb {
color: #dd1144;
}

.markdown-body .highlight .sc {
color: #dd1144;
}

.markdown-body .highlight .sd {
color: #dd1144;
}

.markdown-body .highlight .s2 {
color: #dd1144;
}

.markdown-body .highlight .se {
color: #dd1144;
}

.markdown-body .highlight .sh {
color: #dd1144;
}

.markdown-body .highlight .si {
color: #dd1144;
}

.markdown-body .highlight .sx {
color: #dd1144;
}

.markdown-body .highlight .sr {
color: #009926;
}

.markdown-body .highlight .s1 {
color: #dd1144;
}

.markdown-body .highlight .ss {
color: #990073;
}

.markdown-body .highlight .bp {
color: #999999;
}

.markdown-body .highlight .vc {
color: teal;
}

.markdown-body .highlight .vg {
color: teal;
}

.markdown-body .highlight .vi {
color: teal;
}

.markdown-body .highlight .il {
color: #009999;
}

.markdown-body .highlight .gc {
color: #999;
background-color: #EAF2F5;
}

.markdown-body .octicon {
font: normal normal 16px octicons-anchor;
line-height: 1;
display: inline-block;
text-decoration: none;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}

.markdown-body .octicon-link:before {
content: '\f05c';
}

.markdown-body .task-list-item {
list-style-type: none;
}

.markdown-body .task-list-item+.task-list-item {
margin-top: 3px;
}

.markdown-body .task-list-item input {
margin: 0 4px 0.25em -20px;
vertical-align: middle;
}
-->

Writing-a-Kernel-in-C++


Write a Kernel in C++


Tools

Examples will show hot to use :-

  • GJGPP - a complete 32-bit C/C++ development system for INtel 80386(and higher) PCs running DOS.
  • NASM - The Netwide Assembler Project - Open sourced 80x86 assembler

Source code listed on this site has only been tested on djgpp version 2.03 and nasm version 0.98.08, running on the Windows XP environment. Some of the techniques discussed here will not work on other versions of gcc. I will try to give a warning for compiler specific implementations.

Assumptions

I assume that this is not your first attempt at writing a Kernel.

I assume you are already proficient in the programming language C++.

I assume you have already written a boot loader, or that you know how to use a standard one like GRUB. If you do use grub, you will need to add the necessary code to the assembler code below.

Part 1: Introduction, "Hello, world!" kernel - C++ with no Run-Time support Introduction

The aim of these tutorials is to show you how to implement a simple kernel written in C++. We will need a small amount of assembler (to initialise our kernel), and a smidgen of C code (to provide some C++ runtime support). The end result, will be the typical "Hello, world!" example.

Part 1, will introduce the Video driver, with no Run-Time support. Part 2, will help add some run-time support, enabling global/static objects. Part 3, will demonstrate a very simple implementation of std::cout (Standard output stream in the C++ Standard lib).

The end result will be this (taken from the first example in Accelerated C++, Andrew Koenig and BarBara E. Moo) :-

//a small C++ kernel
#include <iostream> int main()
{
std:cout << "Hello, world!" << std::endl;
return 0;
}

Part 4, will set-up a global descriptor table, and an interrupt descriptor table. With some encapsulation in C++. Part 5, will introduce a simple interrupt driven Keyboard driver. Part 6, will demonstrate a very simple implementation of std::string Part 7, will demonstrate a very simple implementation of std::cin.

The end result wil be this (taken from the second example in Accelerated C++, Andrew Koenig and Barbara E. Moo) :-

//a small C++ kernel
#include <iostream>
#include <string> int main()
{
//ask for the person's name
std::cout << "Please enter your first name: ";
//read name
std::string name; //define name
std::cin >> name; //read into name //write a greeting
std::cout << "Hello, " << name << "!" << std::endl;
return 0;
}

As you can see, there is more work involved to get the C++ kernel up and running, at least compared to a C kernel, but hopefully the end result will be a solid base onto which to build a more flexible object oriented kernel.

Knowing our limits

Quoting from the creator of C++, Bjarne Stroustrup's book "The C++ programming language third edition (section 1.3.1)",

"Except for the new, delete, typeid, dynamic_cast, and throw operators and the try-block, individual C++ expressions and statements need no run-time support."

The features which need Run-TIme support full into 3 categories :-

  • Built in functions (new, delete),
  • Run Time Type Information (typeid, dynamic_cast),
  • And Exception handling (throw, try-block).

However, Stroustrup was refering to C++ code on an operating system which has an implementation of the C++ standard library. So this must also be implemented or ported for use in the kernel.

The good news in we can disable these features with most compilers, and everything will be ok as long as we don't use those off-limit expressions and statements. When the time comes when we want to use them, we have to add our own support code and link it to our kernel.

example of how to disable these in gxx, the win32 g++ compiler.

gcc -c *.cpp -ffreestanding -nostdlib -fno-builtin -fno-rtti -fno-exceptions

offsite link : Options Controlling C++ Dialect

The bad news is there is no standard way that built in functions, RTTI, or EH have been implemented into the compiler. Even different versions of the same compiler may do things differently. In part2, I'll explain in more detail how we can tackle this problem, but for now we will just disable them all.

When we disable the run-time support in the compiler, the compiler will omit several important functions. The compiler normally makes a call to a function before calling main(), and another after main() returns. Typically these two functions will be called _main() and _atexit(). Amongst other operations, they normally handle the calling of global / static object constructors and deconstructors. So global / static objects are also off-limits until we add the necessary support code for this.

To summarise, a list of the off-limit C++ features (without adding your own support code) :-

  • Built in functions,
  • Run Time Type Information,
  • Exception handling,
  • The C++ standard library (including the C library of course),
  • And global / static objects.

The code

Lets start with the ASM code which will call our kernel's main function. Later this code will also make calls to our run-time support, _main() and _atexit().

;Loader.asm
[BITS 32] ; protected mode [global start]
[extern _main] ; this is in our C++ code start:
call _main ; call int main(void) from our C++ code
cli ; interrupts could disturb the halt
hlt ; halt the CPU

Now in our C++ Kernel, we are going to create a class Video, which will act as a simple video driver. This is the entire code for the kernel.

//Video.h
#ifndef VIDEO_H
#define VIDEO_H //so we don't get multiple definitions of VIdeo class Video
{
public:
Video();
~Video();
void clear();
void write(char *cp);
void put(char c);
private:
unsigned short *videomem; //pointer to video memory
unsigned int off; //offset, used like a y cord
unsigned int pos; //position, used like x cord }; //don't forget the semicolon! #endif
//Video.cpp

Video:Video()
{
pos=0; off=0;
videomem = (unsigned short*) 0xb8000;
} Video::~Video() {} void Video::clear()
{
unsigned int i; for(i=0; i<(80*25); i++)
{
videomem[i] = (unsigned char) ' ' | 0x0700;
}
pos=0; off=0;
} void Video::write(char *cp)
{
char *str = cp, *ch; for(ch=str; *ch; ch++)
{
put(*ch);
}
} void Video::put(char c)
{
if(pos>=80)
{
pos=0;
off += 80;
} if(off>=(80*20))
{
clear(); //should scroll the screen, but for now, just clear
} videomem[off + pos] = (unsigned char) c | 0x0700;
pos++;
}
//Kernel.cpp
#include "Video.h" int main(void)
{
Video vid; //local, (global variables need some Run-Time support code) vid.write("Hello, world!");
}

Compiling

Video.cpp and Kernel.cpp need to be compiled with a C++ compiler, remembering to disable the above mentioned C++ features. The output from your C++ compiler should be the object files Video.o and Kernel.o. Loader.asm also needs to be assembled with an assembler. The output from your assembler should be the object file Loader.o.

An example of how to compile using DJGPP gxx and NASM.

gxx -c Video.cpp -ffreestanding -nostdlib -fno-builtin -fno-rtti -fno-exceptions
gxx -c Kernel.cpp -ffreestanding -nostdlib -fno-builting -fno-rtti -fno-exceptions
nasm -f aout Loader.asm -o Loader.o

Linking

Now we must link our object files into a flat binary which we shall call Kernel.bin.

I recommend suing a linker script, we will be making use of the linker script in part2. Here is an example of a linker script for LD.

/* Link.ld */
OUTPUT_FORMAT("binary")
ENTRY(start)
SECTIONS
{
.text 0x100000 :
{
code = .; _code = .; __code = .;
*(.text)
. = ALIGN(4096);
} .data :
{
data = .; _data = .; __data = .;
*(.data)
. = ALIGN(4096);
} .bss :
{
bss = .; _bss = .; __bss = .;
*(.bss)
. = ALIGN(4096);
} end = .; _end = .; __end = .;
}

Now we can use the linker script with LD,

ld -T Link.ld -o Kernel.bin Loader.o Kernel.o Video.o

Conclusion

Hopefully your C++ Kerrnel should have compiled and linked without any errors. Congratulations.

Part2: Introduction, "Hello, world!" kernel - C++ with Global / Static Object support

::Warning - Compiler Specific::

Solution 1 - .ctor and .dtor sections

This method will only work for compilers which add two sections to the object files, the .ctor and .dtor section. Here are 4 steps to find out if you can use this solution :-

Step 1 - Move the Video object from a local to global scope.

//Kernel.cpp
#include "Video.h" Video vid; //global variable int main(void)
{
vid.write("Hello, world!");
}

Step 2 - Compile Kernel.cpp for a freestanding environment, without run-time support, or standard library.

gxx -c Kernel.cpp -ffreestanding -nostdlib -fno-builtin -fno-rtti -fno-exceptions

Step 3 - Use the object dump tool to display contents of the sections.

objdump -h Kernel.o > Kernel.dis

Redirects the output of objdump to a file named Kernel.dis

Step 4 - Open the Kernel.dis with a text editor (Notepad, WordPad, my preferred choice is TextPad)

Look for something like this in the file
7 .ctors 00000004 000000f4 000000f4 00000294 2**2
CONTENTS, ALLOC, LOAD, RELOC, DATA
8 .dtors 00000004 000000f8 000000f8 00000298 2**2
CONTENTS, ALLOC, LOAD, RELOC, DATA
If they are present, you can use solution 1.

The code

We are now going to implement _main() and _atexit(). In our linker script we are going to create a list of pointers in the .ctor section, and a list of pointers in the .dtor section. Which are the Constructor lists, and Deconstructor lists repectively.

Note - THe list is not sorted into order of precedence, in a complex hierachy the constructors could be called in an incorrect order!

//Support.c
void _main()
{
//Walk and call the constructors in the ctor_list //the ctor list is defined in the linker script
extern void (*_CTOR_LIST__)(); //hold current constructor in list
void (**constructor)() = &_CTOR_LIST__; //the first int is the number of constructors
int total = *(int *)constructor; //increment to first constructor
constructor++; while(total)
{
(*constructor)();
total--;
constructor++;
}
} void _atexit()
{
//Walk and call the deconstructors in the dtor_list //the dtor list is defined in the linker script
extern void (*_DTOR_LIST__)(); //hold current deconstructor in list
void (**deconstructor)() = &_DTOR_LIST__; //the first int is the number of deconstructors
int total = *(int *)deconstructor; //increment to first deconstructor
deconstructor++; while(total)
{
(*deconstructor)();
total--;
deconstructor++;
}
}
;Loader.asm

[BITS 32] ;protected mode

[global start]
[extern _main] ;this is in our C++ code
[extern __main] ;this is in our C support code
[extern __atexit];tihs is in our C support code start:
call __main
call _main ;call int main(void) from our C++ code
call __atexit
cli ;interrupts could disturb the halt
hlt ;halt the CPU
/* Link.ld */
OUTPUT_FORMAT("binary")
ENTRY(start)
SECTIONS
{
.text 0x100000 :
{
code = .; _code = .; __code = .;
*(.text)
. = ALIGN(4096);
} .data :
{
__CTOR_LIST__ = .;
LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
*(.ctors)
LONG(0)
__CTOR_END__ = .;
__DTOR_LIST__ = .;
LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
*(.dtors)
LONG(0)
__DTOR_END__ = .; data = .; _data = .; __data = .;
*(.data);
. = ALIGN(4096);
} .bss :
{
bss = .; _bss = .; __bss = .;
*(.bss)
. = ALIGN(4096);
end = .; _end = .; __end = .;
}
}

Conclusion

Compile and link as in Part 1. You will now be able to use Global / Static objects in your C++ Kernel. In Part 3 we will look at a simple implementation of Class OStream which resides in namespace std. We will use a global instance of OStream, cout.

All trademarks and/or registered trademarks on this site are property of their respective owners. Use this site and its contents at your own risk...

Writing a Kernel in C++的更多相关文章

  1. karottc A Simple linux-virus Analysis、Linux Kernel <= 2.6.37 - Local Privilege Escalation、CVE-2010-4258、CVE-2010-3849、CVE-2010-3850

    catalog . 程序功能概述 . 感染文件 . 前置知识 . 获取ROOT权限: Linux Kernel <= - Local Privilege Escalation 1. 程序功能概述 ...

  2. Android(Linux)线路规程的使用

        一般来说,车载导航主机都需要外接若干个UART的外设,如支持HFP的蓝牙模块.与原车通信的CAN解码盒模块.u-blox的GPS模块和DVD机芯等.早年使用Telechips TCC8902+ ...

  3. how to learn device driver

    making a linux usb driver http://www.kroah.com/linux/ http://matthias.vallentin.net/blog/2007/04/wri ...

  4. Hooking Android System Calls for Pleasure and Benefit

    The Android kernel is a powerful ally to the reverse engineer. While regular Android apps are hopele ...

  5. Semi synchronous replication

    目标 主库宕机不丢数据(Master Failover without data loss) facebook有两篇不错的文章: 2015/01: performance-issues-and-fix ...

  6. Android File Hierarchy : System Structure Architecture Layout

    Most of the Android user are using their Android phone just for calls, SMS, browsing and basic apps, ...

  7. Tracing on Linux

    The Linux tracing APIs are a relatively new addition to the kernel and one of the most powerful new ...

  8. 嵌入式Linux设备驱动程序:编写内核设备驱动程序

    嵌入式Linux设备驱动程序:编写内核设备驱动程序 Embedded Linux device drivers: Writing a kernel device driver 编写内核设备驱动程序 最 ...

  9. 启动 NFS 守护进程:rpc.nfsd: writing fd to kernel failed: errno 111 (Connection refused)

    启动 NFS 守护进程:rpc.nfsd: writing fd to kernel failed: errno 111 (Connection refused) rpc.nfsd: unable t ...

随机推荐

  1. 利用SHELL的PROMPT_COMMAND添加日志审计功能,实时记录任何用户的操作到日志文件中

    利用 PROMPT_COMMAND 实现命令审计功能:记录什么用户,在什么时间,做了什么操作,然后将查到的信息记录到一个文件里. 具体操作: 将以下内容追加到/etc/profile: ####### ...

  2. Python 装饰器(进阶篇)

    装饰器是什么呢? 我们先来打一个比方,我写了一个python的插件,提供给用户使用,但是在使用的过程中我添加了一些功能,可是又不希望用户改变调用的方式,那么该怎么办呢? 这个时候就用到了装饰器.装饰器 ...

  3. 并发库应用之二 & Java原子性操作类应用

    Java5的线程并发库中,提供了一组atomic class来帮助我们简化同步处理.基本工作原理是使用了同步synchronized的方法实现了对一个long, integer, 对象的增.减.赋值( ...

  4. 详解 Cookie 纪要(vue.cookie,jquery.cookie简化)

    今天看到一篇cookie的文章,写的特别详细,感谢 晚晴幽草轩 的分享,原文链接http://www.jeffjade.com/2016/10/31/115-summary-of-cookie/ 原文 ...

  5. [ONTAK2015]Bajtman i Okrągły Robin

    bzoj 4276: [ONTAK2015]Bajtman i Okrągły Robin Time Limit: 40 Sec  Memory Limit: 256 MB Description 有 ...

  6. 用 Love2D 实现法线贴图的例程(到最新版本 0.10.1)

    用 Love2D 实现法线贴图的例程(到最新版本 0.10.1) 概述 一般来说, 复杂的光照模型会被用在 3D 游戏中, 以产生逼真的效果, 不过也有些开发者研究出一些代码可以在 2D 游戏中使用这 ...

  7. charles抓包详解http 与 https

    包工具多种多样,比较好使的还是Charles和Fiddler,下面就简单的介绍下HTTPS的相关原理并以Charles为例来介绍下如何抓取HTTPS协议的包 1.下载charles 可以去charle ...

  8. myeclipse使用小结

    1.项目设置编码格式 (1)全局编码设置:编码设置的方法:ToolBar-->Window-->Preferences-->General-->Workspace-->T ...

  9. 三个你不知道的CSS技巧

    各种浏览器之间的竞争的白热化意味着越来越多的人现在开始使用那些支持最新.最先进的W3C Web标准的设备,以一种更具交互性的方式来访问互联网.这意味着我们终于能够利用更强大更灵活的CSS来创造更简洁, ...

  10. NameValuePair方式传参数

    今天工作中联调外部的一个接口用post方式传输,我按照文档封装参数成Jason字符串传入,但是对方一直接受参数为空,折腾了半天也没找到问题.很苦恼,检查代码都没有错误,可是为什么对方接受参数为空呢?然 ...