Hi, how would I make a simple kernel in C that I could boot on my PC?
Comatose commented: Fantastic Find +9
minigweek commented: Correct! +2
Hi, how would I make a simple kernel in C that I could boot on my PC?
This...
What do you mean?
I switched from Dev-C++ to Code::Blocks. No difference in compiler (I use MinGW), but I like the GUI a lot more than Dev's.
1. The port doesn't have to be 1337, it was just an example
2. Thanks pipaman, I'll try that
Hi, I was wondering how you would intercept data on a given port without interrupting it in WINSOCK. Like if computer A sent computer B "hi" on port 1337 and it was received on a server program. How could I listen for that data on computer B, but still let the data get to the server program. If you have no Idea what I'm asking just tell me and I'll try to explain it better.
Hi, I'm thinking of getting a new CPU. Here it is on NewEgg: http://www.newegg.com/Product/Product.aspx?Item=N82E16819116027. My motherboard is here:http://www.dealtime.com/xPF-SIS661FX-PGA478-M-ATX-PRESCOTT. My question is: will my motherboard support this CPU? Thanks in advance.
Ok
You can also do:
#include <iostream>
#include <conio.h>
int main()
{
std::cout << "HELLO WORLD!!!!!!!111";
getch();
}
Can I make the cache bigger?
Hi, I recently got 2 GB of DDR-SDRAM and an NVIDIA GeForce AGP graphics card. My processor is 2.5 Ghz (Uniprocessor), but I think it runs slow. At my school, there are uniprocessor pcs which run faster. They have less RAM and slower CPUs too. I don't know why this is happening, but how could I optimize my processor without overclocking it.
My computer specs (not updated on my profile, I'm going to later):
MS Windows XP SP2
Intel Celeron 2.5 Ghz CPU
2.0 GB DDR-SDRAM
NVIDIA GeForce 6200
I have attached a list of my processes from windows powershell. It looks like crap in notepad, so open it in ConText or something. My computer has recently been cleaned out (dust and stuff), so I know that's not the problem.
H a n d l e s N P M ( K ) P M ( K ) W S ( K ) V M ( M ) C P U ( s ) I d P r o c e s s N a m e
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1 1 3 6 1 3 6 0 3 7 8 8 3 3 0 . 1 1 2 7 0 0 a l g
9 6 5 1 9 2 4 2 5 6 8 2 0 0 . 0 9 1 4 7 6 A p p l e M o b i l e D e v i c e S e r v i c e
2 0 1 5 3 4 0 8 4 7 2 4 8 1 . 2 2 1 5 2 0 a v g a m s v r
2 3 7 6 4 1 4 8 4 9 2 6 9 4 . 0 3 2 9 6 a v g c c
1 8 5 7 2 4 0 4 1 9 5 6 5 2 0 . 6 6 1 7 5 6 a v g e m c
7 3 2 6 0 0 7 0 0 1 9 0 . 0 3 1 7 0 0 a v g u p s v c
5 9 7 6 2 6 9 6 4 8 7 6 2 6 2 5 . 1 6 6 3 2 c s r s s
1 6 1 6 1 1 8 4 4 3 8 0 3 9 3 . 2 0 1 6 1 6 c t f m o n
5 1 2 1 9 2 0 8 8 0 1 1 2 2 4 1 0 0 5 3 . 6 7 1 4 8 0 e x p l o r e r
1 0 4 3 5 0 6 6 4 1 6 8 2 2 1 2 1 5 1 7 9 8 . 9 7 3 5 6 4 f i r e f o x
1 9 4 5 3 1 4 0 1 8 6 8 4 7 0 . 3 1 5 1 2 G o o g l e T o o l b a r N o t i f i e r
5 1 2 5 3 2 1 8 2 4 1 4 0 . 2 5 2 3 6 8 h p h i p m 1 1
1 2 3 4 2 7 7 6 5 5 9 6 4 3 0 . 3 1 2 8 8 h p h m o n 0 4
0 0 0 1 6 0 0 I d l e
1 8 1 6 9 1 4 4 1 6 0 0 0 6 1 2 . 0 2 4 4 4 I n C D
2 4 7 5 2 4 7 2 5 2 5 6 4 1 4 5 . 6 7 1 8 3 6 I n C D s r v
1 3 1 4 2 4 3 6 4 0 6 0 3 5 0 . 5 6 2 4 6 0 i P o d S e r v i c e
1 9 2 7 4 5 5 7 5 8 4 6 9 2 8 0 2 1 7 8 5 7 . 9 2 3 8 5 6 i T u n e s
2 9 6 7 5 3 5 6 9 4 6 4 7 6 0 . 7 5 4 6 4 i T u n e s H e l p e r
4 3 2 7 1 6 2 5 2 8 2 8 0 . 0 5 3 0 4 j u s c h e d
4 5 7 1 1 4 4 2 0 1 1 0 4 4 4 2 . 8 3 7 1 6 l s a s s
3 7 2 6 6 8 2 6 2 0 2 3 0 . 1 4 1 9 0 8 L S S r v c
8 6 3 9 1 6 2 8 2 4 3 3 0 . 4 4 1 9 8 4 M D M
1 5 5 9 1 4 4 0 3 8 1 2 3 6 0 . 1 6 1 7 8 8 m D N S R e s p o n d e r
1 3 5 4 3 5 0 8 6 7 8 8 4 2 0 . 4 7 4 3 6 N B H G u i
1 1 3 3 2 2 3 6 3 8 6 8 2 5 0 . 2 8 4 9 2 n v s v c 3 2
3 5 7 8 3 8 7 3 6 3 5 7 4 8 1 4 3 1 2 . 8 3 7 6 8 p o w e r s h e l l
1 0 0 4 2 1 6 0 6 3 8 0 4 1 3 . 0 8 4 2 8 r o b o t a s k b a r i c o n
3 2 2 8 1 8 0 4 3 4 8 8 2 1 7 . 0 2 7 0 4 s e r v i c e s
2 1 1 1 6 8 3 9 6 4 0 . 9 2 5 6 4 s m s s
1 2 9 5 3 3 5 6 5 1 8 8 4 9 0 . 3 9 1 3 0 8 s p o o l s v
7 2 4 8 7 6 2 4 1 6 1 4 0 . 0 2 3 8 8 s q l b r o w s e r
2 8 3 8 3 3 4 3 2 1 5 0 4 1 4 9 4 1 . 9 4 2 0 1 2 s q l s e r v r
8 2 2 9 2 0 3 4 9 2 2 0 0 . 1 3 9 0 4 s q l w r i t e r
1 9 4 6 2 9 7 2 4 7 7 6 5 9 0 . 3 1 8 5 2 s v c h o s t
3 6 5 1 4 2 0 5 2 4 5 4 8 3 5 0 . 8 1 9 2 0 s v c h o s t
1 5 2 8 5 3 1 3 1 6 0 2 1 7 9 6 9 7 1 2 . 3 8 9 6 4 s v c h o s t
1 6 4 7 1 4 8 0 3 8 0 8 3 0 0 . 3 6 1 0 1 2 s v c h o s t
2 1 1 6 1 8 9 2 4 5 7 2 3 7 0 . 2 0 1 0 5 6 s v c h o s t
1 2 3 4 2 4 1 2 4 2 5 2 3 5 0 . 5 2 1 2 1 6 s v c h o s t
3 6 1 0 0 2 2 0
Do you need help with anything? If you're just posting this and don't need help, you could put it into the code snippets section.
I'm thinking about building a new computer. How much do you think it would cost for a REALLY fast processor, motherboard, power supply, hard disk, RAM, and everything else to build a computer from scratch?
Would turning the quality down increase performance? Also, 30 FPS would be good enough for me. I sometimes get it down to only 5 FPS.
Hi, I just bought 2 GB of DDR-SDRAM and an e-GeForce 6200 graphics card (AGP) by NVIDIA. I bought a game (The Orange Box), installed Half-Life 2, and ran it. The graphics displayed perfectly and there was no lag there, but when the game started handling AI, gunfire, etc., it LAGGED A LOT! So I'm thinking of buying a new processor. I have no idea which CPUs will work on my motherboard. If you have any ideas, please help.
My motherboard is: MSI 661FM2-LSR (MS-7060)
<winsock.h> :P
It compiles fine with Code::Blocks and MinGW. You have to link with libwinmm.a if you have MinGW or winmm.lib for anything else.
I have no problem with WINSOCK, I just wanted to know if there are any other ways to use sockets on Windows. I could probably get cygwin, too.
After messing with the program for a while, I found that recv will return 0 if it's done. Is this correct?
Hi, I'm using WinSock, and am making a function to receive data. How can I know when I have reached the end of the data that I'm receiving. Like, if I send "GET /" to www.google.com on port 80, I should receive the HTML of the index page. But in my loop that receives, it won't stop until it gets x number of bytes. This results in an infinite loop. How can I tell if a server stops sending me data so I can stop the loop?
bool RecvAll(SOCKET sock, char *data, long size)
{
long BytesRecv = 0;
long BytesRecvTemp = 0;
if (sock == INVALID_SOCKET) return false;
while (BytesRecv < size)
{
BytesRecvTemp = recv(sock, data, size - BytesRecv, NULL);
if (BytesRecvTemp > 0)
{
BytesRecv += BytesRecvTemp;
data += BytesRecvTemp;
}
else if (BytesRecvTemp < 0)
{
memset(data, 0, size);
return false;
}
}
return true;
}
So I am doomed to WINSOCK?
I installed Code::Blocks, and I set my compiler as MinGW which is installed on my computer, but there still is not a <sys/socket.h> include, which compiler should I install. I'm on Windows XP Pro SP2 32 Bit.
Hi, is there a socket library besides WINSOCK that I can use with Dev-C++. I don't have a <sys\socket.h> include. Is there a devpak that I can get, or am I doomed to WINSOCK?
I did a registry fix on HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management, and that lowered my PF usage, and Windows seems more lenient to use more RAM. I'm going to get 2 GB of RAM later this month as I said, but my motherboard only supports DDR RAM, should I get a new mothermoard that supports DDR2, or is just regular DDR just as good?
I used the memory restoring thing. It freed some, and Windows used it, but I still stay above 100 Mb free of RAM. Can I get Windows to use swap file only if it's extremely low on RAM?
Why won't Windows just use at least 3/4 of the RAM without going into the swap file? I'm on another computer and it has about 1 Gb of RAM free, but I'm using 263 Mb of the swap file.
Hi, I have 490 MB of RAM, but in the task manager, while running firefox and some other stuff, it says i have 160 MB free physical memory, but it also says I'm using almost 500 MB of my swap file! How can I get Windows to utilize that extra RAM? :P
Here's what the task manager says:
Total physical memory: 490992 Kb
PF Usage: 492 MB
If I need more RAM, I'm getting some later this month anyway, but right now I only have 490 MB.
On this line:
int holdu, holdc, p, i,;
take out the comma after the i:
int holdu, holdc, p, i;
To export code as HTML, do File->Export->To HTML. If I interpreted your second question right, to write output from your program to an HTML file, just do some file I/O.
I was just curious, I absolutely do not want to make any type of virus, trojan, or malware.
So there's absolutely no way possible for the average person to write to it?
Hi, I was told that you can crash Windows in C++ or C by "corrupting the kernel", and I wanted to know if this was actually possible. If anyone knows if this is possible, or how it happens, please tell me. ;)
Hi, I have put DSL (Damn Small Linux) onto my 256 MB pen drive to try and boot my computer with it. I can, but it says it can't find the KNOPPIX file system. I can boot it from Windows with QEMU, and it works fine. I have tried this on two computers, so I know it's not them. My pendrive is formatted in FAT (I have already tried FAT32 with no luck), it's a 256MB SanDisk Cruzer Freedom, if that helps any.
Hello is spelled without the w. =)
Also, trigonometry is the way to go. You can probably find a tutorial or something: www.google.com/search?q=Trigonometry+Tutorial
In Beginning Game Programming by Michael Morrison, it tells how to get joystick input. Get it from the library or something.
Hi, I was reading something that said goto was bad. Why is it a bad practice to use it?
The Dev-Pak for GMP is on this thread. I attached it to one of my posts: http://www.daniweb.com/forums/thread145324.html
Weird, I just used Windows' BITMAPFILEHEADER and BITMAPINFOHEADER structures and it worked fine. Thx anyway.
Hi, I'm reading a bitmap manually to try and make a program that does steganography, but I can't read the file correctly. The headers I read come out completely messed up, and they fail the check to see if I'm reading a bitmap file or not (if (FileHeader.bfType != (int)"BM")). Please help.
#include <iostream>
#include <stdio.h>
using namespace std;
class BMP
{
public:
typedef struct
{
WORD bfType;
DWORD bfSize;
DWORD bfReserved;
DWORD bfOffBits;
} BMP_FILE_HEADER;
typedef struct
{
DWORD biSize;
LONG biWidth;
LONG biHeight;
WORD biPlanes;
WORD biBitCount;
DWORD biCompression;
DWORD biSizeImage;
LONG biXPelsPerMeter;
LONG biYPelsPerMeter;
DWORD biClrUsed;
DWORD biClrImportant;
} BMP_INFO_HEADER;
BMP_FILE_HEADER FileHeader;
BMP_INFO_HEADER InfoHeader;
unsigned char *Data;
// Methods
bool LoadBitmapFile(const char *Filename);
};
bool BMP::LoadBitmapFile(const char *Filename)
{
BMP Bitmap;
unsigned char *bitmap_Image;
FILE *File = NULL;
unsigned int ImageIdx = 0;
File = fopen(Filename,"rb");
if (!File)
return false;
// Read the file header
fread(&Bitmap.FileHeader, sizeof(BMP_FILE_HEADER), 1, File);
// Check if its a bitmap or not
if (FileHeader.bfType != (int)"BM")
return false;
// Read the info header
fread(&Bitmap.InfoHeader, sizeof(BMP_INFO_HEADER), 1, File);
// Store the data
memcpy((char*)&this->FileHeader, (char*)&Bitmap.FileHeader, sizeof(BMP_FILE_HEADER));
memcpy((char*)&this->InfoHeader, (char*)&Bitmap.InfoHeader, sizeof(BMP_INFO_HEADER));
// Move to the bitmap data
fseek(File, Bitmap.FileHeader.bfOffBits, SEEK_SET);
// Allocate memory
if (Bitmap.InfoHeader.biSizeImage != 0)
bitmap_Image = (unsigned char*)calloc(Bitmap.InfoHeader.biSizeImage, sizeof(unsigned char));
if (!bitmap_Image)
{
free(bitmap_Image);
fclose(File);
return false;
}
// Get RGB instead of BGR
for (ImageIdx=0; ImageIdx < Bitmap.InfoHeader.biSizeImage; ImageIdx+=3)
{
bitmap_Image[ImageIdx] = bitmap_Image[+2];
bitmap_Image[ImageIdx+2] = bitmap_Image[ImageIdx];
}
// Store the bitmap data
memcpy((unsigned char*)&this->Data, (unsigned char*)&bitmap_Image, Bitmap.InfoHeader.biSizeImage);
// Clean up and …
I have tried to do this before. Just read a tutorial on how to do it by hand and make a function or whatever.
Check this out: http://www.permadi.com/tutorial/numBinToDec/index.html
Pretty much, you move left starting from the first binary digit on the right. You increment the power from 0, and multiply the digit by 2^power. So:
1010
0*(2^0) = 0
1*(2^1) = 2
0*(2^2) = 0
1*(2^3) = 8
0 + 2 + 0 + 8 = 10
1010 = 10
I'm pretty sure that you can do this conversion for any number base system. Like for base 3: instead of Digit*(2^Power), you would do Digit*(3^Power).
Thanks! That works perfectly! :)
In Dev-C++ 4.9.9.2:
`bool' undeclared (first use in this function)
(Each undeclared identifier is reported only once for each function it appears in.)
Hi, I keep getting an undefined identifier error when I try to do this:
typedef char bool; // Make a bool type
char false = 0, true = 1; // Make true and false
void foo()
{
switch (something)
{
case 1:
bool aaaaa;
break;
}
}
It only gives me an error it if i try to declare it in a case. Please help :P
o thanks!
Hi, I'm taking a programming class at my school. My teacher gave us a pdf that said "..You will be writing a program that can read a bitmap and insert a secret message into the bytes of the picture in a retrievable way using the picture as a cipher and return the original message. This is a type of encryption that is very easy to accomplish and very difficult to decipher or uncover. It both ends of the communication have the same original picture, then deciphering is asimple matter of filtering out the original, and all you have left is the message."
He hasn't assigned it yet, but I just want to know if that is possible while keeping the original picture with the secret message in the bitmap or whatever we're using. Like having the message "stuffffff" in the picture, but have the picture look the same as the original.
Nice chococrack =)
You need to add the bin directory of MinGW to your PATH environment variable.
Hi, I'm need to be able to load bitmaps, preferably as resources, draw them, and get their size. How would I do this? I'm on Windows, and using Dev-C++ 4.9.9.2.