부팅이 되는 순간 Hellow World!를 화면에 출력하고 싶은데요.....(emacs, linux, hexl-mode에 대해 잘 아시는분!!!)

aeeeefff의 이미지

개인적인 공부로 컴퓨터가 부팅 되는 순간에 OS가동 되는 대신
Hellow World를 출력하는 프로그램을 만들려고 합니다.
그런데 도중 2가지 궁금한 부분이 있어 질문드립니다.
(OS는 ubuntu 12.04 LTS, 에디터는 emacs를 사용합니다.)

********************************************************************************

1. emacs에서 hexl-mode를 이용해 파일을 만들려고 합니다.

문제는 emacs로 어떤 파일을 hexl-mode를 통해 바이너리파일로 읽고 수정할 수는 있습니다만,
새로운 파일을 만드는 게 되지 않습니다.
보통 커맨드창에 emacs hello.c &라고 하면 자동으로 hello라는 이름의 c언어 파일을 하나 생성하면서
c언어 소스파일을 에디트할 수 있는 모드로 자동 변환이 되지만,
명령창을 이용해 어떻게 hexl형의 파일을 만드는지 모르겠습니다.

우선, 시행 삼아 명령창에 emacs hello.hexl &라고 파일을 생성 후에 바로 이맥스에서
M-x hexl-mode를 하니 창 위에 다른 바이너리에디터 처럼 16진수의 표기 같은 것이 뜹니다만,
그 이후 16진수나 0이나 1아무거나 입력해도 입력되지 않고 구글링해 알아 본 바로
C-M-x, C-M-o, C-M-d을 해봐도 역시나 똑같습니다.
아래에 "Point is not on a character in the file"이라는 문구만 자꾸 뜹니다.
그리고, M-x hexl-insert-hex-string RET를 시행하려고 했을시에는 마지막 RET입력이
아예 되지 않았습니다.

어디가 문제인 건가요? (혹시나 싶어 아래에 그 문제의 창을 첨부해 놓았습니다.)

----------------------------------------------------------------------------

2. 이미지 파일로 생성 후에 부팅을 하려고 합니다.

이 부분은 아직 위의 파일을 작성조차 시작 못하고 있으니 모르는 부분인데요.
만든 파일을 이미지로 만든 다음 그것으로 부팅을 하려고 하면 어떻게 해야 하나요?

*******************************************************************************

모르는 것이 너무 많습니다. 쉽고 자세한 설명이면 감사하겠습니다.
알고 계시는 것이 있다면 많은 가르침 부탁드리겠습니다.
감사합니다.

File attachments: 
첨부파일 크기
Image icon EMACS.png36.49 KB
goforit의 이미지


"Hellow World" 어플리케이션을 만들고, 코드에 보이는 네가지 중 하나로 치환하면 됩니다.

File: init/main.c of Linux kernel.

static int __ref kernel_init(void *unused)
{
...
...
  if (!run_init_process("/sbin/init") ||
      !run_init_process("/etc/init") ||
      !run_init_process("/bin/init") ||
      !run_init_process("/bin/sh"))
    return 0;
...

메세지 출력 장소(화면)을 고려해야 하는데, 일단 이렇게 한번 보세요. ^^

aeeeefff의 이미지

알아보니 emacs로는 수정만 되고 삭제랑 추가는 안된다는군요.

Prentice의 이미지

touch hello.hexl

혹시 이걸 바라시는 건가요?

aeeeefff의 이미지

잘모르겠습니다.

Prentice의 이미지

이맥스 말고 셸에서 touch hello.hexl 실행하시면, hello.hexl 파일이 없으면 현재 디렉터리에 크기가 0인 파일로 새로 생깁니다.

혹시 hello.hexl 파일이 있었다면 수정 시간이 최근으로 갱신됩니다.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.