出處 http://lklkdawei.blog.163.com/blog/static/32574109200861031129157/
by 強大的大陸人
 
播放的是mp3格式音乐,需要

ffyy99 發表在 痞客邦 留言(0) 人氣()

package SST.com.tw;
import java.io.*;
import javax.sound.sampled.*;
public class AP_Main {
    static ByteArrayOutputStream bos = new ByteArrayOutputStream();
    public static void main(String args[]) {
        try {
            File file = new File ("D:\\aa.au");
            InputStream in = new FileInputStream(file);
            AudioInputStream AIS = AudioSystem.getAudioInputStream(file);
            AudioFormat format = AIS.getFormat();
            DataLine.Info info = new DataLine.Info(SourceDataLine.class, format);
            SourceDataLine line = (SourceDataLine) AudioSystem.getLine(info);
            line.open(format);
            line.start();
            int bufferSize = (int) format.getSampleRate() * format.getFrameSize();
            byte[] buffer = new byte[bufferSize];
            try {
                int bytesRead = 0;
                while (bytesRead >= 0) {
                    bytesRead = AIS.read(buffer, 0, buffer.length);
                    if (bytesRead >= 0) {
                        line.write(buffer, 0, bytesRead);
                    }
                }
            } catch (IOException e) {
                System.out.println("" + e.toString());
            }
            line.close();
            System.out.println("program over");
       } catch (Exception e) {
            System.out.println(e.toString());
        }
    }
}

ffyy99 發表在 痞客邦 留言(0) 人氣()

package SST.com.tw;
import java.io.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.sound.sampled.*;
public class RecorderAudio extends Thread {
    static TargetDataLine m_targetdataline;
    static AudioFileFormat.Type m_targetType;
    static AudioInputStream m_audioInputStream;
    static File m_outputFile;
    static ByteArrayOutputStream bos = new ByteArrayOutputStream();
    static byte[] buf;
    static boolean m_bRecording;
    public RecorderAudio(TargetDataLine line, AudioFileFormat.Type targetType,
                        File file) {
        m_targetdataline = line;
        m_audioInputStream = new AudioInputStream(line);
        m_targetType = targetType;
        m_outputFile = file;
    }
    public static void AudioRecorder() {
        String Filename = "d://aa.wav";
        File outputFile = new File(Filename);
        AudioFormat audioFormat = null;
        audioFormat = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, 8000.0F,
                                      8, 1, 1, 8000.0F, false);
        // telephone sample rate is 8KHz
        DataLine.Info info = new DataLine.Info(TargetDataLine.class, audioFormat);
        System.out.println(info.toString());
        TargetDataLine targetDataLine = null;
        
        try {
            targetDataLine = (TargetDataLine) AudioSystem.getLine(info);
            targetDataLine.open(audioFormat);
        } catch (LineUnavailableException e) {
            System.out.println("audio record fail");
            System.exit(-1);
        }
        AudioFileFormat.Type targetType = AudioFileFormat.Type.AU;
        RecorderAudio recorder = null;
        recorder = new RecorderAudio(targetDataLine, targetType, outputFile);
        recorder.start();
        try {
            Thread.sleep(3000);
        } catch (InterruptedException ex) {
            System.out.println(ex.toString());
        }
        recorder.stopRecording();
        try {
            FileOutputStream fos = new FileOutputStream(m_outputFile);
            fos.write(buf);
            System.out.println("file write");
            fos.close();
        } catch (Exception e) {
            System.out.println("file write");
        }
    }
    public void start() {
        m_targetdataline.start();
        super.start();
        System.out.println("recording...");
    }
    public static void stopRecording() {
        m_targetdataline.stop();
        m_targetdataline.close();
        m_bRecording = false;
        buf = bos.toByteArray();
        System.out.println("stopped");
    }
    public void run() {
        try {
            AudioSystem.write(m_audioInputStream, m_targetType, bos);
            System.out.println("after write()");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

ffyy99 發表在 痞客邦 留言(0) 人氣()





package SST.com.tw;
import java.io.*;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import javax.bluetooth.*;
import java.util.Vector;
import javax.microedition.io.*;
public class BTCV extends MIDlet implements DiscoveryListener, CommandListener, Runnable{
// Base ------------------------------------------
    Display dsp;
    Form frm;
    ChoiceGroup cg;
    Form saveFrm;
// Command -----------------------------------------
    Command OK;
    Command Exit;
    Command Send;
// BlueTooth ---------------------------------------
    LocalDevice local = null;       // Local Device Info
    DiscoveryAgent agent = null;    // Device Scanner
    Vector devicesFound = null;     // Remote device Info
    StreamConnection conn;
    DataInputStream dis = null;
    DataOutputStream dos = null;
    String url;
    Thread readThread = null;
    public BTCV () {
        dsp = Display.getDisplay(this);
        frm = new Form("BT SP");
        try {
            local = LocalDevice.getLocalDevice();
        } catch (BluetoothStateException ex) {
        }
        cg = new ChoiceGroup("Select Bluetooth Device,"+local.getFriendlyName().toString(), ChoiceGroup.EXCLUSIVE);
        OK = new Command("OK", Command.OK, 1);
        Exit = new Command("Exit", Command.EXIT, 1);
        Send = new Command("Send", Command.OK, 1);
        frm.append(cg);
        frm.addCommand(OK);
        frm.addCommand(Exit);
        frm.setCommandListener(this);
        readThread = new Thread(this);
    }
    
    public void startApp() {
        dsp.setCurrent(frm);
        scanOverFlag = false;
        runFlag = false;
        doDeviceDiscovery();
    }
    public void pauseApp() {
    }
    public void destroyApp(boolean unconditional) {
        this.notifyDestroyed();
    }
    boolean scanOverFlag;
    int cc;
    public void commandAction(Command cmnd, Displayable dsplbl) {
        if (cmnd == OK) {
            do {
                if (!scanOverFlag)      // waiting scan
                {
                    break;
                }   //cg.append("OK ", null);
                try {
                    RemoteDevice rd = (RemoteDevice) devicesFound.elementAt(cg.getSelectedIndex());
                    agent.searchServices(null, new UUID[]{SERIAL}, rd, this);
                } catch (BluetoothStateException ex) {
                    //ex.printStackTrace();
                    cg.append("searchService Error", null);
                }
                if (url == null)
                {
                    break;
                }
                try {
                    conn = (StreamConnection) Connector.open(url);
                    dos = conn.openDataOutputStream();
                    dis = conn.openDataInputStream();
                    runFlag = true;
                    frm.removeCommand(OK);
                    frm.addCommand(Send);
                    readThread.start();
                    readThreadFlag = false;
                } catch (IOException ex) {
                    frm.append("connect error");
                }
                
            } while (false);
        }else if (cmnd == Exit) {
            try {
                conn.close();
                readThreadFlag = true;
            } catch (IOException ex) {
                //ex.printStackTrace();
            }
            this.destroyApp(false);
        }else if (cmnd == Send) {
            try {
                if (dos != null) {
                    dos.writeChars(Integer.toString(cc));
                    cc++;
                    //dos.writeByte(0x30);
                    //dos.close();
                    
                }
            }catch (IOException ex) {
                frm.append("write error");
            }
        }
    }
    private void doDeviceDiscovery() {
        devicesFound = new Vector();
        try {
            agent = local.getDiscoveryAgent();
            agent.startInquiry(DiscoveryAgent.GIAC, this);      // start scan
        } catch (BluetoothStateException ex) {
            //ex.printStackTrace();
        }
    }
    private UUID SERIAL = new UUID(0x1101);
    private UUID RFCOMM = new UUID(0x0003);
    public void deviceDiscovered(RemoteDevice rd, DeviceClass dc) {
        try {
            devicesFound.addElement(rd);
            cg.append(rd.getFriendlyName(true), null);
        } catch (IOException ex) {
            //ex.printStackTrace();
        }
    }
    public void servicesDiscovered(int transID, ServiceRecord[] srs) {
        url = srs[0].getConnectionURL(ServiceRecord.NOAUTHENTICATE_NOENCRYPT, false);
    }
    public void serviceSearchCompleted(int transID, int respCode) {
        switch (respCode)
        {
            case DiscoveryListener.SERVICE_SEARCH_COMPLETED:
                frm.append("service complete");
                break;
            case DiscoveryListener.SERVICE_SEARCH_NO_RECORDS:
                cg.append("no record", null);
                break;
            case DiscoveryListener.SERVICE_SEARCH_ERROR:
                break;
        }
    }
    public void inquiryCompleted(int param) {
        switch (param)
        {
            case DiscoveryListener.INQUIRY_COMPLETED:
                scanOverFlag = true;        // device discovery over
                frm.append("device complete");
                break;
            case DiscoveryListener.INQUIRY_ERROR:
                break;
            case DiscoveryListener.INQUIRY_TERMINATED:
                break;
        }
    }
    private boolean runFlag;
    private boolean readThreadFlag;
    public void run() {
        while (!runFlag);
        while (!readThreadFlag) {
            byte buf = 0;
            try {
                buf = dis.readByte();
                //String.valueOf(buf)
                frm.append(new String(new byte[] {buf}));        // ascii
            } catch (IOException ex) {
                //ex.printStackTrace();
                frm.append("get error");
            }   
        }
    }
}

ffyy99 發表在 痞客邦 留言(2) 人氣()

STM32 board
突然想到  看這樣會不會有問題
想說看單晶片上能不能有環狀的Queue
和 LinkList 一樣  用指標去指

ffyy99 發表在 痞客邦 留言(2) 人氣()

Debian
首先我們先把Debian 文字版的安裝好

接著分割硬碟後  假設是/dev/hda3

ffyy99 發表在 痞客邦 留言(5) 人氣()

http://yblog.org/archive/index.php/8851

ffyy99 發表在 痞客邦 留言(1) 人氣()

在 linux 下 有兩個常用的解壓縮的格式
bz2 和 gz
Debian 剛裝好時什麼都沒有只有 tar 這個指令
所以就要加上去

ffyy99 發表在 痞客邦 留言(0) 人氣()

出處: http://winnercow.pixnet.net/blog/post/23920505
 
C#的String.Format舉例
stringstr1 =string.Format("{0:N1}",56789);
//result: 56,789.0
stringstr2 =string.Format("{0:N2}",56789);
//result: 56,789.00
stringstr3 =string.Format("{0:N3}",56789);
//result: 56,789.000
stringstr8 =string.Format("{0:F1}",56789);
//result: 56789.0
stringstr9 =string.Format("{0:F2}",56789);
//result: 56789.00
stringstr11 =(56789 / 100.0).ToString("#.##");
//result: 567.89
stringstr12 =(56789 / 100).ToString("#.##");
//result: 567
C 或 c
貨幣
Console.Write("{0:C}", 2.5); //$2.50
Console.Write("{0:C}",
-2.5); //($2.50)
D 或 d
十進位數字
Console.Write("{0:D5}", 25);
//00025
E 或 e
科學型
Console.Write("{0:E}", 250000);
//2.500000E+005
F 或 f
固定點
Console.Write("{0:F2}", 25);
//25.00
Console.Write("{0:F0}", 25); //25
G 或 g
常規
Console.Write("{0:G}",
2.5); //2.5
N 或 n
數字
Console.Write("{0:N}", 2500000);
//2,500,000.00
X 或 x
十六進位
Console.Write("{0:X}", 250);
/******************************************************************************/
ASP.NET
設置資料格式與String.Format使用總結(引)
{0:d} YY-MM-DD
{0:p} 百分比00.00%
{0:N2}
12.68
{0:N0} 13
{0:c2} $12.68
{0:d} 3/23/2003
{0:T}
12:00:00 AM
{0:男;;女}
DataGrid-資料格式設置運算式
資料格式設置運算

.NET Framework
格式設置運算式,它在資料顯示在列中之前先應用於資料。此運算式由可選靜態文本和用以下格式表示的格式說明符組成:
{0:format
specifier}
零 是參數索引,它指示列中要格式化的資料元素;因此,通常用零來指示第一個(且唯一的)元素。format
specifier 前面有一個冒號
(:),它由一個或多個字母組成,指示如何格式化資料。可以使用的格式說明符取決於要格式化的資料類型:日期、數位或其他類型。下表顯示了不同資料類型的
格式設置運算式的示例。有關格式設置運算式的更多資訊,請參見格式化類型。
格式設置運算式
應用於此資料類型

說明
Price: {0:C}
numeric/decimal

示“Price:”,後跟以貨幣格式表示的數字。貨幣格式取決於通過 Page 指令或 Web.config 檔中的區域性屬性指定的區域性設置。
{0:D4}
integer(不
能和小數一起使用。)
在由零填充的四個字元寬的欄位中顯示整數。
{0:N2}%
numeric

示精確到小數點後兩位元的數字,後跟“%”。
{0:000.0}
numeric/decimal

捨五入到小數點後一位元的數字。不到三位元的數字用零填充。
{0:D}
date/datetime

日期格式(“Thursday, August 06, 1996”)。日期格式取決於頁或 Web.config 檔的區域性設置。
{0:d}
date/datetime

日期格式(“12/31/99”)。
{0:yy-MM-dd}
date/datetime

數字的年-月-日表示的日期(96-08-06)。
唯讀
當此列處於編輯模式時,該列中的資料是否顯示在可編輯的控制
項中。
2006-02-22 | asp.net資料格式的Format-- DataFormatString

們在呈現資料的時候,不要將未經修飾過的資料呈現給使用者。例如金額一萬元,如果我們直接顯示「10000」,可能會導致使用者看成一千或十萬,造成使用
者閱讀資料上的困擾。若我們將一萬元潤飾後輸出為「NT$10,000」,不但讓使比較好閱讀,也會讓使用者減少犯錯的機會。
下列畫面為潤飾過
的結果:
上述資料除了將DataGrid Web
控制項以顏色來區隔記錄外,最主要將日期、單價以及小計這三個計欄位的資料修飾的更容易閱讀。要修飾欄位的輸出,只要設定欄位的
DataFormatString 屬性即可;其使用語法如下:
DataFormatString="{0:格式字串}"

們知道在DataFormatString 中的 {0}
表示資料本身,而在冒號後面的格式字串代表所們希望資料顯示的格式;另外在指定的格式符號後可以指定小數所要顯示的位元數。例如原來的資料為
「12.34」,若格式設定為 {0:N1},則輸出為「12.3」。其常用的數值格式如下表所示:
格式字串 資料 結果
"{0:C}"
12345.6789 $12,345.68
"{0:C}" -12345.6789 ($12,345.68)
"{0:D}"
12345 12345
"{0:D8}" 12345 00012345
"{0:E}" 12345.6789
1234568E+004
"{0:E10}" 12345.6789 1.2345678900E+004
"{0:F}"
12345.6789 12345.68
"{0:F0}" 12345.6789 12346
"{0:G}" 12345.6789
12345.6789
"{0:G7}" 123456789 1.234568E8
"{0:N}" 12345.6789
12,345.68
"{0:N4}" 123456789 123,456,789.0000
"Total: {0:C}"
12345.6789 Total: $12345.68
其常用的日期格式如下表所示:
格式 說明 輸出格式
d
精簡日期格式 MM/dd/yyyy
D 詳細日期格式 dddd, MMMM dd, yyyy
f 完整格式 (long date +
short time) dddd, MMMM dd, yyyy HH:mm
F
完整日期時間格式
(long date +
long time)
dddd, MMMM dd, yyyy HH:mm:ss
g 一般格式 (short date + short
time) MM/dd/yyyy HH:mm
G 一般格式 (short date + long time) MM/dd/yyyy
HH:mm:ss
m,M 月日格式 MMMM dd
s 適中日期時間格式 yyyy-MM-dd HH:mm:ss
t
精簡時間格式 HH:mm
T 詳細時間格式 HH:mm:ss
string.format格式結果
String.Format
(C)
Currency: . . . . . . . . ($123.00)
(D) Decimal:. . . . . . . . .
-123
(E) Scientific: . . . . . . . -1.234500E+002
(F)
Fixed point:. . . . . . . -123.45
(G) General:. . . . . . . . .
-123
(N) Number: . . . . . . . . . -123.00
(P) Percent:. .
. . . . . . . -12,345.00 %
(R) Round-trip: . . . . . . . -123.45
(X)
Hexadecimal:. . . . . . . FFFFFF85
(d) Short date: . . . . . . .
6/26/2004
(D) Long date:. . . . . . . . Saturday, June 26, 2004
(t)
Short time: . . . . . . . 8:11 PM
(T) Long time:. . . . . . . .
8:11:04 PM
(f) Full date/short time: . . Saturday, June 26, 2004
8:11 PM
(F) Full date/long time:. . . Saturday, June 26, 2004
8:11:04 PM
(g) General date/short time:. 6/26/2004 8:11 PM
(G)
General date/long time: . 6/26/2004 8:11:04 PM
(M) Month:. . . .
. . . . . . June 26
(R) RFC1123:. . . . . . . . . Sat, 26 Jun
2004 20:11:04 GMT
(s) Sortable: . . . . . . . .
2004-06-26T20:11:04
(u) Universal sortable: . . . 2004-06-26
20:11:04Z (invariant)
(U) Universal sortable: . . . Sunday, June
27, 2004 3:11:04 AM
(Y) Year: . . . . . . . . . . June, 2004
(G)
General:. . . . . . . . . Green
(F) Flags:. . . . . . . . . .
Green (flags or integer)
(D) Decimal number: . . . . . 3
(X)
Hexadecimal:. . . . . . . 00000003
說明:
String.Format
將指定
的 String 中的每個格式項替換為相應物件的值的文本等效項。
例子:
int iVisit = 100;
string
szName = "Jackfled";
Response.Write(String.Format("您的帳號是:{0} 。訪問了
{1} 次.", szName, iVisit));

ffyy99 發表在 痞客邦 留言(0) 人氣()

製作系統盤現在使用32M電子盤(DOM)。以下比較詳細的說明怎樣製作一個嵌入式Linux系統盤。
1.
首先可以先把電子盤掛到一台機器上作為從盤,使用PQMagic分區工具進行分區操作,因為DOS分區所有內容只有1.56M,所以第一個分區只需要2M
就足夠了。分區類型是基本分區(primary),文件系統類型是FAT,並且設為活動分區(A ctive)。
2.
Linux分區可以現在分好,也可以等製作文件系統時再分。現在分可以把剩餘空間都作為第二個分區。分區類型是基本分區(primary),文件系統類型
是Linux Ext2。
3.
重啟機器,可以看到一個兩兆的分區。把編譯好的Linux內核和DOS加載工具等內容(見系統文件清單)全部拷到這個分區上,第一個分區就做好了。如果分
了三個區,而且想把第三個分區作為工作分區,則需要把AUTOEXEC.BAT中的工作分區指向 /dev/hda2 改為/dev/hda3即可。
4.
在機器上安裝一個Linux系統,把電子盤掛在IDE2上。如果沒有進行第二步操作,打開一個終端,進行分區和製作文件系統操作。
fdisk
/dev/hdd
回車,出現提示,輸入p,可以看見現在hdd的分區狀態;
輸入n,增添分區,回車;
輸入2,指定設備號,回
車;
輸入3,指定起始柱面號,回車;
輸入+30M,指定分區大小,回車;
輸入w,把剛才的分區設置寫入分區表;
mkfs.ext2
/dev/hdd2,製作文件系統,類型是ext2。
mount /dev/hdd2 /mnt,加載到主盤的mnt下
5.
現在開始製作第二個分區上的文件系統。因為原有文件系統大約有53M左右,必須有所刪減。而其中最大的是lib,大約佔了40M,而使用lib中庫的主要
是bin和sbin中的工具。因而使用了嵌入式Linux常用的busybox和tinylog in。
從網上下載了busybox-1.00-
pre3.tar和tinylogin-1.4.tar,把busybox-1.00-pre3.tar解壓到一個指定的目錄下。
運行「make
menuconfig」命令,選擇想要在工作系統中使用的工具。保存設置。
找到init目錄下的init.c文件,找到
INIT_SCRIPT "/etc/init.d/rcS",更改為「/etc/rc」。
看Makefile中是否有「DOSTATIC =
false」,如果有,改false為true,使busybox靜態編譯。
修改了/usr/include/asm/errno.h頭文件中
27行的一個錯行,否則編譯通不過。
在當前目錄下用命令「make menuconfig」進入工具選擇界面,選項如下所示:
進入
「Build Options」 ,選擇「Build Busybox as a static binary」選項;
進入「Archival
Utilities」 ,選擇「gunzip, gzip, tar」 選項;
進入「Console Utilities」
,選擇「clear, reset」 選項;
進入「Finding Utilities」 ,選擇「find, grep」 選項;
進入
「Init Utilities」 ,選擇全部的選項;
進入「Login/Password Management Utilities」
,選擇除第一項和最後兩項的全部選項;
進入「Linux Module Utilities」 ,選擇全部的選項;
進入
「Networking Utilities」 ,選擇「arping, ftpget, ftpput, hostname,
ifconfig下一共5項, ifupdown, use busybox ifconfig and route applets, Enable
support for IPV4, Enable support for IPX, Enable mapping support,
inetd全選,ip全選, ipcalc全選, netstat, nslookup, ping, telnet, telnetd」 選項;

入「Process Utilities」 ,選擇「free, kill, killall, ps, uptime」 選項;
進入
「Linux System Utilities」 ,選擇「dmesg, fdisk, write support, 」 選項,其餘默認。

的其他選項默認,保存退出。
make,在當前目錄下生成一個大約800k的「busybox」,就是我們所需要的了。把它拷到mnt下的
bin目錄下。然後就可以把自己想要的工具在bin下面建立一個鏈接就可以了。如:
ln –s busybox cp
ln –s
busybox ls
……
對於tinylogin,操作和busybox完全相同。也要靜態編譯,然後把
login,passwd,adduser等帳戶管理的工具建立和tinylogin的鏈接即可。需要注意的是有些工具是在sbin當中的,所以也可以把
tinylogin拷到 sbin目錄下,bin下的工具要想鏈接到tinylogin,可以如下操作:
ln –s tinylogin
../bin/login
6.
有些bin和sbin下的工具是busybox和tinylogin中所沒有的,必須從完整的系統中拷過來,例如在這個系統中,由於選擇vi時編譯出錯,
所以vi是直接從主盤上拷過來的,而且必須把這個工具使用的相應的庫也拷到lib下面。如使用 ldd
vi,就可以看到vi使用了哪些庫,然後把這些庫拷到/mnt/lib下就可以了。
7.
在bin中還有兩個命令ro和rw,是自己定義的兩個可執行腳本。作用是使系統變更為只讀和可讀寫,也要拷到bin下面。
8.
在lib中建立目錄modules和tls,使用命令mkdir modules和 mkdir
tls。把原來lib中這兩個目錄下的東西拷過來即可。把應用程序所需要的cpr-2.0.1.so和jpeg-6a.so拷到lib中。這樣
bin,sbin和lib就做好了。這樣lib只有8M左右。
9.
把剩下的目錄etc、dev、proc、usr、var、boot、mnt和root全部拷到mnt目錄下。因為要求系統不使用頁面交換,所以在etc下
的rc腳本中添加了一句swapoff –a
如果需要新添加用戶或者更改用戶密碼,還需要建立一個home目錄。
10.這時
mnt下所用空間大小大約是16M左右。umount /mnt,電子盤就可以在工作機上啟動了。
以下是各目錄中建立鏈接的詳細清單:
bin:
ln
–s busybox ash
ln –s busybox cat
ln –s busybox chmod
ln –s
busybox chown
ln –s busybox chroot
ln –s busybox chvt
ln –s
busybox clear
ln –s busybox cp
ln –s busybox cut
ln –s busybox
date
ln –s busybox dd
ln –s busybox df
ln –s busybox dirname
ln
–s busybox dmesg
ln –s busybox du
ln –s busybox echo
ln –s
busybox env
ln –s busybox false
ln –s busybox find
ln –s
busybox grep
ln –s busybox gunzip
ln –s busybox gzip
ln –s
busybox head
ln –s busybox hostname
ln –s busybox id
ln –s
busybox insmod
ln –s busybox kill
ln –s busybox killall
ln –s
busybox klogd
ln –s busybox linuxrc
ln –s busybox ln
ln –s
busybox logger
ln –s ../sbin/tinylogin login
ln –s busybox ls
ln
–s busybox mkdir
ln –s busybox mkswap
ln –s busybox more
ln –s
busybox mount
ln –s busybox mv
ln –s busybox netstat
ln –s
../sbin/tinylogin passwd
ln –s busybox pidof
ln –s busybox ps
ln
–s busybox pwd
ln –s busybox reset
ln –s busybox rm
ln –s
busybox rmdir
ln –s busybox route
ln –s busybox sh
ln –s
busybox sleep
ln –s busybox sort
ln –s ../sbin/tinylogin su
ln
–s busybox sync
ln –s busybox tar
ln –s busybox test
ln –s
busybox touch
ln –s busybox true
ln –s busybox tty
ln –s
busybox umount
ln –s busybox uname
ln –s busybox uptime
ln –s
busybox wc
ln –s busybox zcat
sbin:
ln –s tinylogin
addgroup
ln –s tinylogin adduser
ln –s tinylogin delgroup
ln –s
tinylogin deluser
ln –s tinylogin sulogin
lib:
ln –s
ld-2.3.2.so ld-linux.so.2
ln –s libacl.so.1.0.3 libacl.so.1
ln –s
libattr.so.1.0.1 libattr.so.1
ln –s libc-2.3.2.so libc.so.6
ln –s
libcom_err.so.2.0 libcom_err.so.2
ln –s libcrypt-2.3.2.so
libcrypt.so.1
ln –s libdl-2.3.2.so libdl.so.2
ln –s libe2p.so.2.3
libe2p.so.2
ln –s libext2fs.so.2.4 libext2fs.so.2
ln –s
libgcc_s-.3.2.2-20030225.so.1 libgcc_s.so.1
ln –s libm-2.3.2.so
libm.so.6
ln –s libnss1_files-2.2.4.so libnss1.so.1
ln –s
libnss_files-2.2.4.so libnss_files.so.1
ln –s libnss_files-2.3.2.so
libnss_files.so.2
ln –s libpam.so.0.75 libpam.so.0
ln –s
libpthread-0.10.so libpthread.so.0
ln –s libresolv-2.3.2.so
libresolv.so.2
ln –s libtermcap.so.2.0.8 libtermcap.so.2
ln –s
libutil-2.3.2.so libutil.so.1
ln –s libuuid.so.1.2 libuuid.so.1
lib/tls:
ln
–s libc-2.3.2.so libc.so.6
ln –s libm-2.3.2.so libm.so.6
ln –s
libpthread-0.10.so libpthread.so.0

ffyy99 發表在 痞客邦 留言(0) 人氣()

harddisk
試了一整天終於把 grub 放到 Virtual Box 上的 Hard Disk
 
用的方法有點偷懶直接用 Ubuntu 的 live CD 直接把 Grub 放到 硬碟中

ffyy99 發表在 痞客邦 留言(1) 人氣()

x86 電腦開機會從 Cylinder=0, Heeader=0, Sector=1 的地方拷貝 512 byte
到記憶體位址 0000:7C00 的地方執行(C/H/S = 0, 0, 1) 這區塊就叫做 MBR
所以要用 boot 去開機時 就要把 boot 放在 MBR 的位置 電腦才會去那裡執行指令
MBR 區塊的結束一定是 55 AA (HEX) 如不是  那就是抓錯了

ffyy99 發表在 痞客邦 留言(0) 人氣()

« 1 2 3 4 5
Blog Stats
⚠️

成人內容提醒

本部落格內容僅限年滿十八歲者瀏覽。
若您未滿十八歲,請立即離開。

已滿十八歲者,亦請勿將內容提供給未成年人士。